Withdrawal
HTTPS POST / Server-to-Server
Payment requests and responses are signed using JWS
- The signature uses JWS PS256
Merchants must know how to prepare requests and process responses using JWS with keys.
// Withdraw Option
https://demo2.2c2p.com/2c2pfrontend/paymentaction/2.0/withdrawOption
// Withdraw
https://demo2.2c2p.com/2c2pfrontend/paymentaction/2.0/withdraw
// Withdraw Option
https://t.2c2p.com/paymentaction/2.0/withdrawOption
// Withdraw
https://t.2c2p.com/paymentaction/2.0/withdraw
Provided Sample Code
Withdraw Options
2C2P provides API for merchant to retrieve withdraw options to be used in the Withdraw
Request. Withdraw options explains the mode of fund transfer (cheque, bank transfer, TT, etc) and the fees structure for each mode.
API Parameter
Withdraw Options Request Parameter
Withdraw Options Response Parameter
Withdraw Option Request
- Prepare request data.
- Encrypt payload data with JWS with PS256 algorithm using merchant private key.
{
"version":"1.0",
"merchantID":"702702000000000"
}
eyJhbGciOiJQUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjaGFudElEIjoiNzAyNzAyMDAwMDAwMDAwIiwidmVyc2lvbiI6IjEuMCJ9.lxVdLB_ReafleLiobg5m-sj43GE--8X_mpx7tTGkU2ac3BMaFpHaNHD1DPPlP2q3qWEnd2D1z2EjAnWSl5TZ2xZYAtq3qtASWYeIn3pLnpGJrMvcofKe4H4pQsRDWdN_M9bOq0Wh3LGMNt5aM7388o6pwfbHdQCLjHOQTxpRZoFyP1G_1U4CShpNHakvCnZLS_za-ywDm1gkG83KypvNAoHlms2Vxp4KlwKVka5spU8X5e3K_zIzrRuqe6pNHgl31-Hkty62uANVk8hJ9ZpBb87jm11Sz0c6UbxuGcXB-wJm4cxaDV9wo7NMss9PMsz_5F-7JbxMocSBsh8dh0WAianXA2n1JV5SZgEK088_xlDex1Qdgu6TsDxNvABk8BwLAuKDAAA3czjSWhOpvhaES8HR1F_F8u4wxYeje_uWUVUjzfSEdY31yv0gAAF9cKh9pVCf93oqw23f0Ud1jy-pM3iaIvzlFLD9ADPLhVqU2CTSyRoQBXJowN9Ghu0OU7qr5m-1_ZH9F1wqGcnTgrgA8CedQ8_89uIuV7lNOc_Xcl_6wQTVZsiAh6FZNI7o6nqrslsxgjr0htHaP4yggB2Bwa0Zk4qvEStJgGc8zFgS1jbeabM_gSQN_WF34vyZNIbtSf92PFCNZeSZpT4gduTbOufbH55lFyaLhZ1H2Wbys1o
- Send request to withdraw option request API.
curl --location --request POST 'https://demo2.2c2p.com/2c2pfrontend/paymentaction/2.0/withdrawOption' \
--header 'Content-Type: text/plain' \
--data-raw 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoiMS4wIiwibWVyY2hhbnRJRCI6IkpUIn0.Vu6Nny0LP5jZE_WWEJ87Pl9MYVhz_372rqFnzbgF3Ww'
Withdraw Option Response
- Receiving encrypted payout response data
- Decrypt payload data with JWS with PS256 algorithm using 2c2p public cert key.
{
"version": "1.0",
"respCode": "00",
"respDesc": "Success",
"withdrawOption": [
{
"merchantId": "702702000000000",
"withdrawOptionId": 3,
"name": "Withdraw fund",
"processingTime": "5 days",
"feeMargin": 1000.0,
"feeLower": 0.5,
"feeLowerIsPercentage": "1",
"feeUpper": 0.7,
"feeUpperIsPercentage": "1"
}
]
}
eyJhbGciOiJQUzI1NiIsImtpZCI6ImRlZmF1bHQifQ.ew0KICAidmVyc2lvbiI6ICIxLjAiLA0KICAicmVzcENvZGUiOiAiMDAiLA0KICAicmVzcERlc2MiOiAiU3VjY2VzcyIsDQogICJ3aXRoZHJhd09wdGlvbiI6IFsNCiAgICB7DQogICAgICAibWVyY2hhbnRJZCI6ICI3MDI3MDIwMDAwMDAwMDAiLA0KICAgICAgIndpdGhkcmF3T3B0aW9uSWQiOiAzLA0KICAgICAgIm5hbWUiOiAiV2l0aGRyYXcgZnVuZCIsDQogICAgICAicHJvY2Vzc2luZ1RpbWUiOiAiNSBkYXlzIiwNCiAgICAgICJmZWVNYXJnaW4iOiAxMDAwLjAsDQogICAgICAiZmVlTG93ZXIiOiAwLjUsDQogICAgICAiZmVlTG93ZXJJc1BlcmNlbnRhZ2UiOiAiMSIsDQogICAgICAiZmVlVXBwZXIiOiAwLjcsDQogICAgICAiZmVlVXBwZXJJc1BlcmNlbnRhZ2UiOiAiMSINCiAgICB9DQogIF0NCn0.WVjKvik13IUqjaFgWk6ZLywKpfDAHBBECoBWnF5EuzPkwTWiYiZDYMNXTy7L-lFTUbVfXYEczr7k67afeGnrRXj-5cFhVxnch4J4H_CYfe78A3-9CoBiMZ66sWDfcBbruOYIfs8H9DCmHBwxn_nxOhdkJxjsRRDtfKEThVAwqaoAaboerBHq4myVtWvOOHjVWgMZ_yo97F1Lavf72jsBDgdBQgThw726XnPVNxtUpvAYWfMdwLG1gUan9-wKLOCJBtLW2yS0JBItHorCDaNZ_oIapBd-P7pAHOPlygAJ0q-Dwlvl5VVbL1VfgkfkUSCEC5JU7i8lCZfKj_4hI-SEgw
Withdraw
2C2P provides API for merchant to perform Fund withdrawal.
API Parameter
Withdraw Request
- Prepare request data.
- Encrypt payload data with JWS with PS256 algorithm using merchant private key.
{
"version":"1.0",
"merchantID": "702702000000000",
"withdrawOptionID": 3,
"amount": 100
}
eyJhbGciOiJQUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjaGFudElEIjoiNzAyNzAyMDAwMDAwMDAwIiwidmVyc2lvbiI6IjEuMCIsIndpdGhkcmF3T3B0aW9uSUQiOjMsImFtb3VudCI6MTAwfQ.QAqkVMrqg62HTjtNwg75cIArhr8rPXgU5X9n18vl3JOQo0flj3QQ8vvoeZGZ46wumNuPXL6uldaZnWdcGLkRUuxbtEW5ptIYQVAYfKjoi0tP_lKqbqlyRHkH89tzMw7DILMGQhSR40bfs_N3VcN5LJ7bXF34hGIgFlCUT7evMaMiq76rZxcqb5ycKiKzKs0zDOhN0HhAaZB5Y2GsY8Hue7TYB1sLPN1EDfJpFnxfpwY4Ka1-3bW0Qiq3rOmrWG9c2FJMUndi2Bjgyl4TDqXgozODa8eihMbDkKYBI71uTcn4EC4ZVIlsZt-1UEZsjPp1HaQxN7PrfClizLadnckg3BWQ9u56iXJ58qC8zWYKyv1Ap9ovyAc6XwWGy-nGZKfrIeuP1rsyvCRXGQIHV_XIL2aSiMztzLGSNhqjYLoUxJI9-mVQGB2sSjGh7yLFTv1zkR41VgJsQ8h-OxiVFgEUCFlPsPVcsUquQc0gghX7z71kZSDWqvS1Pqm9jg5skUdobGinjAB2v0ZvhZFi8nQRG_hqYKct9JVVSsMrD4fh7gKUEvkSqdjVf3QzCfStbiTyEWgmGyr4ZU0mOK1vHZxsE8sJhlEeVyODwudL2fb6wChw6NXHJOvt_V2po3JeF5eWzuLNtMDGgRAfTn2KjWzUcPSz60ZJBO1Z6dnI48MgZeE
- Send request to withdraw request API.
curl --location --request POST 'https://demo2.2c2p.com/2c2pfrontend/paymentaction/2.0/withdraw' \
--header 'Content-Type: text/plain' \
--data-raw 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoiMS4wIiwibWVyY2hhbnRJRCI6IkpUIiwid2l0aGRyYXdPcHRpb25JRCI6OSwiYW1vdW50IjoxMDAwfQ.NSFSIbHBfOwWDRp2CSgKXtWCh5GG7xmKz2t1frg-Id0'
Withdraw Response
- Receiving encrypted payout response data
- Decrypt payload data with JWS with PS256 algorithm using 2c2p public cert key.
{
"version": "1.0",
"respCode": "00",
"respDesc": "Success",
"withdrawRefNo": 691012,
"withdrawOptionId": 3,
"amount": 100.0,
"currency": "SGD",
"fee": 0.5,
"netAmount": 99.5
}
eyJhbGciOiJQUzI1NiIsImtpZCI6ImRlZmF1bHQifQ.ew0KICAidmVyc2lvbiI6ICIxLjAiLA0KICAicmVzcENvZGUiOiAiMDAiLA0KICAicmVzcERlc2MiOiAiU3VjY2VzcyIsDQogICJ3aXRoZHJhd1JlZk5vIjogNjkxMDEyLA0KICAid2l0aGRyYXdPcHRpb25JZCI6IDMsDQogICJhbW91bnQiOiAxMDAuMCwNCiAgImN1cnJlbmN5IjogIlNHRCIsDQogICJmZWUiOiAwLjUsDQogICJuZXRBbW91bnQiOiA5OS41DQp9.eyMs1lhFI_Y0iyWNJMr9E7zUZqzfNqDhAOT-pUlf-KxBzDxCVF2pU3X6768KwlYq_2CQDwqqi46TXTQAM0V5mVW_87NpTbEAahD7NIU5PKXzpM5BRrWc1b9ZxMrGefvZ4CWm0nKK8HjRpZVhmvWs7qNWNskq4BJTulB5-cFuC4PCQx829h5lqIqvbmUw_a1GUbVhe68mQWDuolD6JJgB5t4nifkJlqBWkxtFpz7pCH9qGfl0uyHI_hgEHOMH1ZTZrsGiDYcOmthIBLAu8su-hlxmH0HGGszoNj-po1yupXXD3yzsRf66oQcBrJNCIAPxffVMVPhLrHC6ur6U_p38TQ
Updated about 1 year ago