Payout Request API

👍

HTTPS POST / Server-to-Server

Payment requests and responses are encrypted using JWT with HS256 algorithm (HMAC with SHA-256) using Merchant’s Secret Key.

Merchants must know how to prepare requests and process responses using JWT Token.

https://sandbox-pgw.2c2p.com/payouts/api/v1.2/payout/create
https://pgw.2c2p.com/payouts/api/v1.2/payout/create
https://pgw-id.2c2p.com/payouts/api/v1.2/payout/create

📘

API Parameter

Payout Request Parameter
Payout Response / Notification Parameter

Prepare Payout Request

  1. Prepare payload data.
  2. Encrypt payload data with JWT - HS256 algorithm using merchant secret key.
{
    "merchantID": "702702000000001",
    "beneficiaryName": "John Doe",
    "amount": 1000.00,
    "beneficiaryBankCode": "OCBCSGSG",    
    "requestID": "4b41db94-f59d-4ed5-a03c-5b8ac1796276",
    "UTR": "0000001",
    "payoutDate": "31/12/2020",    
    "userDefined1": "",
    "userDefined2": "",
    "userDefined3": "",
    "userDefined4": "", 
    "userDefined5": "", 
    "preferredSofProfile": "GIP",    
    "beneficiaryId": "",
    "beneficiaryType": "MOBILE",
    "beneficiaryTypeValue": "+6581234567",
    "preferredProvider": "",
    "notificationUrl": ""
}
{
	"payload": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjaGFudElEIjoiNzAyNzAyMDAwMDAwMDAxIiwiYmVuZWZpY2lhcnlOYW1lIjoiSm9obiBEb2UiLCJhbW91bnQiOjEwLCJiZW5lZmljaWFyeUJhbmtDb2RlIjoiMDA0IiwicmVxdWVzdElEIjoiMSIsIlVUUiI6IjAwMDAwMDEiLCJwYXlvdXREYXRlIjoiIiwidXNlckRlZmluZWQxIjoiIiwidXNlckRlZmluZWQyIjoiIiwidXNlckRlZmluZWQzIjoiIiwidXNlckRlZmluZWQ0IjoiIiwidXNlckRlZmluZWQ1IjoiIiwicHJlZmVycmVkU29mUHJvZmlsZSI6IiIsImJlbmVmaWNpYXJ5VHlwZSI6IkJBTktBQ0MiLCJiZW5lZmljaWFyeVR5cGVWYWx1ZSI6Ijc3Nzg4ODg4ODg4ODg4IiwicHJlZmVycmVkUHJvdmlkZXIiOiIiLCJyZWdpc3RlckJlbmVmaWNpYXJ5IjpmYWxzZSwibm90aWZpY2F0aW9uVXJsIjoiIn0.AuRMMrEYYMmcfGDMT8y0PYHawsPRpXhicgwZ0r27hd4"
}
  1. Send request to payout request API.
curl --location --request POST 'https://sandbox-pgw.2c2p.com/payouts/api/v1.2/payout/create' \
--header 'Content-Type: application/json' \
--data-raw '{
	"payload": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjaGFudElEIjoiNzAyNzAyMDAwMDAwMDAxIiwiYmVuZWZpY2lhcnlOYW1lIjoiSm9obiBEb2UiLCJhbW91bnQiOjEwMDAsImJlbmVmaWNpYXJ5QmFua0NvZGUiOiJPQ0JDU0dTRyIsInJlcXVlc3RJRCI6IjRiNDFkYjk0LWY1OWQtNGVkNS1hMDNjLTViOGFjMTc5NjI3NiIsIlVUUiI6IjAwMDAwMDEiLCJwYXlvdXREYXRlIjoiMzEvMTIvMjAyMCIsInVzZXJEZWZpbmVkMSI6IiIsInVzZXJEZWZpbmVkMiI6IiIsInVzZXJEZWZpbmVkMyI6IiIsInVzZXJEZWZpbmVkNCI6IiIsInVzZXJEZWZpbmVkNSI6IiIsInByZWZlcnJlZFNvZlByb2ZpbGUiOiJHSVAiLCJiZW5lZmljaWFyeUlkIjoiIiwiYmVuZWZpY2lhcnlUeXBlIjoiTU9CSUxFIiwiYmVuZWZpY2lhcnlUeXBlVmFsdWUiOiIrNjU4MTIzNDU2NyIsInByZWZlcnJlZFByb3ZpZGVyIjoiIiwibm90aWZpY2F0aW9uVXJsIjoiIn0.tep3kea-k7ay-4d5ExLEhUBCI1B6FGiphepdxvgvLfw"
}'

Receive Payout Response

  1. Receiving encrypted payout data immediately.
  2. Decrypt payload data with JWT - HS256 algorithm using merchant secret key.
{
    "version": "1.2",
    "requestID": "4b41db94-f59d-4ed5-a03c-5b8ac1796276",
    "UTR": "0000001",
    "payoutDate": "2020-12-31T00:00:00+07:00",
    "amount": 1000.00,
    "currency": "THB",
    "beneficiaryName": "John Doe",    
    "beneficiaryBankName": "OCBC",
    "beneficiaryBankCode": "OCBCSGSG",
    "beneficiaryEmail": "[email protected]",
    "bankReferenceNo": "CY0000408157",
    "userDefined1": "",
    "userDefined2": "",
    "userDefined3": "",
    "userDefined4": "", 
    "userDefined5": "", 
    "respCode": "8101", 
    "respDesc": "Success – Payout request accepted",
    "remarks": "",
    "preferredSofProfile": "GIP",    
    "beneficiaryId": "payout_Prod_BFiYJTXszLOkemhMz7uMHfBQ",
    "beneficiaryType": "MOBILE",
    "beneficiaryTypeValue": "+6581234567",
    "preferredProvider": ""
}
{
	"payload": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoiMS4yIiwicmVxdWVzdElEIjoiNGI0MWRiOTQtZjU5ZC00ZWQ1LWEwM2MtNWI4YWMxNzk2Mjc2IiwiVVRSIjoiMDAwMDAwMSIsInBheW91dERhdGUiOiIzMS8xMi8yMDIwIiwiYW1vdW50IjoxMDAwLCJjdXJyZW5jeSI6IlRIQiIsImJlbmVmaWNpYXJ5TmFtZSI6IkpvaG4gRG9lIiwiYmVuZWZpY2lhcnlCYW5rTmFtZSI6Ik9DQkMiLCJiZW5lZmljaWFyeUJhbmtDb2RlIjoiT0NCQ1NHU0ciLCJiZW5lZmljaWFyeUVtYWlsIjoibmFtZUBlbWFpbC5jb20iLCJiYW5rUmVmZXJlbmNlTm8iOiJDWTAwMDA0MDgxNTciLCJ1c2VyRGVmaW5lZDEiOiIiLCJ1c2VyRGVmaW5lZDIiOiIiLCJ1c2VyRGVmaW5lZDMiOiIiLCJ1c2VyRGVmaW5lZDQiOiIiLCJ1c2VyRGVmaW5lZDUiOiIiLCJyZXNwQ29kZSI6IjgxMDEiLCJyZXNwRGVzYyI6IlN1Y2Nlc3Mg4oCTIFBheW91dCByZXF1ZXN0IGFjY2VwdGVkIiwicmVtYXJrcyI6IiIsInByZWZlcnJlZFNvZlByb2ZpbGUiOiJHSVAiLCJiZW5lZmljaWFyeUlkIjoicGF5b3V0X1Byb2RfQkZpWUpUWHN6TE9rZW1oTXo3dU1IZkJRIiwiYmVuZWZpY2lhcnlUeXBlIjoiTU9CSUxFIiwiYmVuZWZpY2lhcnlUeXBlVmFsdWUiOiIrNjU4MTIzNDU2NyIsInByZWZlcnJlZFByb3ZpZGVyIjoiIn0.RGmZ87DoiSEPaOzupTy1q34hoi55XJq-mAukxAfEWZE"
}

Payout Notification (callback URL)

  1. Notification callback to merchant will send plain text in http body and
  2. In http header
    1. hmac256 signature at x-signature
    2. payout at x-notify-event
{
    "version": "1.2",
    "requestID": "4b41db94-f59d-4ed5-a03c-5b8ac1796276",
    "UTR": "0000001",
    "payoutDate": "2020-12-31T00:00:00+07:00",
    "amount": 1000.00,
    "currency": "THB",
    "beneficiaryName": "John Doe",    
    "beneficiaryBankName": "OCBC",
    "beneficiaryBankCode": "OCBCSGSG",
    "beneficiaryEmail": "[email protected]",
    "bankReferenceNo": "CY0000408157",
    "userDefined1": "",
    "userDefined2": "",
    "userDefined3": "",
    "userDefined4": "", 
    "userDefined5": "", 
    "respCode": "8100", 
    "respDesc": "Success – Payout disbursement success",
    "remarks": "",
    "preferredSofProfile": "GIP",    
    "beneficiaryId": "payout_Prod_BFiYJTXszLOkemhMz7uMHfBQ",
    "beneficiaryType": "MOBILE",
    "beneficiaryTypeValue": "+6581234567",
    "preferredProvider": ""
}
x-signature: 87457CA21C78EF5082D4797A65FFBB093CD45BCCEA85DE7CD8C14B2D00B8B948
x-notify-event: payout