QuickPay Generate Link API

👍

HTTPS POST / Server-to-Server

Sandbox endpoint : demo2.2c2p.com/2C2PFrontEnd/QuickPay/DirectAPI

To go live, please refer to: Live endpoint guide

Generate Link Request


  1. To prepare an API request to generate a QuickPay link, refer to the sample request structure below.

For specific API request parameters, refer to: Generate Link Request Parameters

{
    "GenerateQPReq": {
        "version": "2.1",
        "merchantID": "JT01",
        "orderIdPrefix": "QP-2112535739",
        "description": "Test",
        "amount": "100.00",
        "currency": "SGD",
        "allowMultiplePayment": "N",
        "maxTransaction": "",
        "expiry": "26012021",
        "categoryId": "",
        "promotion": "",
        "paymentOption": "",
        "ippInterestType": "",
        "paymentExpiry": "",
        "request3DS": "N",
        "enableStoreCard": "N",
        "recurring": "N",
        "recurringAmount": "",
        "allowAccumulate": "",
        "maxAccumulateAmount": "",
        "recurringInterval": "",
        "recurringCount": "",
        "chargeNextDate": "",
        "chargeOnDate": "",
        "userData1": "",
        "userData2": "",
        "userData3": "",
        "userData4": "",
        "userData5": "",
        "resultUrl1": "https://demo2.2c2p.com/paymentresult/v3uifrontendurl.aspx",
        "resultUrl2": "https://demo2.2c2p.com/paymentresult/v3uibackendurl.aspx",
        "timeStamp": "20210125040647",
        "hashValue": "2fb533d5f6f0a473538f76ac070346797294bce7"
    }
}
  1. Bind the request data into GenerateQPReq.

Encode the request data in Base64 format. The sample code below demonstrates correctly encoded request data.

ewoJIkdlbmVyYXRlUVBSZXEiOiB7CgkJInZlcnNpb24iOiAiMi4xIiwKCQkibWVyY2hhbnRJRCI6ICJKVDAxIiwKCQkib3JkZXJJZFByZWZpeCI6ICJRUC0yMTEyNTM1NzM5IiwKCQkiZGVzY3JpcHRpb24iOiAiVGVzdCIsCgkJImFtb3VudCI6ICIxMDAuMDAiLAoJCSJjdXJyZW5jeSI6ICJTR0QiLAoJCSJhbGxvd011bHRpcGxlUGF5bWVudCI6ICJOIiwKCQkibWF4VHJhbnNhY3Rpb24iOiAiIiwKCQkiZXhwaXJ5IjogIjI2MDEyMDIxIiwKCQkiY2F0ZWdvcnlJZCI6ICIiLAoJCSJwcm9tb3Rpb24iOiAiIiwKCQkicGF5bWVudE9wdGlvbiI6ICIiLAoJCSJpcHBJbnRlcmVzdFR5cGUiOiAiIiwKCQkicGF5bWVudEV4cGlyeSI6ICIiLAoJCSJyZXF1ZXN0M0RTIjogIk4iLAoJCSJlbmFibGVTdG9yZUNhcmQiOiAiTiIsCgkJInJlY3VycmluZyI6ICJOIiwKCQkicmVjdXJyaW5nQW1vdW50IjogIiIsCgkJImFsbG93QWNjdW11bGF0ZSI6ICIiLAoJCSJtYXhBY2N1bXVsYXRlQW1vdW50IjogIiIsCgkJInJlY3VycmluZ0ludGVydmFsIjogIiIsCgkJInJlY3VycmluZ0NvdW50IjogIiIsCgkJImNoYXJnZU5leHREYXRlIjogIiIsCgkJImNoYXJnZU9uRGF0ZSI6ICIiLAoJCSJ1c2VyRGF0YTEiOiAiIiwKCQkidXNlckRhdGEyIjogIiIsCgkJInVzZXJEYXRhMyI6ICIiLAoJCSJ1c2VyRGF0YTQiOiAiIiwKCQkidXNlckRhdGE1IjogIiIsCgkJInJlc3VsdFVybDEiOiAiaHR0cHM6Ly9kZW1vMi4yYzJwLmNvbS9wYXltZW50cmVzdWx0L3YzdWlmcm9udGVuZHVybC5hc3B4IiwKCQkicmVzdWx0VXJsMiI6ICJodHRwczovL2RlbW8yLjJjMnAuY29tL3BheW1lbnRyZXN1bHQvdjN1aWJhY2tlbmR1cmwuYXNweCIsCgkJInRpbWVTdGFtcCI6ICIyMDIxMDEyNTA0MDY0NyIsCgkJImhhc2hWYWx1ZSI6ICIyZmI1MzNkNWY2ZjBhNDczNTM4Zjc2YWMwNzAzNDY3OTcyOTRiY2U3IgoJfQp9
  1. Send the encoded request to the API endpoint.

 

Generate Link Response


  1. To process a response from the Generate Link API, refer to the sample response below. Note that the API will return response data in Base64 format.
eyJHZW5lcmF0ZVFQUmVzIjp7InZlcnNpb24iOiIyLjEiLCJ0aW1lU3RhbXAiOiIyMDIxMDEyNTE1MDcyMCIsInFwSUQiOiIyMzA5NzAiLCJvcmRlcklkUHJlZml4IjoiUVAtMjExMjUzNTczOSIsImN1cnJlbmN5IjoiU0dEIiwiYW1vdW50IjoiMTAwLjAwIiwiZXhwaXJ5IjoiMjYwMTIwMjEiLCJ1cmwiOiJodHRwczovL2RlbW8yLjJjMnAuY29tLzJDMlBGcm9udGVuZC9xcC83MUhUIiwicmVzQ29kZSI6IjAwMCIsInJlc0Rlc2MiOiJTdWNjZXNzIiwiaGFzaFZhbHVlIjoiNzAyNkUyQzM5NkQ0NjJFQkI2OUQyRTk1MkY3QzQzNDY5MERCRTFDMSJ9fQ==
  1. Decode the response data. The sample code below demonstrates correctly decoded API response data.
{
    "GenerateQPRes": {
        "version": "2.1",
        "timeStamp": "20210125150720",
        "qpID": "230970",
        "orderIdPrefix": "QP-2112535739",
        "currency": "SGD",
        "amount": "100.00",
        "expiry": "26012021",
        "url": "https://demo2.2c2p.com/2C2PFrontend/qp/71HT",
        "resCode": "000",
        "resDesc": "Success",
        "hashValue": "7026E2C396D462EBB69D2E952F7C434690DBE1C1"
    }
}
  1. Read the API response data from GenerateQPRes.

For specific API response parameters, refer to: Generate Link Response Parameters