# Query ATM Payment

# Specification

  • The following table is a specification of this API:
Name Description
API Name CPMPayment
Function This API is used to query AMT payments from merchant to PayCools as the acquirer
Service Code 91
Method POST
URL /v2.0/cdm/cdm-mpm-query
Accept application/json
Content Type application/json
Related Service
Expected Timeout 8 second

# Request

  • The following part will be describe about parameter of request in this API:

# Request Parameter

  • The following table is a list of request parameter in this API:
  • The following table is a header of request parameter:
No Name Type Length Required Condition Remarks
1 Content-Type String Variable, 127 max Mandatory - Content type, value always application/json
2 Authorization String Variable, 2048 max Mandatory Represents access_token of a request, starts with keyword “Bearer” and followed by access_token
3 X-TIMESTAMP String Fixed, 25 max Mandatory - Transaction date time, in format YYYY-MM-DDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time)
4 X-SIGNATURE String Variable Mandatory - created using asymmetric signature SHA256withRSA algorithm of X-CLIENT-KEY + “|” + X-TIMESTAMP
for example:3a34d6a9debb4246931f3941c471dd3b|2023-09-25T17:57:35+07:00
5 X-PARTNER-ID String Variable, 36 max Mandatory - Unique identifier for partner was generated by PayCools, or known as appId

# Body

  • The following table is a body of request parameter:
No Name Type Length Required Condition Remarks
1 originalPartnerReferenceNo String Variable, 50 max Mandatory - Unique transaction identifier in client system.
2 merchantId String Variable, 64 max Mandatory - Unique identifier for partner was generated by PayCools, or known as appId
3 serviceCode String Variable, 64 max Mandatory - Service code of original transaction, which could be 90 (CDM)
4 fromDateTime String Fixed, 25 max Mandatory - Starting time range, in format YYYY-MM-DDTHH:mm:ss+07:00. Time must be in UTC.
5 toDateTime String Fixed, 25 max Mandatory - Ending time range, in format YYYY-MM-DDTHH:mm:ss+07:00. Time must be in UTC.

# REQUEST SAMPLE

POST /v2.0/cdm/cdm-mpm-query HTTP/1.1
Content-type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJhcHBJZCI6ImNiY2U0OTBlODJmODQxZjJiMzE2MmE4ZGQyN2U5ZmQxIiwiY2FjaGVLZXkiOiJUT0tFTl9BUElfY2JjZTQ5MGU4MmY4NDFmMmIzMTYyYThkZDI3ZTlmZDFfMjEwMDJiMGYtMDJkNS00ZDI2LTg4MmEtMGRmNWI5MzVlNWVhIiwiY3JlYXRlVGltZSI6MTY5NjY1MDAyMTg3OX0.mkiFEVNvWTJDVLTvY9oE2u4w76wnlra1mwzC79SG-Zo
X-TIMESTAMP: 2023-09-25T17:57:35+07:00
X-SIGNATURE:
Dupbr1ILxsfBrXFmeDdIjwCmgv6AF+JQeIpD1Gq8HDjow7avCXdZAPOEbxVe7/x0atxy86aUfC11zXA1gvXXwxrTXFr6V0x8GZCyTndqnDyRlBeEZLL3BLmDRkrSsomd/mv1eG/th4TQndSPrBBfbN3bj0yIB99y2BnU5fBy7B0ZhYiQVs3uREspIsBB99F/4Zv8GbPWvik2usdOUo0gfPAQoZ3MJAcBQ/0vMRT5KdLm903C2HNyl1Cpb6OFRgaU2LAWybEQIC2QJ9mFb08NPR0PEu75WpVHNrFYn8gfiI8nRso0vBJhtMZrRINDQf9scV53cFdjpWobQHvnFDHCqQ==
X-PARTNER-ID: cbce490e82f441f2b3162a2dd27e8fd1

{
    "originalPartnerReferenceNo":"test402787228481568",
    "merchantId":"cbce490e82f841f2b3162a8dd27e9fd1",
    "serviceCode":"90",
    "fromDateTime":"2020-12-21T17:55:11+07:00",
    "toDateTime":"2022-01-21T17:55:11+07:00",
}

# Response

  • The following part will be describe about parameter of response in this API:

# Response Parameter

  • The following table is a list of response parameter in this API:

# Header

  • The following table is a header of response parameter:
No Name Type Length Required Condition Remarks
1 Content-Type String Variable, 127 max Mandatory - Content type, value always application/json
2 X-TIMESTAMP String Fixed, 25 max Mandatory - Transaction date time, in format YYYY-MM-DDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time)

# Body

  • The following table is a body of response parameter:
No Name Type Length Required Condition Remarks
1 responseCode String Fixed, 7 max Mandatory - Refer to response code list
2 responseMessage String Variable, 150 max Mandatory - Refer to response code list
4 originalPartnerReferenceNo String Variable Mandatory - Unique identifier of the transaction client would like to query
5 serviceCode String Variable Mandatory - Service code of original transaction, which could be 47 (create dynamic QR) or 78 (refund).
11 cdmNotifyItems Array of CdmQueryRespItem Variable Conditional Y:= Successfully processed Additional information

# Response

Content-Type: application/json
X-TIMESTAMP: 2023-04-11T21:10:11+07:00
{
    "responseCode": "2009100",
    "responseMessage": "Successful",
    "originalPartnerReferenceNo": "test402787228481568",
    "serviceCode": "90",
    "cdmNotifyItems": [
    {
        "latestTransactionStatus": "00",
        "originalPartnerReferenceNo": "test402787228481568",
        "originalReferenceNo": "C1711314284761452544",
        "cdmQrcode": "userid123456789",
        "cdmReferenceId": "CDM2938845696",
        "machineNumber": "Kun520B40321",
        "channelReferNo": "Kun520B40321240403D001",
        "additionalInfo": {
            "channelCode": "ATM_STATIC_QR",
            "createTime": "2023-10-08T17:34:55+07:00",
            "returnTime": "2023-10-08T18:58:39+07:00"
        },
        "amount": {
            "currency": "IDR",
            "value": "30000.00"
        },
        "feeAmount": {
            "currency": "IDR",
            "value": "2000.00"
        },
        "totalAmount": {
            "currency": "IDR",
            "value": "30000.00"
        }
    }, {
        "latestTransactionStatus": "00",
        "originalPartnerReferenceNo": "test402787228481568",
        "originalReferenceNo": "C1711314284761452544",
        "cdmQrcode": "userid123456789",
        "cdmReferenceId": "CDM2938845696",
        "machineNumber": "Kun520B40321",
        "channelReferNo": "Kun520B40321240403D001",
        "additionalInfo": {
            "channelCode": "ATM_STATIC_QR",
            "createTime": "2023-10-08T17:34:55+07:00",
            "returnTime": "2023-10-08T18:58:39+07:00"
        },
        "amount": {
            "currency": "IDR",
            "value": "30000.00"
        },
        "feeAmount": {
            "currency": "IDR",
            "value": "2000.00"
        },
        "totalAmount": {
            "currency": "IDR",
            "value": "30000.00"
        }
    }
    ]
}

# Response Code and Message

  • The following table is the list response code and message of Balance Inquiry API:
No Response Code Response Message Remarks Partner Action Related Service
1 2009100 Successful Success to be processed Mark Query Payment process as Success and check the latestTransactionStatus, with these conditions:
00 = Order has been successfully in final state and paid. Mark Payment as Success
03 = Waiting for payment. Mark Payment as Pending
QRIS MPM (Acquirer) - SNAP
3 4009100 Bad Request General request failed error Mark Query Payment process as Failed and mark Payment as Pending. Retry request with proper parameter QRIS MPM (Acquirer) - SNAP
4 4009101 Invalid Field Format Invalid format for certain field Mark Query Payment process as Failed and mark Payment as Pending. Retry request with proper parameter QRIS MPM (Acquirer) - SNAP
5 4009102 Invalid Mandatory Field Missing or invalid format on mandatory field Mark Query Payment process as Failed and mark Payment as Pending. Retry request with proper parameter QRIS MPM (Acquirer) - SNAP
6 4019100 Unauthorized. [reason] General unauthorized error Mark Query Payment process as Failed and mark Payment as Pending. Retry request with proper parameter QRIS MPM (Acquirer) - SNAP
7 4019101 Invalid Token (B2B) Authorization token are invalid, perhaps due to token expiry for B2B Mark Query Payment process as Failed and mark Payment as Pending. Retry request with proper parameter QRIS MPM (Acquirer) - SNAP
11 4049101 Transaction Not Found Transaction not found Mark Query Payment process as Failed and mark Payment as Pending. Retry request with proper parameter QRIS MPM (Acquirer) - SNAP
13 4299100 Too Many Requests Maximum transaction limit exceeded Mark Query Payment process as Failed and mark Payment as Pending. Retry request with proper parameter QRIS MPM (Acquirer) - SNAP
14 5009100 General Error General error non retry-able Mark Query Payment process as Failed and mark Payment as Pending. Retry request with proper parameter QRIS MPM (Acquirer) - SNAP
15 5009101 Internal Server Error Unknown internal server failure, please retry the process again Mark Query Payment process as Failed and mark Payment as Pending. Retry request with proper parameter QRIS MPM (Acquirer) - SNAP
16 Total Timeout Total timeout, the client side does not get any responses from the server side (can be due to network issue, server slowing down, and so on) Do a retry maximum 3 attempts, if the result is still the same then action is aborted. Show appropriate error message to users QRIS MPM (Acquirer) - SNAP
17 Unexpected response (empty field/field does not exist/undefined response code) The server does not produce expected responses (can be due to hardware failure, bugs, and so on) If empty field/field does not exist, mark Query Payment process as Pending and mark Payment as Pending QRIS MPM (Acquirer) - SNAP