Pay by token
This API is used for submitting payment after merchants created the order successfully
- application/json
- application/x-www-form-urlencoded
Request Body required
- app_id int64 required
This is a Zalopay-provided identifier specific to the merchant's service or application, established during the integration agreement for payment methods.
- identifier string required
User's identifier on the merchant system, it can be a merchant user's id, user's name ...
- zp_trans_token string required
The token is generated under Zalopay system by API Create order after the order has been created successfully.
- pay_token string required
The public token of the payer.
- req_date int64 required
Current timestamp in milliseconds - GMT+7.
- mac string required
Authentication information mac = HMAC(hmac_algorihtm, mac key, hmacinput), see as below:
- hmac_algorihtm: is a security method registered by Merchant with Zalopay, the default is HmacSHA256.
- mac key: provided by Zalopay at registration.
- hmacinput = app_id +|+ identifier +|+ zp_trans_token +|+ pay_token +|+ req_date.Please refer to secure data transmission for detailed information.
Request Body required
- app_id int64 required
This is a Zalopay-provided identifier specific to the merchant's service or application, established during the integration agreement for payment methods.
- identifier string required
User's identifier on the merchant system, it can be a merchant user's id, user's name ...
- zp_trans_token string required
The token is generated under Zalopay system by API Create order after the order has been created successfully.
- pay_token string required
The public token of the payer.
- req_date int64 required
Current timestamp in milliseconds - GMT+7.
- mac string required
Authentication information mac = HMAC(hmac_algorihtm, mac key, hmacinput), see as below:
- hmac_algorihtm: is a security method registered by Merchant with Zalopay, the default is HmacSHA256.
- mac key: provided by Zalopay at registration.
- hmacinput = app_id +|+ identifier +|+ zp_trans_token +|+ pay_token +|+ req_date.Please refer to secure data transmission for detailed information.
- 200
OK
- application/json
- Schema
- Example (from schema)
Schema
- return_code integer
Status code.
Please refer to status code for possible values. - return_message string
Description of return code
- sub_return_code integer
Status code detail.
Please refer to status code for possible values. - sub_return_message string
Description of status code detail
- app_trans_id string
TXID of order transaction.
- zp_trans_id integer
Zalopay's transaction code, initiate when users confirms payment at Zalopay site.
{
"return_code": 0,
"return_message": "string",
"sub_return_code": 0,
"sub_return_message": "string",
"app_trans_id": "string",
"zp_trans_id": 0
}