API List
A. Get token
We have developed a new secure way of generating token for our tokenization payment. In this new feature, the card holder is required to pass the OTP (3D secure) check before he/she is able to get the payment token. Also, a few extra layers have been added to ensure that no non authorised cards are being used for this tokenization payment feature.
The old (current) way of getting the payment token will be discontinued and no more access will be granted.
Get token (3D Get Token) -Will be replacing the former 2D token*
Get token (Will be deprecated on 31st December 2019)
Item | Detail |
---|---|
URL endpoint (POST) | https://app.senangpay.my/apiv1/get_payment_token |
1. Authorization Header (Basic Auth)
Type | Basic |
---|---|
Username | < your-merchant-id > As listed in the profile settings page. |
Password | None, leave empty. |
2. Request Parameter (all is mandatory)
Parameter Name | Parameter value/description |
---|---|
name | Your customer’s name. Maximum length is 100. Eg. Abu Bin Ali |
Your customer’s email. Eg. [email protected] | |
phone | Your customer’s phone number. Eg. 0109876543 |
cc_number | Your customer credit card number. |
cc_exp | Your customer credit card expiration date in MMYY format. Eg. if the card expires on January 2017, you need to send 0117 |
cc_cvv | Your customer credit card CVV number. Eg. 123 |
3. Response Parameter
Parameter Name | Parameter value / description |
---|---|
status | Your transaction status. 1 if successful. 0 if failed. |
token | If card validation succeeds, token will be generated. The token will be used for future payment on the card. |
msg | Card validation status message. If it was successful you will receive ‘Card successfully verified, the generated token can be used for future payment.’. If the validation failed, you will receive the error message in this parameter for further checking. |
B. Pay credit card using token
Item | Detail |
---|---|
URL endpoint (POST) | https://app.senangpay.my/apiv1/pay_cc |
1. Authorization Header (Basic Auth)
Type | Basic |
---|---|
Username | < your-merchant-id > As listed in the profile settings page. |
Password | None, leave empty. |
2. Request Parameter (All Mandatory)
Parameter Name | Parameter value/description |
---|---|
name | Your customer name. Maximum length is 100. Eg. Abu Bin Ali |
Your customer email. Eg. [email protected] | |
detail | Your order detail. Maximum length is 100. Eg. Order for product id #4 |
phone | Your customer phone number. Eg. 0109876543 |
order id | Your order id. Can be number or string. Other character is invalid. Eg. 123 |
amount | Your order amount in integer format. Convert from decimals as necessary. Eg. if the amount is RM 2.00, you need to send 200. |
token | Generated token from Get Token API |
hash | A string hashed with your secret key (from your profile setting page) in HMAC hashing algorithm with SHA256 in the following format: < your merchant id >< name >< email >< phone >< detail >< order_id >< amount > *without the < > character |
3. Response Parameter
The same response as our MOTO API https://guide.senangpay.my/senangpay-api-endpoint-for-moto-transaction-2/
C. Enable/disable credit card
Item | Detail |
---|---|
URL endpoint (POST) | https://app.senangpay.my/apiv1/update_token_status |
1. Authorization header (Basic Auth)
Type | Basic |
---|---|
Username | < your-merchant-id > As listed in the profile settings page. |
Password | None, leave empty. |
2. Request Parameter (All Mandatory)
Parameter Name | Parameter value / description |
---|---|
token | Generated token from Get Token API |
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. |
D. Validate payment token
Item | Detail |
---|---|
URL endpoint (POST) | https://app.senangpay.my/apiv1/validate_token |
1. Authorization header (Basic Auth)
Type | Basic |
---|---|
Username | < your-merchant-id > As listed in the profile settings page. |
Password | None, leave empty. |
2. Request Parameter (All Mandatory)
Parameter Name | Parameter value / description |
---|---|
token | Generated token from Get Token API |
3. Response Parameter
Parameter Name | Parameter value/description |
---|---|
status | Token validation status. 1 if success. 0 if failed. |
msg | Token validation status message. If it was successful you will receive ‘Card has been successfully verified.’. If the validation failed, you will receive the error message in this parameter for further checking. |
token | Generated token from Get Token API that has been disabled or enabled. The token will still be the same, nothing changed. We just return the same token here. |