ZaloPay APIs ZOD Integration Document
ZaloPay APIs ZOD Integration Document
ZaloPay APIs ZOD Integration Document
1. Introduction
2. Domain Analysis & Design
3. Deployment Architecture
4. APIs specification
o 4.1 Create ZOD Invoice
o 4.2 Get Invoice
o 4.3 Query Status
o 4.4 Callback ( Instant Payment Notification )
Page 1 / 14
1. Introduction
ZOD ( ZaloPay on delivery ) is a solution, which provides a way for Merchant to create order has the ability to pay later and support
ZNS/ZMS notification message
Page 2 / 14
3. Deployment Architecture
Environment Endpoint
Sandbox https://sbapimep.zalopay.vn
Production https://apimep.zalopay.vn
Page 3 / 14
4. APIs specification
Sequence diagram
Page 4 / 14
Request
o URI: /v2/zod
o Method: POST
o Content-Type: application/json
o Params
Page 5 / 14
Metadata
OrderInfo
Response
Content-Type: application/json
JSON body
Page 6 / 14
Example of Create Invoice request:
{
"appId": "15011",
"mcRefId": "LZD201230_23423440",
"mac": "54b8629f2d6f03aef2faae20928adaa5c4354f477656d83708fb7e56ef4c2c42",
"receiver": {
"contact": "Nguyễn Văn A"
},
"orderInfo": [
{
"trackingNumber": "LEXTEST",
"description": "Đơn hàng 1",
"amount": 20000
},
{
"trackingNumber": "LEXTEST2",
"description": "Đơn hàng 2",
"amount": 10000
}
]
}
{
"orderUrl": "https://sbqrpay.zalopay.vn/zod/{token}"
}
Page 7 / 14
4.2 Get Invoice
Sequence diagram
Request
Page 8 / 14
o URI: /v2/zod/invoice
o Method: GET
o Params
Response
Content-Type: application/json
JSON body
Page 9 / 14
4.3 Query Status
Sequence diagram
Request
o URI: /v2/zod/status
o Method: GET
o Content-Type: application/json
o Params
Page 10 / 14
No Params Datatype Required MaxLength Description Comment
1 appId string Y AppID provided by ZaloPay
2 mcRefId string Y 64 Merchant's reference ID of the order
3 mac string Y
Response
Content-Type: application/json
JSON body
3: UNPAID
2 amount int Order's amount
3 zpTransId string ZaloPay transaction's ID
Page 11 / 14
4.4 Callback ( Instant Payment Notification )
Description: When the payment is successful, this notification will send to the Merchant server to notify about the transaction.
Integration:
o Protocol: HTTPS
o Method: POST
o Content-Type: application/json
o URI: provided by the merchant
Request body
data
Page 12 / 14
5 serverTime int Server timestamp in milliseconds.
6 channel int Payment channel
7 zpUserId string The identifier of ZaloPay user per merchant.
8 userFeeAmount int Fee amount.
9 discountAmount int Discount amount.
10 userChargeAmount int Amount charged from user
Security:
{"data":"{\"appId\":\"15011\",\"mcRefId\":\"LZD201230_23423453\",\"amount\":30000,\"zpT
ransId\":210126000000814,\"serverTime\":1611633042737,\"channel\":38,\"zpUserId\":\"200
601589000506\",\"userFeeAmount\":0,\"discountAmount\":0,\"userChargeAmount\":30000}",
"mac":"dd163f1bc82a92eb8c9619337f47298fee0c95b1c764767ad18f358f0e8120a9",
"type":1
}
Page 13 / 14
Response: JSON string
Example response:
{
"returnCode": 1,
"returnMessage": "SUCCESS"
}
Page 14 / 14