QuickPay Generate and Send Link API

👍

HTTPS POST / Server-to-Server

QuickPay Generate and Send Link requests and responses are encoded using Base64. Merchant required to:

  • Encode the QuickPay Generate and Send Link request
  • Decode the QuickPay Generate and Send Link response
https://demo2.2c2p.com/2C2PFrontEnd/QuickPay/DeliveryAPI
https://t.2c2p.com/QuickPay/DeliveryAPI

📘

API Parameter

Generate and Send Link Request Parameter
Generate and Send Link Response Parameters

Generate and Send Link Request


  1. Prepare an API request to generate and send a QuickPay link.
  2. Bind the Generate Link Request data into GenerateSendQPReq.

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

{
	"GenerateSendQPReq": {
		"version": "2.4",
		"merchantID": "JT01",
		"orderIdPrefix": "QP-21126102038",
		"description": "V3 Test",
		"amount": "100.00",
		"currency": "SGD",
		"allowMultiplePayment": "N",
		"maxTransaction": "",
		"expiry": "2024-12-31 23:59:59",
		"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",
		"useStoreCardOnly": "N",
		"storeCardAccountID": "",
		"storeCardUniqueID": "",
		"ippPeriodFilter": "",
		"receiverName": "",
		"customerName": "",
		"customerPhone": "",
		"customerEmail": "",
		"sendNotification": "",
		"recipientEmail": "",
		"itemize": "N",
		"items": {
			"code": "",
			"name": "",
			"price": "",
			"quantity": ""
		},
		"locale": "",
		"resultUrl2": "https://demo2.2c2p.com/paymentresult/v3uibackendurl.aspx",
		"timeStamp": "20210126104326",
		"hashValue": "a18aaaf276fc1e7b5d3221844a16d15cf9601067"
	}
}
ewoJIkdlbmVyYXRlU2VuZFFQUmVxIjogewoJCSJ2ZXJzaW9uIjogIjIuNCIsCgkJIm1lcmNoYW50SUQiOiAiSlQwMSIsCgkJIm9yZGVySWRQcmVmaXgiOiAiUVAtMjExMjYxMDIwMzgiLAoJCSJkZXNjcmlwdGlvbiI6ICJWMyBUZXN0IiwKCQkiYW1vdW50IjogIjEwMC4wMCIsCgkJImN1cnJlbmN5IjogIlNHRCIsCgkJImFsbG93TXVsdGlwbGVQYXltZW50IjogIk4iLAoJCSJtYXhUcmFuc2FjdGlvbiI6ICIiLAoJCSJleHBpcnkiOiAiMjAyNC0xMi0zMSAyMzo1OTo1OSIsCgkJImNhdGVnb3J5SWQiOiAiIiwKCQkicHJvbW90aW9uIjogIiIsCgkJInBheW1lbnRPcHRpb24iOiAiIiwKCQkiaXBwSW50ZXJlc3RUeXBlIjogIiIsCgkJInBheW1lbnRFeHBpcnkiOiAiIiwKCQkicmVxdWVzdDNEUyI6ICJOIiwKCQkiZW5hYmxlU3RvcmVDYXJkIjogIk4iLAoJCSJyZWN1cnJpbmciOiAiTiIsCgkJInJlY3VycmluZ0Ftb3VudCI6ICIiLAoJCSJhbGxvd0FjY3VtdWxhdGUiOiAiIiwKCQkibWF4QWNjdW11bGF0ZUFtb3VudCI6ICIiLAoJCSJyZWN1cnJpbmdJbnRlcnZhbCI6ICIiLAoJCSJyZWN1cnJpbmdDb3VudCI6ICIiLAoJCSJjaGFyZ2VOZXh0RGF0ZSI6ICIiLAoJCSJjaGFyZ2VPbkRhdGUiOiAiIiwKCQkidXNlckRhdGExIjogIiIsCgkJInVzZXJEYXRhMiI6ICIiLAoJCSJ1c2VyRGF0YTMiOiAiIiwKCQkidXNlckRhdGE0IjogIiIsCgkJInVzZXJEYXRhNSI6ICIiLAoJC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kJImhhc2hWYWx1ZSI6ICJhMThhYWFmMjc2ZmMxZTdiNWQzMjIxODQ0YTE2ZDE1Y2Y5NjAxMDY3IgoJfQp9
  1. Send the encoded request data to the API endpoint.
curl --location --request POST 'https://demo2.2c2p.com/2C2PFrontEnd/QuickPay/DeliveryAPI' \
--header 'Content-Type: text/plain' \
--data-raw 'ewoJIkdlbmVyYXRlU2VuZFFQUmVxIjogewoJCSJ2ZXJzaW9uIjogIjIuNCIsCgkJIm1lcmNoYW50SUQiOiAiSlQwMSIsCgkJIm9yZGVySWRQcmVmaXgiOiAiUVAtMjExMjYxMDIwMzgiLAoJCSJkZXNjcmlwdGlvbiI6ICJWMyBUZXN0IiwKCQkiYW1vdW50IjogIjEwMC4wMCIsCgkJImN1cnJlbmN5IjogIlNHRCIsCgkJImFsbG93TXVsdGlwbGVQYXltZW50IjogIk4iLAoJCSJtYXhUcmFuc2FjdGlvbiI6ICIiLAoJCSJleHBpcnkiOiAiMjAyNC0xMi0zMSAyMzo1OTo1OSIsCgkJImNhdGVnb3J5SWQiOiAiIiwKCQkicHJvbW90aW9uIjogIiIsCgkJInBheW1lbnRPcHRpb24iOiAiIiwKCQkiaXBwSW50ZXJlc3RUeXBlIjogIiIsCgkJInBheW1lbnRFeHBpcnkiOiAiIiwKCQkicmVxdWVzdDNEUyI6ICJOIiwKCQkiZW5hYmxlU3RvcmVDYXJkIjogIk4iLAoJCSJyZWN1cnJpbmciOiAiTiIsCgkJInJlY3VycmluZ0Ftb3VudCI6ICIiLAoJCSJhbGxvd0FjY3VtdWxhdGUiOiAiIiwKCQkibWF4QWNjdW11bGF0ZUFtb3VudCI6ICIiLAoJCSJyZWN1cnJpbmdJbnRlcnZhbCI6ICIiLAoJCSJyZWN1cnJpbmdDb3VudCI6ICIiLAoJCSJjaGFyZ2VOZXh0RGF0ZSI6ICIiLAoJCSJjaGFyZ2VPbkRhdGUiOiAiIiwKCQkidXNlckRhdGExIjogIiIsCgkJInVzZXJEYXRhMiI6ICIiL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1bHQvdjN1aWJhY2tlbmR1cmwuYXNweCIsCgkJInRpbWVTdGFtcCI6ICIyMDIxMDEyNjEwNDMyNiIsCgkJImhhc2hWYWx1ZSI6ICJhMThhYWFmMjc2ZmMxZTdiNWQzMjIxODQ0YTE2ZDE1Y2Y5NjAxMDY3IgoJfQp9'

 

Generate and Send Link Response


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