QuickPay Generate and Send Link API

👍

HTTPS POST / Server-to-Server

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

To go live, please refer to: Live endpoint guide

Generate and Send Link Request


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

For specific API request parameters, refer to: Generate and Send Link Request Parameter

{
    "GenerateSendQPReq": {
        "version": "2.1",
        "merchantID": "JT01",
        "orderIdPrefix": "QP-21126102038",
        "description": "V3 Test",
        "amount": "100.00",
        "currency": "SGD",
        "allowMultiplePayment": "N",
        "maxTransaction": "",
        "expiry": "27012021",
        "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",
        "toEmails": "[email protected]",
        "ccEmails": "",
        "bccEmails": "[email protected]",
        "emailSubject": "Promotion! Last chance to buy now!",
        "emailMessage": "Please make payment.",
        "toMobiles": "+6599999999",
        "smsMessage": "Make payment by DEC 2021",
        "resultUrl2": "https://demo2.2c2p.com/paymentresult/v3uibackendurl.aspx",
        "timeStamp": "20210126104326",
        "hashValue": "a18aaaf276fc1e7b5d3221844a16d15cf9601067"
    }
}
  1. Bind the Generate Link Request data into GenerateSendQPReq.

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

ewoJIkdlbmVyYXRlU2VuZFFQUmVxIjogewoJCSJ2ZXJzaW9uIjogIjIuMSIsCgkJIm1lcmNoYW50SUQiOiAiSlQwNyIsCgkJIm9yZGVySWRQcmVmaXgiOiAiUVAtMjExMjYxMDIwMzUiLAoJCSJkZXNjcmlwdGlvbiI6ICJ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AoJCSJlbWFpbE1lc3NhZ2UiOiAiUGxlYXNlIG1ha2UgcGF5bWVudC4iLAoJCSJ0b01vYmlsZXMiOiAiKzY1OTk5OTk5OTkiLAoJCSJzbXNNZXNzYWdlIjogIk1ha2UgcGF5bWVudCBieSBERUMgMjAyMSIsCgkJInJlc3VsdFVybDIiOiAiaHR0cHM6Ly9kZW1vMi4yYzJwLmNvbS9wYXltZW50cmVzdWx0L3YzdWliYWNrZW5kdXJsLmFzcHgiLAoJCSJ0aW1lU3RhbXAiOiAiMjAyMTAxMjYxMDIxMzIiLAoJCSJoYXNoVmFsdWUiOiAiNTljYjQ1MDM5MDgxNmY1YTIzNjljODdhMzU4NTE0NzY4NmVkNzNlYyIKCX0KfQ==
  1. Send the encoded request data to the API endpoint.

 

Generate and Send Link Response


  1. To process a response from the Generate and Send Link API, refer to the sample response below. Note that the API will return response data in Base64 format.
eyJHZW5lcmF0ZVNlbmRRUFJlcyI6eyJ2ZXJzaW9uIjoiMi4xIiwidGltZVN0YW1wIjoiMjAyMTAxMjYwOTQ0MDMiLCJxcElEIjoiMjMxMDk1Iiwib3JkZXJJZFByZWZpeCI6IlFQLTIxMTI2MTAyMDM4IiwiY3VycmVuY3kiOiJTR0QiLCJhbW91bnQiOiIxMDAuMDAiLCJleHBpcnkiOiIyNzAxMjAyMSIsInVybCI6Imh0dHBzOi8vZGVtbzIuMmMycC5jb20vMkMyUEZyb250ZW5kL3FwLzcxTlEiLCJzdWNjZXNzRW1haWxzIjoidGVycmFuY2UudGF5QDJjMnAuY29tIiwic3VjY2Vzc01vYmlsZXMiOiIiLCJmYWlsZWRFbWFpbHMiOiIiLCJmYWlsZWRNb2JpbGVzIjoiKzY1OTk5OTk5OTkiLCJyZXNDb2RlIjoiMDAwIiwicmVzRGVzYyI6IlN1Y2Nlc3MiLCJoYXNoVmFsdWUiOiIyOTEzRDgzMzg5N0I2RkQzM0EyNUMwMzQyM0I4ODE5MURDNzU2NkNDIn19
  1. Decode the response data. The sample code below demonstrates correctly decoded API response data.
{
    "GenerateSendQPRes": {
        "version": "2.1",
        "timeStamp": "20210126094403",
        "qpID": "231095",
        "orderIdPrefix": "QP-21126102038",
        "currency": "SGD",
        "amount": "100.00",
        "expiry": "27012021",
        "url": "https://demo2.2c2p.com/2C2PFrontend/qp/71NQ",
        "successEmails": "[email protected]",
        "successMobiles": "",
        "failedEmails": "",
        "failedMobiles": "+6599999999",
        "resCode": "000",
        "resDesc": "Success",
        "hashValue": "2913D833897B6FD33A25C03423B88191DC7566CC"
    }
}
  1. Read the Generate Link Response data from GenerateSendQPRes.

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