These docs are for v4.0.2. Click to read the latest docs for v4.3.0.

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": 10,
  "beneficiaryBankCode": "004",
  "requestID": "1",
  "UTR": "0000001", 
  "payoutDate": "",   
  "userDefined1": "",
  "userDefined2": "",
  "userDefined3": "",
  "userDefined4": "",
  "userDefined5": "",
  "preferredSofProfile": "",
  "beneficiaryType": "BANKACC",
  "beneficiaryTypeValue": "77788888888888",  
  "preferredProvider": "",
  "registerBeneficiary": false,
  "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.eyJtZXJjaGFudElEIjoiNzAyNzAyMDAwMDAwMDAxIiwiYmVuZWZpY2lhcnlOYW1lIjoiSm9obiBEb2UiLCJhbW91bnQiOjEwLCJiZW5lZmljaWFyeUJhbmtDb2RlIjoiMDA0IiwicmVxdWVzdElEIjoiMSIsIlVUUiI6IjAwMDAwMDEiLCJwYXlvdXREYXRlIjoiIiwidXNlckRlZmluZWQxIjoiIiwidXNlckRlZmluZWQyIjoiIiwidXNlckRlZmluZWQzIjoiIiwidXNlckRlZmluZWQ0IjoiIiwidXNlckRlZmluZWQ1IjoiIiwicHJlZmVycmVkU29mUHJvZmlsZSI6IiIsImJlbmVmaWNpYXJ5VHlwZSI6IkJBTktBQ0MiLCJiZW5lZmljaWFyeVR5cGVWYWx1ZSI6Ijc3Nzg4ODg4ODg4ODg4IiwicHJlZmVycmVkUHJvdmlkZXIiOiIiLCJyZWdpc3RlckJlbmVmaWNpYXJ5IjpmYWxzZSwibm90aWZpY2F0aW9uVXJsIjoiIn0.AuRMMrEYYMmcfGDMT8y0PYHawsPRpXhicgwZ0r27hd4"
}'

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": "1",
	"UTR": "0000001",
	"payoutDate": "2023-06-22T00:00:00+07:00",
	"amount": 10.00,
	"currency": "THB",
	"beneficiaryName": "John Doe",
  	"beneficiaryType": "BANKACC",
  	"beneficiaryTypeValue": "77788888888888",
  	"preferredProvider": "",	
	"beneficiaryBankName": "OCBC",
	"beneficiaryBankCode": "004",	
	"beneficiaryEmail": "[email protected]",	
	"bankReferenceNo": "CY0000408157",
	"userDefined1": "",
	"userDefined2": "",
	"userDefined3": "",
	"userDefined4": "",
	"userDefined5": "",
	"respCode": "8101",
	"respDesc": "Success – Payout request accepted"
}
{
	"payload": "eyJhbGciOiJIUzI1NiJ9.eyJ2ZXJzaW9uIjoiMS4yIiwicmVxdWVzdElEIjoiMSIsIlVUUiI6IjAwMDAwMDEiLCJwYXlvdXREYXRlIjoiMjAyMy0wNi0yMlQwMDowMDowMCswNzowMCIsImFtb3VudCI6MTAsImN1cnJlbmN5IjoiVEhCIiwiYmVuZWZpY2lhcnlOYW1lIjoiSm9obiBEb2UiLCJiZW5lZmljaWFyeVR5cGUiOiJCQU5LQUNDIiwiYmVuZWZpY2lhcnlUeXBlVmFsdWUiOiI3Nzc4ODg4ODg4ODg4OCIsInByZWZlcnJlZFByb3ZpZGVyIjoiIiwiYmVuZWZpY2lhcnlBY2NvdW50Tm8iOiIxMjM0NTY3ODkwIiwiYmVuZWZpY2lhcnlCYW5rTmFtZSI6Ik9DQkMiLCJiZW5lZmljaWFyeUJhbmtDb2RlIjoiMDA0IiwiYmVuZWZpY2lhcnlNb2JpbGVObyI6Iis2NTgxMjM0NTY3IiwiYmVuZWZpY2lhcnlFbWFpbCI6Im5hbWVAZW1haWwuY29tIiwiaWRDYXJkIjoiMjAxMjAxMjAwNTUxIiwiYmFua1JlZmVyZW5jZU5vIjoiQ1kwMDAwNDA4MTU3IiwidXNlckRlZmluZWQxIjoiIiwidXNlckRlZmluZWQyIjoiIiwidXNlckRlZmluZWQzIjoiIiwidXNlckRlZmluZWQ0IjoiIiwidXNlckRlZmluZWQ1IjoiIiwicmVzcENvZGUiOiI4MTAxIiwicmVzcERlc2MiOiJTdWNjZXNzIOKAkyBQYXlvdXQgcmVxdWVzdCBhY2NlcHRlZCJ9.4J5nz-QnJRiZ0puEVbUTkwQN6ruficR6NbG1gxN9_K8"
}

Receive Payout Notification (After bank process disbursement)

  1. Receiving encrypted payout data
  2. Decrypt payload data with JWT - HS256 algorithm using merchant secret key.
{
	"version": "1.2",
	"requestID": "1",
	"UTR": "0000001",
	"payoutDate": "2023-06-22T00:00:00+07:00",
	"amount": 10.00,
	"currency": "THB",
	"beneficiaryName": "John Doe",
  	"beneficiaryType": "BANKACC",
  	"beneficiaryTypeValue": "77788888888888",
  	"preferredProvider": "",
	"beneficiaryBankName": "OCBC",
	"beneficiaryBankCode": "004",
	"beneficiaryEmail": "[email protected]",	
	"bankReferenceNo": "CY0000408157",
	"userDefined1": "",
	"userDefined2": "",
	"userDefined3": "",
	"userDefined4": "",
	"userDefined5": "",
	"respCode": "8100",
	"respDesc": "Success – Payout disbursement success"
}
{
	"payload": "eyJhbGciOiJIUzI1NiJ9.eyJ2ZXJzaW9uIjoiMS4yIiwicmVxdWVzdElEIjoiMSIsIlVUUiI6IjAwMDAwMDEiLCJwYXlvdXREYXRlIjoiMjAyMy0wNi0yMlQwMDowMDowMCswNzowMCIsImFtb3VudCI6MTAsImN1cnJlbmN5IjoiVEhCIiwiYmVuZWZpY2lhcnlOYW1lIjoiSm9obiBEb2UiLCJiZW5lZmljaWFyeVR5cGUiOiJCQU5LQUNDIiwiYmVuZWZpY2lhcnlUeXBlVmFsdWUiOiI3Nzc4ODg4ODg4ODg4OCIsInByZWZlcnJlZFByb3ZpZGVyIjoiIiwiYmVuZWZpY2lhcnlBY2NvdW50Tm8iOiIxMjM0NTY3ODkwIiwiYmVuZWZpY2lhcnlCYW5rTmFtZSI6Ik9DQkMiLCJiZW5lZmljaWFyeUJhbmtDb2RlIjoiMDA0IiwiYmVuZWZpY2lhcnlNb2JpbGVObyI6Iis2NTgxMjM0NTY3IiwiYmVuZWZpY2lhcnlFbWFpbCI6Im5hbWVAZW1haWwuY29tIiwiaWRDYXJkIjoiMjAxMjAxMjAwNTUxIiwiYmFua1JlZmVyZW5jZU5vIjoiQ1kwMDAwNDA4MTU3IiwidXNlckRlZmluZWQxIjoiIiwidXNlckRlZmluZWQyIjoiIiwidXNlckRlZmluZWQzIjoiIiwidXNlckRlZmluZWQ0IjoiIiwidXNlckRlZmluZWQ1IjoiIiwicmVzcENvZGUiOiI4MTAwIiwicmVzcERlc2MiOiJTdWNjZXNzIOKAkyBQYXlvdXQgZGlzYnVyc2VtZW50IHN1Y2Nlc3MifQ.xo_nr6Oa5HXWpApR0G-myJjkGTW7jJSzl2YwQiVDoPg"
}

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": "1",
	"UTR": "0000001",
	"payoutDate": "2023-06-22T00:00:00+07:00",
	"amount": 10.00,
	"currency": "THB",
	"beneficiaryName": "John Doe",
  	"beneficiaryType": "BANKACC",
  	"beneficiaryTypeValue": "77788888888888",
  	"preferredProvider": "",	
	"beneficiaryBankName": "OCBC",
	"beneficiaryBankCode": "004",	
	"beneficiaryEmail": "[email protected]",
	"bankReferenceNo": "CY0000408157",
	"userDefined1": "",
	"userDefined2": "",
	"userDefined3": "",
	"userDefined4": "",
	"userDefined5": "",
	"respCode": "8100",
	"respDesc": "Success – Payout disbursement success"
}