Get payment token
This API to is used to get payment token.
- 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.
- app_trans_id string(40) required
The transaction ID that is used for querying (TXID of binding transaction)
- 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 +|+ app_trans_id +|+ 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.
- app_trans_id string(40) required
The transaction ID that is used for querying (TXID of binding transaction)
- 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 +|+ app_trans_id +|+ 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 status 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.
data object
app_id int64Binding app_id.
app_trans_id stringBinding app_trans_id.
binding_id stringThe id of binding has been confirmed in the Zalopay system.
pay_token stringThe public token is used when doing auto-debit.
server_time int64Server timestamp in seconds.
merchant_user_id stringThe identifier field in bind request.
status integer1: Confirmed, 3: Cancelled
msg_type integerType of message:
1: The user confirms an agreement.
2: The user updates the agreement.zp_user_id stringThe identifier of Zalopay user per merchant app_id.
masked_user_phone stringMasked user phone (Ex: masked_user_phone: "****6938")
{
"return_code": 0,
"return_message": "string",
"sub_return_code": 0,
"sub_return_message": "string",
"data": {
"app_id": 0,
"app_trans_id": "string",
"binding_id": "string",
"pay_token": "string",
"server_time": 0,
"merchant_user_id": "string",
"status": 0,
"msg_type": 0,
"zp_user_id": "string",
"masked_user_phone": "string"
}
}