These docs are for v4.0.2. Click to read the latest docs for v4.3.0.

Payment Inquiry

👍

HTTPS POST / Server-to-Server

Payment requests and responses are encrypted using JWT

  • Algorithm : HMAC SHA-256 using Merchant’s Secret Key.

Refer JWT Token Guide on how to prepare requests and process responses.

https://sandbox-pgw.2c2p.com/payment/4.1/paymentInquiry
https://pgw.2c2p.com/payment/4.1/paymentInquiry

📘

API Parameter

Payment Inquiry Request Parameter
Payment Inquiry Response Parameters

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.
  2. Generate the JWT Token. Refer to: Generate JWT Token
{
    "merchantID": "JT01",
    "invoiceNo": "254b77aabc",
    "locale": "en"
}
{
    "payload": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXltZW50VG9rZW4iOiIyNTRiNzdhNS01NTY4LTQ5Y2EtOWUwZS0yZjhkMjhiZTk1ZTciLCJpbnZvaWNlTm8iOiIyNTRiNzdhYWJjIiwibG9jYWxlIjoiZW4ifQ.r8EEFRXlNcLi566BrzroOh6qbjGSyWqJ9ZARSR5XwQ4"
}

 
3. Assign the JWT token to payload and send the API request

curl --location --request POST 'https://sandbox-pgw.2c2p.com/payment/4.1/paymentInquiry' \
--header 'Content-Type: application/json' \
--data-raw '{
    "payload": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXltZW50VG9rZW4iOiIyNTRiNzdhNS01NTY4LTQ5Y2EtOWUwZS0yZjhkMjhiZTk1ZTciLCJpbnZvaWNlTm8iOiIyNTRiNzdhYWJjIiwibG9jYWxlIjoiZW4ifQ.r8EEFRXlNcLi566BrzroOh6qbjGSyWqJ9ZARSR5XwQ4"
}'

 

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.
  2. The JWT token must be decoded. Refer to: Decode JWT Token
{
    "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."
}
{
    "payload": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjaGFudElEIjoiSlQwMSIsImludm9pY2VObyI6IjE1MjM5NTM2NjEiLCJhbW91bnQiOjEwMDAsImN1cnJlbmN5Q29kZSI6IlNHRCIsInRyYW5zYWN0aW9uRGF0ZVRpbW
UiOiIzMTEyMjAyMzU5NTkiLCJhZ2VudENvZGUiOiJPQ0JDIiwiY2hhbm5lbENvZGUiOiJWSSIsImFwcHJvdmFsQ29kZSI6IjcxNzI4MiIsInJlZmVyZW5jZU5vIjoiMDAwMTAwMDEiLCJwYW4iOiI0MTExMTFYWFhYWFgxMTExIiwiY2FyZFRva2VuI
joiIiwiaXNzdWVyQ291bnRyeSI6IlNHIiwiZWNpIjoiMDUiLCJpbnN0YWxsbWVudFBlcmlvZCI6NiwiaW50ZXJlc3RUeXBlIjoiTSIsImludGVyZXN0UmF0ZSI6MC4zLCJpbnN0YWxsbWVudE1lcmNoYW50QWJzb3JiUmF0ZSAiOjAsInJlY3Vycmlu
Z1VuaXF1ZUlEIjoiIiwidXNlckRlZmluZWQxIjoiIiwidXNlckRlZmluZWQyIjoiIiwidXNlckRlZmluZWQzIjoiIiwidXNlckRlZmluZWQ0IjoiIiwidXNlckRlZmluZWQ1IjoiIiwicmVzcENvZGUiOiIwMDAwIiwicmVzcERlc2MiOiJUcmFuc2F
jdGlvbiBpcyBzdWNjZXNzZnVsLiJ9.1PkVKntn0JgsZs9ilgJq2ruTzZaJ_QcOMi_LnOlbqFM"
}

Run test with Swagger Editor