Create Order
Merchant cashier scan QR Code in the End-User's Zalopay App to deduct the amount
- application/json
- application/x-www-form-urlencoded
- application/xml
Request Body required
- app_id int required
Identification of the application provided by Zalopay.
- app_user string(50) required
User Identification likes Id/username... . Use application name if you cannot identify the user
- app_time int64 required
The time of order creation (current unix timestamp in millisecond).
- amount int64 required
The amount of the order (VND).
- app_trans_id string(40) required
Order's transaction code. The transaction-code's format should be yymmdd-order's code".
- embed_data string(1024) required
Application's own data. Use
"{}"
if empty".
Specific embed_data's fields:
redirecturl
+ DataType: string
+ Format: URL
+ Description: Redirect to this url after successful / failure payment via Zalopay Gateway (This will override the merchant's redirect url registered with Zalopay). Example:{"redirecturl": "https://docs.Zalopay.vn/result"}
columninfo
+ DataType: json string
+ Format:{"column_name": "value"}
+ Description: Add information into the section Management of transaction details on Merchant site, If the column does not yet exist, please go to the Display data configuration setting to configure. Example:{"columninfo": "{\"branch_id\": \"HCM\",\"store_id\": \"CH123\",\"store_name\": \"Saigon Centre\",\"mc_campaign_id\": \"FREESHIP\"}"}
promotioninfo
+ DataType: json string
+ Format:{"campaigncode":"code"}
+ Description: Use to launch promotions campaign. Example:{"promotioninfo": "{\"campaigncode\":\"blackfriday\"}"}
zlppaymentid
+ DataType: string
+ Description: Payment information. Only needed when you need to receive money for different accounts. Zalopay system will generate a Payment code (corresponding to each partner bank account provided) and send it back to the partner to set up. Example:{"zlppaymentid": "P4201372"}
- item string(1024) required
Order's item, defined by the application itself. Use
"[]"
if empty. - mac string required
Authentication information of the order.
mac = HMAC(hmac_algorithm, key1, hmac_input)
hmac_input: app_id +
”|”
+ app_trans_id +”|”
+ app_user +”|”
+ amount +"|"
+ app_time +”|”
+ embed_data +"|"
+ item +"|"
+ paymentCodeRaw
key1: Mac Key provided by Zalopay at registration
hmac_algorithm: is a security method registered by Merchant with Zalopay, the default isHmacSHA256
- payment_code string required
Scanned from Zalopay by Merchant's terminal and encrypted by Public Key provided by Zalopay = RSA(paymentCodeRaw, publicKey).
- description string(100)
The description of the order, this will display when proceed payment.
- callback_url string
Zalopay will notify to this URL when payment completed. If not provided, the default app callback URL will be used.
- redirect_url string
Redirect to this url after successful / failure payment via Zalopay Gateway (This will override redirect url set on Zalopay Merchant Portal).
- device_info string(256)
JSON string describes the device specification.
- currency string
The currency of order. Default is VND.
- title string
Optional title of order.
- userIP string
User IP Address.
Request Body required
- app_id int required
Identification of the application provided by Zalopay.
- app_user string(50) required
User Identification likes Id/username... . Use application name if you cannot identify the user
- app_time int64 required
The time of order creation (current unix timestamp in millisecond).
- amount int64 required
The amount of the order (VND).
- app_trans_id string(40) required
Order's transaction code. The transaction-code's format should be yymmdd-order's code".
- embed_data string(1024) required
Application's own data. Use
"{}"
if empty".
Specific embed_data's fields:
redirecturl
+ DataType: string
+ Format: URL
+ Description: Redirect to this url after successful / failure payment via Zalopay Gateway (This will override the merchant's redirect url registered with Zalopay). Example:{"redirecturl": "https://docs.Zalopay.vn/result"}
columninfo
+ DataType: json string
+ Format:{"column_name": "value"}
+ Description: Add information into the section Management of transaction details on Merchant site, If the column does not yet exist, please go to the Display data configuration setting to configure. Example:{"columninfo": "{\"branch_id\": \"HCM\",\"store_id\": \"CH123\",\"store_name\": \"Saigon Centre\",\"mc_campaign_id\": \"FREESHIP\"}"}
promotioninfo
+ DataType: json string
+ Format:{"campaigncode":"code"}
+ Description: Use to launch promotions campaign. Example:{"promotioninfo": "{\"campaigncode\":\"blackfriday\"}"}
zlppaymentid
+ DataType: string
+ Description: Payment information. Only needed when you need to receive money for different accounts. Zalopay system will generate a Payment code (corresponding to each partner bank account provided) and send it back to the partner to set up. Example:{"zlppaymentid": "P4201372"}
- item string(1024) required
Order's item, defined by the application itself. Use
"[]"
if empty. - mac string required
Authentication information of the order.
mac = HMAC(hmac_algorithm, key1, hmac_input)
hmac_input: app_id +
”|”
+ app_trans_id +”|”
+ app_user +”|”
+ amount +"|"
+ app_time +”|”
+ embed_data +"|"
+ item +"|"
+ paymentCodeRaw
key1: Mac Key provided by Zalopay at registration
hmac_algorithm: is a security method registered by Merchant with Zalopay, the default isHmacSHA256
- payment_code string required
Scanned from Zalopay by Merchant's terminal and encrypted by Public Key provided by Zalopay = RSA(paymentCodeRaw, publicKey).
- description string(100)
The description of the order, this will display when proceed payment.
- callback_url string
Zalopay will notify to this URL when payment completed. If not provided, the default app callback URL will be used.
- redirect_url string
Redirect to this url after successful / failure payment via Zalopay Gateway (This will override redirect url set on Zalopay Merchant Portal).
- device_info string(256)
JSON string describes the device specification.
- currency string
The currency of order. Default is VND.
- title string
Optional title of order.
- userIP string
User IP Address.
Request Body required
- app_id int required
Identification of the application provided by Zalopay.
- app_user string(50) required
User Identification likes Id/username... . Use application name if you cannot identify the user
- app_time int64 required
The time of order creation (current unix timestamp in millisecond).
- amount int64 required
The amount of the order (VND).
- app_trans_id string(40) required
Order's transaction code. The transaction-code's format should be yymmdd-order's code".
- embed_data string(1024) required
Application's own data. Use
"{}"
if empty".
Specific embed_data's fields:
redirecturl
+ DataType: string
+ Format: URL
+ Description: Redirect to this url after successful / failure payment via Zalopay Gateway (This will override the merchant's redirect url registered with Zalopay). Example:{"redirecturl": "https://docs.Zalopay.vn/result"}
columninfo
+ DataType: json string
+ Format:{"column_name": "value"}
+ Description: Add information into the section Management of transaction details on Merchant site, If the column does not yet exist, please go to the Display data configuration setting to configure. Example:{"columninfo": "{\"branch_id\": \"HCM\",\"store_id\": \"CH123\",\"store_name\": \"Saigon Centre\",\"mc_campaign_id\": \"FREESHIP\"}"}
promotioninfo
+ DataType: json string
+ Format:{"campaigncode":"code"}
+ Description: Use to launch promotions campaign. Example:{"promotioninfo": "{\"campaigncode\":\"blackfriday\"}"}
zlppaymentid
+ DataType: string
+ Description: Payment information. Only needed when you need to receive money for different accounts. Zalopay system will generate a Payment code (corresponding to each partner bank account provided) and send it back to the partner to set up. Example:{"zlppaymentid": "P4201372"}
- item string(1024) required
Order's item, defined by the application itself. Use
"[]"
if empty. - mac string required
Authentication information of the order.
mac = HMAC(hmac_algorithm, key1, hmac_input)
hmac_input: app_id +
”|”
+ app_trans_id +”|”
+ app_user +”|”
+ amount +"|"
+ app_time +”|”
+ embed_data +"|"
+ item +"|"
+ paymentCodeRaw
key1: Mac Key provided by Zalopay at registration
hmac_algorithm: is a security method registered by Merchant with Zalopay, the default isHmacSHA256
- payment_code string required
Scanned from Zalopay by Merchant's terminal and encrypted by Public Key provided by Zalopay = RSA(paymentCodeRaw, publicKey).
- description string(100)
The description of the order, this will display when proceed payment.
- callback_url string
Zalopay will notify to this URL when payment completed. If not provided, the default app callback URL will be used.
- redirect_url string
Redirect to this url after successful / failure payment via Zalopay Gateway (This will override redirect url set on Zalopay Merchant Portal).
- device_info string(256)
JSON string describes the device specification.
- currency string
The currency of order. Default is VND.
- title string
Optional title of order.
- userIP string
User IP Address.
- 200
OK
- application/json
- Schema
- Example (from schema)
Schema
- return_code int
1
: Success
2
: Failure
3
: Processing, check by API checking - return_message string
Details of the status code
- sub_return_code int
Details of the status code
- sub_return_message string
Order's status detail information
- is_processing boolean
true
: Processing
false
: End of transaction - zp_trans_id int64
Zalopay's transaction code
{
"return_code": 0,
"return_message": "string",
"sub_return_code": 0,
"sub_return_message": "string",
"is_processing": true,
"zp_trans_id": 0
}