fbpx
← back

Reference Docs

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)

ItemDetail
URL endpoint (POST)https://app.senangpay.my/apiv1/get_payment_token

 

1. Authorization Header (Basic Auth)
TypeBasic
Username< your-merchant-id >
As listed in the profile settings page.
PasswordNone, leave empty.

 

2. Request Parameter (all is mandatory)
Parameter NameParameter value/description
nameYour customer’s name. Maximum length is 100.
Eg. Abu Bin Ali
emailYour customer’s email.
Eg. [email protected]
phoneYour customer’s phone number.
Eg. 0109876543
cc_numberYour customer credit card number.
cc_expYour customer credit card expiration date in MMYY format.
Eg. if the card expires on January 2017, you need to send 0117
cc_cvvYour customer credit card CVV number.
Eg. 123

 

3. Response Parameter
Parameter NameParameter value / description
statusYour transaction status. 1 if successful. 0 if failed.
tokenIf card validation succeeds, token will be generated. The token will be used for future payment on the card.
msgCard 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

ItemDetail
URL endpoint (POST)https://app.senangpay.my/apiv1/pay_cc
 
1. Authorization Header (Basic Auth)
TypeBasic
Username< your-merchant-id >
As listed in the profile settings page.
PasswordNone, leave empty.
 
2. Request Parameter (All Mandatory)
Parameter NameParameter value/description
nameYour customer name. Maximum length is 100.
Eg. Abu Bin Ali
emailYour customer email.
Eg. [email protected]
detailYour order detail. Maximum length is 100. Eg. Order for product id #4
phoneYour customer phone number.
Eg. 0109876543
order idYour order id. Can be number or string. Other character is invalid. Eg. 123
amountYour order amount in integer format. Convert from decimals as necessary.
Eg. if the amount is RM 2.00, you need to send 200.
tokenGenerated token from Get Token API
hashA 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

ItemDetail
URL endpoint (POST)https://app.senangpay.my/apiv1/update_token_status
 
1. Authorization header (Basic Auth)
TypeBasic
Username< your-merchant-id >
As listed in the profile settings page.
PasswordNone, leave empty.
 
2. Request Parameter (All Mandatory)
Parameter NameParameter value / description
tokenGenerated token from Get Token API
 
3. Response Parameter
Parameter NameParameter value/description
msgMessage for the token is successfully disabled or enabled.
tokenGenerated token from Get Token API that has been disabled or enabled.

 

D. Validate payment token

ItemDetail
URL endpoint (POST)https://app.senangpay.my/apiv1/validate_token
 
1. Authorization header (Basic Auth)
TypeBasic
Username< your-merchant-id >
As listed in the profile settings page.
PasswordNone, leave empty.
 
2. Request Parameter (All Mandatory)
Parameter NameParameter value / description
tokenGenerated token from Get Token API
 
3. Response Parameter
Parameter NameParameter value/description
statusToken validation status. 1 if success. 0 if failed.
msgToken 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.
tokenGenerated 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.