Payment Inquiry

👍

HTTPS POST / Server-to-Server

Sandbox Point : sandbox-pgw.2c2p.com/payment/4.1/paymentInquiry
Run test with Swagger Editor

To go live, refer to: Live endpoint guide

The Payment Inquiry API allows merchants to retrieve payment details.

Payment Inquiry Request


To prepare a payment inquiry request, refer to the guidelines below.

  1. Prepare payload data. The sample code below demonstrates the correct data structure for an API request.

For API specifications, refer to: Payment Inquiry Request Parameter

{
    "paymentToken": "kSAops9Zwhos8hSTSeLTUcCrwcnrndJUZanGJy3fBEsXCiYmynwxHvK5h7XPBadJqD0nG7v65t5N2jPVrnwX2jL4nu+KKSegjUjERKCyWPg=",
    "merchantID": "JT01",
    "invoiceNo": "254b77aabc",
    "locale": "en"
}

 

  1. Generate the JWT Token. Refer to: Generate JWT Token
  2. Assign the JWT token to payload and send the API request
{
    "payload": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXltZW50VG9rZW4iOiIyNTRiNzdhNS01NTY4LTQ5Y2EtOWUwZS0yZjhkMjhiZTk1ZTciLCJpbnZvaWNlTm8iOiIyNTRiNzdhYWJjIiwibG9jYWxlIjoiZW4ifQ.r8EEFRXlNcLi566BrzroOh6qbjGSyWq
J9ZARSR5XwQ4"
}

 

Payment Inquiry Response


To process a response from the Payment Inquiry API, refer to the guidelines below.

  1. The Payment Inquiry API will return response data that contains a JWT token. The sample code below demonstrates the structure of the JWT payload response.
{
    "payload": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjaGFudElEIjoiSlQwMSIsImludm9pY2VObyI6IjE1MjM5NTM2NjEiLCJhbW91bnQiOjEwMDAsImN1cnJlbmN5Q29kZSI6IlNHRCIsInRyYW5zYWN0aW9uRGF0ZVRpbW
UiOiIzMTEyMjAyMzU5NTkiLCJhZ2VudENvZGUiOiJPQ0JDIiwiY2hhbm5lbENvZGUiOiJWSSIsImFwcHJvdmFsQ29kZSI6IjcxNzI4MiIsInJlZmVyZW5jZU5vIjoiMDAwMTAwMDEiLCJwYW4iOiI0MTExMTFYWFhYWFgxMTExIiwiY2FyZFRva2VuI
joiIiwiaXNzdWVyQ291bnRyeSI6IlNHIiwiZWNpIjoiMDUiLCJpbnN0YWxsbWVudFBlcmlvZCI6NiwiaW50ZXJlc3RUeXBlIjoiTSIsImludGVyZXN0UmF0ZSI6MC4zLCJpbnN0YWxsbWVudE1lcmNoYW50QWJzb3JiUmF0ZSAiOjAsInJlY3Vycmlu
Z1VuaXF1ZUlEIjoiIiwidXNlckRlZmluZWQxIjoiIiwidXNlckRlZmluZWQyIjoiIiwidXNlckRlZmluZWQzIjoiIiwidXNlckRlZmluZWQ0IjoiIiwidXNlckRlZmluZWQ1IjoiIiwicmVzcENvZGUiOiIwMDAwIiwicmVzcERlc2MiOiJUcmFuc2F
jdGlvbiBpcyBzdWNjZXNzZnVsLiJ9.1PkVKntn0JgsZs9ilgJq2ruTzZaJ_QcOMi_LnOlbqFM"
}
  1. The JWT token must be decoded. Refer to: Decode JWT Token

The sample code below demonstrates the structure for the decoded API response. For more details on the specific parameters, refer to: Payment Inquiry Response Parameters

{
    "merchantID": "JT01",
    "invoiceNo": "1523953661",
    "amount": 1000.00,
    "currencyCode": "SGD",
    "transactionDateTime": "311220235959",
    "agentCode": "OCBC",
    "channelCode": "VI",
    "approvalCode": "717282",
    "referenceNo": "00010001",
    "cardNo": "411111XXXXXX1111",
    "cardToken": "",
    "issuerCountry": "SG",
    "eci": "05",
    "installmentPeriod": 6,
    "interestType": "M",
    "interestRate": 0.3,
    "installmentMerchantAbsorbRate ": 0.0,
    "recurringUniqueID": "",
    "fxAmount": 25000.00,
    "fxRate": 25.0000001,
    "fxCurrencyCode": "THB",
    "userDefined1": "",
    "userDefined2": "",
    "userDefined3": "",
    "userDefined4": "",
    "userDefined5": "",
    "acquirerReferenceNo": "",
    "acquirerMerchantId" : "",
    "cardType":"",
    "idempotencyID":"",
    "respCode": "0000",
    "respDesc": "Transaction is successful."
}