Create Payout

๐Ÿ‘

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.1/payout/create
https://pgw.2c2p.com/payouts/api/v1.1/payout/create
https://payid.2c2p.com/payouts/api/v1.1/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",
    "requestID": "1",
    "UTR": "0000001",
    "payoutDate": "31/12/2020",
    "amount": 1000.00,
    "beneficiaryName": "John Doe",
    "beneficiaryAccountNo": "1234567890",
    "beneficiaryBankName": "OCBC",
    "beneficiaryBankCode": "OCBCSGSG",
    "beneficiaryMobileNo": "+6581234567",
    "beneficiaryCompanyId": "00254645421",
    "userDefined1": "",
    "userDefined2": "",
    "userDefined3": "",
    "userDefined4": "",
    "userDefined5": "",
    "notificationUrl": "",
    "idCard": "201201200551",
    "preferredSof": "GIP"
}
{
    "payload": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjaGFudElEIjoiNzAyNzAyMDAwMDAwMDAxIiwicmVxdWVzdElEIjoiMSIsIlVUUiI6IjAwMDAwMDEiLCJwYXlvdXREYXRlIjoiMzEvMTIvMjAyMCIsImFtb3VudCI6MTAwMCwiYmVuZWZpY2lhcnlOYW1lIjoiSm9obiBEb2UiLCJiZW5lZmljaWFyeUFjY291bnRObyI6IjEyMzQ1Njc4OTAiLCJiZW5lZmljaWFyeUJhbmtOYW1lIjoiT0NCQyIsImJlbmVmaWNpYXJ5QmFua0NvZGUiOiJPQ0JDU0dTRyIsImJlbmVmaWNpYXJ5TW9iaWxlTm8iOiIrNjU4MTIzNDU2NyIsImJlbmVmaWNpYXJ5Q29tcGFueUlkIjoiMDAyNTQ2NDU0MjEiLCJ1c2VyRGVmaW5lZDEiOiIiLCJ1c2VyRGVmaW5lZDIiOiIiLCJ1c2VyRGVmaW5lZDMiOiIiLCJ1c2VyRGVmaW5lZDQiOiIiLCJ1c2VyRGVmaW5lZDUiOiIiLCJub3RpZmljYXRpb25VcmwiOiIiLCJpZENhcmQiOiIyMDEyMDEyMDA1NTEiLCJwcmVmZXJyZWRTb2YiOiJHSVAifQ.haYDmJaiGn4Ylrh2dzrVY76zdIYGyNDNd-w46_koCrU"
}
  1. Send request to payout request API.
curl --location --request POST 'https://sandbox-pgw.2c2p.com/payouts/api/v1.1/payout/create' \
--header 'Content-Type: application/json' \
--data-raw '{
    "payload": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjaGFudElEIjoiNzAyNzAyMDAwMDAwMDAxIiwicmVxdWVzdElEIjoiMSIsIlVUUiI6IjAwMDAwMDEiLCJwYXlvdXREYXRlIjoiMzEvMTIvMjAyMCIsImFtb3VudCI6MTAwMCwiYmVuZWZpY2lhcnlOYW1lIjoiSm9obiBEb2UiLCJiZW5lZmljaWFyeUFjY291bnRObyI6IjEyMzQ1Njc4OTAiLCJiZW5lZmljaWFyeUJhbmtOYW1lIjoiT0NCQyIsImJlbmVmaWNpYXJ5QmFua0NvZGUiOiJPQ0JDU0dTRyIsImJlbmVmaWNpYXJ5TW9iaWxlTm8iOiIrNjU4MTIzNDU2NyIsImJlbmVmaWNpYXJ5Q29tcGFueUlkIjoiMDAyNTQ2NDU0MjEiLCJ1c2VyRGVmaW5lZDEiOiIiLCJ1c2VyRGVmaW5lZDIiOiIiLCJ1c2VyRGVmaW5lZDMiOiIiLCJ1c2VyRGVmaW5lZDQiOiIiLCJ1c2VyRGVmaW5lZDUiOiIiLCJub3RpZmljYXRpb25VcmwiOiIiLCJpZENhcmQiOiIyMDEyMDEyMDA1NTEiLCJwcmVmZXJyZWRTb2YiOiJHSVAifQ.haYDmJaiGn4Ylrh2dzrVY76zdIYGyNDNd-w46_koCrU"
}'

Receive Payout Response

  1. Receiving encrypted payout data immediately.
  2. Decrypt payload data with JWT - HS256 algorithm using merchant secret key.
{
    "version": "1.1",
    "requestID": "1",
    "UTR": "0000001",
    "payoutDate": "31/12/2020",
    "amount": 1000.00,
    "currency": "THB",
    "beneficiaryName": "John Doe",
    "beneficiaryAccountNo": "1234567890",
    "beneficiaryBankName": "OCBC",
    "beneficiaryBankCode": "OCBCSGSG",
    "beneficiaryMobileNo": "+6581234567",
    "beneficiaryEmail": "[email protected]",
    "idCard": "201201200551",
    "bankReferenceNo": "CY0000408157",
    "userDefined1": "",
    "userDefined2": "",
    "userDefined3": "",
    "userDefined4": "",
    "userDefined5": "",
    "respCode": "8101",
    "respDesc": "Success โ€“ Payout request accepted"
}
{
    "payload": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoiMS4xIiwicmVxdWVzdElEIjoiMSIsIlVUUiI6IjAwMDAwMDEiLCJwYXlvdXREYXRlIjoiMzEvMTIvMjAyMCIsImFtb3VudCI6MTAwMCwiY3VycmVuY3kiOiJUSEIiLCJiZW5lZmljaWFyeU5hbWUiOiJKb2huIERvZSIsImJlbmVmaWNpYXJ5QWNjb3VudE5vIjoiMTIzNDU2Nzg5MCIsImJlbmVmaWNpYXJ5QmFua05hbWUiOiJPQ0JDIiwiYmVuZWZpY2lhcnlCYW5rQ29kZSI6Ik9DQkNTR1NHIiwiYmVuZWZpY2lhcnlNb2JpbGVObyI6Iis2NTgxMjM0NTY3IiwiYmVuZWZpY2lhcnlFbWFpbCI6Im5hbWVAZW1haWwuY29tIiwiaWRDYXJkIjoiMjAxMjAxMjAwNTUxIiwiYmFua1JlZmVyZW5jZU5vIjoiQ1kwMDAwNDA4MTU3IiwidXNlckRlZmluZWQxIjoiIiwidXNlckRlZmluZWQyIjoiIiwidXNlckRlZmluZWQzIjoiIiwidXNlckRlZmluZWQ0IjoiIiwidXNlckRlZmluZWQ1IjoiIiwicmVzcENvZGUiOiI4MTAxIiwicmVzcERlc2MiOiJTdWNjZXNzIOKAkyBQYXlvdXQgcmVxdWVzdCBhY2NlcHRlZCJ9.PgVuLTvmbIX4RPWqHkdGkRuDnq6JVcOElQPH07vSkoQ"
}

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.1",
    "requestID": "1",
    "UTR": "0000001",
    "payoutDate": "31/12/2020",
    "amount": 1000.00,
    "currency": "THB",
    "beneficiaryName": "John Doe",
    "beneficiaryAccountNo": "1234567890",
    "beneficiaryBankName": "OCBC",
    "beneficiaryBankCode": "OCBCSGSG",
    "beneficiaryMobileNo": "+6581234567",
    "beneficiaryEmail": "[email protected]",
    "idCard": "201201200551",
    "bankReferenceNo": "CY0000408157",
    "userDefined1": "",
    "userDefined2": "",
    "userDefined3": "",
    "userDefined4": "",
    "userDefined5": "",
    "respCode": "8100",
    "respDesc": "Success โ€“ Payout disbursement success"
}
{
    "payload": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoiMS4xIiwicmVxdWVzdElEIjoiMSIsIlVUUiI6IjAwMDAwMDEiLCJwYXlvdXREYXRlIjoiMzEvMTIvMjAyMCIsImFtb3VudCI6MTAwMCwiY3VycmVuY3kiOiJUSEIiLCJiZW5lZmljaWFyeU5hbWUiOiJKb2huIERvZSIsImJlbmVmaWNpYXJ5QWNjb3VudE5vIjoiMTIzNDU2Nzg5MCIsImJlbmVmaWNpYXJ5QmFua05hbWUiOiJPQ0JDIiwiYmVuZWZpY2lhcnlCYW5rQ29kZSI6Ik9DQkNTR1NHIiwiYmVuZWZpY2lhcnlNb2JpbGVObyI6Iis2NTgxMjM0NTY3IiwiYmVuZWZpY2lhcnlFbWFpbCI6Im5hbWVAZW1haWwuY29tIiwiaWRDYXJkIjoiMjAxMjAxMjAwNTUxIiwiYmFua1JlZmVyZW5jZU5vIjoiQ1kwMDAwNDA4MTU3IiwidXNlckRlZmluZWQxIjoiIiwidXNlckRlZmluZWQyIjoiIiwidXNlckRlZmluZWQzIjoiIiwidXNlckRlZmluZWQ0IjoiIiwidXNlckRlZmluZWQ1IjoiIiwicmVzcENvZGUiOiI4MTAwIiwicmVzcERlc2MiOiJTdWNjZXNzIOKAkyBQYXlvdXQgZGlzYnVyc2VtZW50IHN1Y2Nlc3MifQ.Nrwsx62UWsxDz1zNnwBI9h-Kvof7mBg457BI5sqnkHw"
}