# Order Status Notification
When the order payment is completed (success or failure), the payment gateway will initiate a callback notification to the merchant system. If the merchant system does not return correctly, the payment gateway will delay notification again.
# Notification API
api
Request URL: This link is set by the parameter notifyUrl submitted through the unified order API. If the link cannot be accessed, the merchant system will not be able to receive notifications from the payment center.
Request method: POST
Request type: application/x-www-form-urlencoded
* Security: For the production environment, the source of the notification is strongly verified, and the production environment traffic export "Production Environment Traffic Export"
# Notification parameters
| Field Name | Variable Name | Required | Type | Example Value | Description |
|---|---|---|---|---|---|
| Payment order number | payOrderId | Yes | String(30) | P12021022311124442600 | Return payment system order number |
| Merchant No | mchNo | Yes | String(30) | M1621873433953 | Merchant Number |
| App ID | appId | Yes | String(24) | 60cc09bce4b0f1c0b83761c9 | App ID |
| Merchant order number | mchOrderNo | Yes | String(30) | 20160427210604000490 | Return the order number passed in by the merchant |
| Payment method | wayCode | Yes | String(30) | PIX | Payment method CHECKOUT: The user has not selected a payment method |
| Payment amount | amount | Yes | int | 100 | Payment amount, in cents |
| Currency code | currency | Yes | String(3) | USD | Three-digit currency code |
| Order status | state | Yes | int | 2 | Payment order status 0-Order generated 1-Payment in progress 2-Payment successful 3-Payment failed 4-Cancelled 6-Order closed |
| Client IP | clientIp | No | String(32) | 210.73.10.148 | Client IPV4 address |
| Product title | subject | Yes | String(64) | Product title test | Product title |
| Product Description | body | Yes | String(256) | product description test | Product Description |
| Channel error code | errCode | No | String | 1002 | Channel order return error code |
| Channel error description | errMsg | No | String | 134586944573118714 | Channel order return error description |
| Extended parameters | extParam | No | String(512) | 134586944573118714 | Merchant extended parameters |
| Creation time | createdAt | Yes | long | 1622016572190 | Order creation time, 13-digit timestamp |
| Success time | successTime | No | long | 1622016572190 | Order payment success time, 13-digit timestamp |
| Notification request time | reqTime | Yes | String(30) | 1622016572190 | Notification request time, 13-digit timestamp |
| Signature | sign | Yes | String(32) | C380BEC2BFD727A4B6845133519F3AD6 | Signature value, see signature algorithm for details |
# Return Results
After processing, the business system synchronously returns to the payment center. The return string success means that it has been processed (*success only means that the notification has been received, and has nothing to do with the order status). If an exception occurs in the processing and returns non-success, it means that the processing failed, and the payment center will notify the business system again. (Notification frequency is 0/30/60/90/120/150, unit: seconds)
| State | state | Business System Response |
|---|---|---|
| 2 | Payment successful | success |
| 3 | Payment failed | success |
| 4 | Canceled | success |
| 6 | Order closed | success |
Attention
The returned string must be lowercase and cannot have spaces or newlines before or after it.
# Notification Example Data
amount=10000&payOrderId=P1732208420674936834&mchOrderNo=M17018256343223056&subject=%E6%8E%A5%E5%8F%A3%E8%B0%83%E8%AF%95%5BM1701076970-c%5D&wayCode=PIX&sign=4210976D520A0FC7F4E951549E8F087C&reqTime=1701825776788&body=%E6%8E%A5%E5%8F%A3%E8%B0%83%E8%AF%95%5BM1701076970-c%5D&createdAt=1701825645022&appId=65645feae4b0048fdf1b3b39&clientIp=59.42.204.240&successTime=1701825777000¤cy=BRL&state=2&mchNo=M1701076970