Secure payments via API Tokenization with verified cards
1.0 Pay credit card using token
Item | Detail |
---|---|
URL endpoint (POST) | https://app.senangpay.my/apiv1/pay_cc |
Sandbox URL endpoint (POST) | https://app.senangpay.my/apiv1/pay_cc |
1.1 Authorization Header (Basic Auth)
Type | Basic |
---|---|
Username | < your-merchant-id > As listed in the profile settings page. |
Password | None, leave empty. |
1.2 Request Parameter (All Mandatory)
Parameter Name | Parameter value/description |
name | Your customer name. Maximum length is 100.
|
Your customer email.
| |
detail | Your order detail. Maximum length is 100.
|
phone | Your customer phone number.
|
order_id | Your order id. Can be number or string. Other character is invalid.
|
amount | Your order amount in integer format. Convert from decimals as necessary.
|
token | Generated token from Get Token API |
hash | A string generated using your secret key (found in your profile settings) with the HMAC SHA256 algorithm. The format is as follows:
|
1.3 Response Parameter
Parameter Name | Parameter value / description |
status | Your transaction status. 1 if successful. 0 if failed. |
transaction_id | Your transaction ID number. |
order_id | Your original order ID. |
amount_paid | Amount transacted from the credit card in integer format.
|
msg | Transaction status message. You'll receive "Payment was successful" for successful payments, or an error message if the transaction failed. |
hash | A string generated using your secret key with HMAC SHA256. Format:
|
1.4 Sample Response
** The "Test it" option is available when using Firefox or Safari to test the API
2.0 Enable/disable credit card
Item | Detail |
URL endpoint (POST) | https://app.senangpay.my/apiv1/update_token_status |
2.1 Authorization header (Basic Auth)
Type | Basic |
---|---|
Username | < your-merchant-id > As listed in the profile settings page. |
Password | None, leave empty. |
2.2 Request Parameter (All Mandatory)
Parameter Name | Parameter value / description |
---|---|
token | Generated token from Get Token API |
2.3 Response Parameter
Parameter Name | Parameter value/description |
msg | Message for the token is successfully disabled or enabled. |
token | Generated token from Get Token API that has been disabled or enabled. |
** The "Test it" option is available when using Firefox or Safari to test the API
3.0 Validate payment token
Item | Detail |
URL endpoint (POST) | https://app.senangpay.my/apiv1/validate_token |
3.1 Authorization header (Basic Auth)
Type | Basic |
---|---|
Username | < your-merchant-id > As listed in the profile settings page. |
Password | None, leave empty. |
3.2 Request Parameter (All Mandatory)
Parameter Name | Parameter value / description |
---|---|
token | Generated token from Get Token API |
3.3 Response Parameter
Parameter Name | Parameter value/description |
status | Token validation result.
|
msg | Message on token validation. "Card has been successfully verified" if successful, or an error message if not. |
token | The token from the Get Token API, unchanged, showing whether it's enabled or disabled. |
** The "Test it" option is available when using Firefox or Safari to test the API
Last updated