Balance Inquiry
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.
https://demo2.2c2p.com/2c2pfrontend/paymentaction/2.0/balanceInquiry
https://t.2c2p.com/paymentaction/2.0/balanceInquiry
API Parameter
Balance Inquiry Request Parameter
Balance Inquiry Response Parameter
Provided Sample Code
Prepare Balance Inquiry Request
- Prepare request data.
- Encrypt payload data with JWS with PS256 algorithm using merchant private key.
{
"merchantID": "702702000000000",
"version": "1.0"
}
eyJhbGciOiJQUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjaGFudElEIjoiNzAyNzAyMDAwMDAwMDAwIiwidmVyc2lvbiI6IjEuMCJ9.WAQziPTG95HZjuKc0U73Kv_jFX3_8rk8wzphOdHfEQMVv2cOj0IaqvC9AUMoVvY54cLfb7KW6b7umKKSdXXf7eNjr1Y5DvFyiono0G5qzGUDoIZiYm1dFXlY9zbzCkx_iMrGC9ZwpYx97XDRHKt81D2hsoLGpQbCtgUE1Q3LQ6OpkTtrbUv1RHeE-zlZ-nxOzMxjT-0GUp_eFL2YgyaerOgaRNEh2dO10zDMcni9fezax1KhtQK4_GyehLs2fiQFjklwHx0bGmvD2TGLmGjbR6DMq9A4NNdCdFNOUrrkg8a1365BAn47EwemVF9HmoRMALvwNU7-mbE6DG8WzDCsgf6kcYuyMF2DXeor_vRqlb75taX03Fbq2oNblFfXi2RvuTOClgHMnnS2joOF-oQMKbW_W1PC89yWG3Ai5X35XLynWBJ0IecZpjTSOsUBzZYk6uzDjhzfJUaRrVaRxQOLv2P8HlB1PRfRTkveK3e8-jUNNnmRb1T5VHvjiQkqXVFmjWCLdi7XYUs3qnDAb2F93Lu9lqOlbmHNd_qdnrUvgOil9qdYJMynsfXlLCdRfd2WKlGm2oYWyNE412FXW1YPot5DklkOd_TV9u_bDvF-iVSOg6H0Ijb7qQD-P6t5ChRLXF37FSOb0G6hrruFvPXY9UxI7_BFQhkhxVaLlkmHy3g
- Send request to payout request API.
curl --location --request POST 'https://demo2.2c2p.com/2c2pfrontend/paymentaction/2.0/balanceInquiry' \
--header 'Content-Type: text/plain' \
--data-raw 'eyJhbGciOiJQUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjaGFudElEIjoiNzAyNzAyMDAwMDAwMDAwIiwidmVyc2lvbiI6IjEuMCJ9.WAQziPTG95HZjuKc0U73Kv_jFX3_8rk8wzphOdHfEQMVv2cOj0IaqvC9AUMoVvY54cLfb7KW6b7umKKSdXXf7eNjr1Y5DvFyiono0G5qzGUDoIZiYm1dFXlY9zbzCkx_iMrGC9ZwpYx97XDRHKt81D2hsoLGpQbCtgUE1Q3LQ6OpkTtrbUv1RHeE-zlZ-nxOzMxjT-0GUp_eFL2YgyaerOgaRNEh2dO10zDMcni9fezax1KhtQK4_GyehLs2fiQFjklwHx0bGmvD2TGLmGjbR6DMq9A4NNdCdFNOUrrkg8a1365BAn47EwemVF9HmoRMALvwNU7-mbE6DG8WzDCsgf6kcYuyMF2DXeor_vRqlb75taX03Fbq2oNblFfXi2RvuTOClgHMnnS2joOF-oQMKbW_W1PC89yWG3Ai5X35XLynWBJ0IecZpjTSOsUBzZYk6uzDjhzfJUaRrVaRxQOLv2P8HlB1PRfRTkveK3e8-jUNNnmRb1T5VHvjiQkqXVFmjWCLdi7XYUs3qnDAb2F93Lu9lqOlbmHNd_qdnrUvgOil9qdYJMynsfXlLCdRfd2WKlGm2oYWyNE412FXW1YPot5DklkOd_TV9u_bDvF-iVSOg6H0Ijb7qQD-P6t5ChRLXF37FSOb0G6hrruFvPXY9UxI7_BFQhkhxVaLlkmHy3g'
Process Balance Inquiry 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",
"availableBalance": "795904449.7206",
"currency": "SGD"
}
eyJhbGciOiJQUzI1NiIsImtpZCI6ImRlZmF1bHQifQ.eyJ2ZXJzaW9uIjoiMS4wIiwicmVzcENvZGUiOiIwMCIsInJlc3BEZXNjIjoiU3VjY2VzcyIsImF2YWlsYWJsZUJhbGFuY2UiOiI3OTU5MDQ0NDkuNzIwNiIsImN1cnJlbmN5IjoiU0dEIn0.FzGBAok1M1ngQwbFxWu8Jn3J8N1UH4H3E4ne9WUBnLSrJLXi99CPGRDLnqjVxMALKvI1liXnulTqlFxQo20jkketyXtOgeuYmcikM-xqxpIuNNCPasVWZlpInmxerpN5rAB48LJ4Ri7MVzpZKIn-V1qt8zNBODeCA-MeVsIp3iyAib7XMMJ0zqMYfBo6SWo_MeDHJ7CeXx9rHcgZmTv3DzVyoYhfSnuem0ZyYvSKcD3fLT0CWz8qBzuC_2Q3wIXoXOqW4k_0iF22gnqCpAlbvM7JggsqL08A1a_aHBi3B6seT27rnjuNLY96RiHEJush0lT-wM_xiy2USxjPiw9G6A
Updated over 2 years ago