Payment Inquiry

👍

HTTPS POST / Server-to-Server

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

Go live when you are ready, Live endpoint is provided.

Payment Inquiry is a common API for merchant who want inquiry payment detail

Payment Inquiry Request


Below are the guidelines that how to prepare a payment inquiry request and send to 2c2p

  1. Prepare payload data. Below sample request data show the request structure. Refer Payment Inquiry Request Parameter for API Specification.
{
    "paymentToken": "kSAops9Zwhos8hSTSeLTUcCrwcnrndJUZanGJy3fBEsXCiYmynwxHvK5h7XPBadJqD0nG7v65t5N2jPVrnwX2jL4nu+KKSegjUjERKCyWPg=",
    "merchantID": "JT01",
    "invoiceNo": "254b77aabc",
    "locale": "en"
}

 

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

 

Payment Inquiry Response


Below are the guidelines that how to process payment inquiry response from 2c2p.

  1. Payment Inquiry API will return response data that contain JWT token. Sample response show below.
{
    "payload": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjaGFudElEIjoiSlQwMSIsImludm9pY2VObyI6IjE1MjM5NTM2NjEiLCJhbW91bnQiOjEwMDAsImN1cnJlbmN5Q29kZSI6IlNHRCIsInRyYW5zYWN0aW9uRGF0ZVRpbW
UiOiIzMTEyMjAyMzU5NTkiLCJhZ2VudENvZGUiOiJPQ0JDIiwiY2hhbm5lbENvZGUiOiJWSSIsImFwcHJvdmFsQ29kZSI6IjcxNzI4MiIsInJlZmVyZW5jZU5vIjoiMDAwMTAwMDEiLCJwYW4iOiI0MTExMTFYWFhYWFgxMTExIiwiY2FyZFRva2VuI
joiIiwiaXNzdWVyQ291bnRyeSI6IlNHIiwiZWNpIjoiMDUiLCJpbnN0YWxsbWVudFBlcmlvZCI6NiwiaW50ZXJlc3RUeXBlIjoiTSIsImludGVyZXN0UmF0ZSI6MC4zLCJpbnN0YWxsbWVudE1lcmNoYW50QWJzb3JiUmF0ZSAiOjAsInJlY3Vycmlu
Z1VuaXF1ZUlEIjoiIiwidXNlckRlZmluZWQxIjoiIiwidXNlckRlZmluZWQyIjoiIiwidXNlckRlZmluZWQzIjoiIiwidXNlckRlZmluZWQ0IjoiIiwidXNlckRlZmluZWQ1IjoiIiwicmVzcENvZGUiOiIwMDAwIiwicmVzcERlc2MiOiJUcmFuc2F
jdGlvbiBpcyBzdWNjZXNzZnVsLiJ9.1PkVKntn0JgsZs9ilgJq2ruTzZaJ_QcOMi_LnOlbqFM"
}
  1. You wouldn't recognize the meaning of JWT payload response and it is required to decode it, refer to Decode JWT Token

Below are sample payment inquiry response refer to Payment Inquiry Response Parameter for API Specification.

{
    "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."
}