QuickPay Query API
HTTPS POST / Server-to-Server
QuickPay Query requests and responses are encoded using Base64. Merchant required to:
- Encode the QuickPay Query request
- Decode the QuickPay Query response
https://demo2.2c2p.com/2C2PFrontEnd/QuickPay/DirectAPI
https://t.2c2p.com/QuickPay/DirectAPI
API Parameter
QuickPay Query Request Parameters
QuickPay Query Response Parameter
Generate Query Request
- Prepare Query API request to inquire about QuickPay data.
- Bind the QuickPay Query Request data into QPQueryReq.
Encode the request data in Base64 format. The sample code below demonstrates correctly encoded request data.
{
"QPQueryReq": {
"version": "2.4",
"merchantID": "JT01",
"qpID": "230969",
"timeStamp": "20210125043007",
"hashValue": "0b696b3189f3e364d5f85d3bd2c65b92a2f4d887"
}
}
ewoJIlFQUXVlcnlSZXEiOiB7CgkJInZlcnNpb24iOiAiMi40IiwKCQkibWVyY2hhbnRJRCI6ICJKVDAxIiwKCQkicXBJRCI6ICIyMzA5NjkiLAoJCSJ0aW1lU3RhbXAiOiAiMjAyMTAxMjUwNDMwMDciLAoJCSJoYXNoVmFsdWUiOiAiMGI2OTZiMzE4OWYzZTM2NGQ1Zjg1ZDNiZDJjNjViOTJhMmY0ZDg4NyIKCX0KfQ==
- Send the encoded request to the API endpoint.
curl --location --request POST 'https://demo2.2c2p.com/2C2PFrontEnd/QuickPay/DirectAPI' \
--header 'Content-Type: text/plain' \
--data-raw 'ewoJIlFQUXVlcnlSZXEiOiB7CgkJInZlcnNpb24iOiAiMi40IiwKCQkibWVyY2hhbnRJRCI6ICJKVDAxIiwKCQkicXBJRCI6ICIyMzA5NjkiLAoJCSJ0aW1lU3RhbXAiOiAiMjAyMTAxMjUwNDMwMDciLAoJCSJoYXNoVmFsdWUiOiAiMGI2OTZiMzE4OWYzZTM2NGQ1Zjg1ZDNiZDJjNjViOTJhMmY0ZDg4NyIKCX0KfQ=='
Query Response
- To process a response from the Query API, refer to the sample response below. Note that the API will return response data in Base64 format.
- Decode the response data. The sample code below demonstrates correctly decoded API response data.
- Read the API response data from QPQueryRes.
{
"QPQueryRes": {
"version": "2.4",
"timeStamp": "20210125153225",
"qpID": "230969",
"orderIdPrefix": "QP-2112535737",
"description": "Test",
"currency": "SGD",
"amount": "100.00",
"allowMultiplePayment": "N",
"maxTransaction": "1",
"expiry": "2024-12-31 23:59:59",
"userData1": "",
"userData2": "",
"userData3": "",
"userData4": "",
"userData5": "",
"promotion": "",
"categoryId": "",
"resultUrl1": "https://demo2.2c2p.com/paymentresult/v3uifrontendurl.aspx",
"resultUrl2": "https://demo2.2c2p.com/paymentresult/v3uibackendurl.aspx",
"paymentOption": "",
"ippInterestType": "",
"paymentExpiry": "",
"url": "https://demo2.2c2p.com/2C2PFrontend/qp/71HS",
"currentApproved": "0",
"clickCount": "0",
"request3DS": "N",
"enableStoreCard": "N",
"recurring": "N",
"recurringAmount": "",
"allowAccumulate": " ",
"maxAccumulateAmount": "",
"recurringInterval": "",
"RecurringCount": "",
"chargeNextDate": "",
"chargeOnDate": "",
"useStoreCardOnly": "N",
"storeCardUniqueID": "",
"ippPeriodFilter": "",
"resCode": "000",
"resDesc": "Success",
"hashValue": "F5A6D5734BC2E79C1CBAF83285C7C89EED5D8C4B"
}
}
ewoJIlFQUXVlcnlSZXMiOiB7CgkJInZlcnNpb24iOiAiMi40IiwKCQkidGltZVN0YW1wIjogIjIwMjEwMTI1MTUzMjI1IiwKCQkicXBJRCI6ICIyMzA5NjkiLAoJCSJvcmRlcklkUHJlZml4IjogIlFQLTIxMTI1MzU3MzciLAoJCSJkZXNjcmlwdGlvbiI6ICJUZXN0IiwKCQkiY3VycmVuY3kiOiAiU0dEIiwKCQkiYW1vdW50IjogIjEwMC4wMCIsCgkJImFsbG93TXVsdGlwbGVQYXltZW50IjogIk4iLAoJCSJtYXhUcmFuc2FjdGlvbiI6ICIxIiwKCQkiZXhwaXJ5IjogIjIwMjQtMTItMzEgMjM6NTk6NTkiLAoJCSJ1c2VyRGF0YTEiOiAiIiwKCQkidXNlckRhdGEyIjogIiIsCgkJInVzZXJEYXRhMyI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