API REFERENCE
Asynchronous Notifications
Throughout an order's lifecycle, we send an asynchronous notification to notify_url for every status change. The receiving endpoint must use https. Notifications include a signature and payment parameters (in json format).
Tip
- The notification URL is the submitted notify_url. After payment completion, YabandPay sends the relevant payment and user information to this URL. The third-party acquiring institution must receive the notification and verify its signature before taking any further action.
- During server notification exchanges, if the third-party acquiring institution returns a non-success response or the request times out, YabandPay considers the notification unsuccessful. YabandPay periodically retries notifications according to its retry strategy to maximize delivery success, but does not guarantee eventual delivery.
- Because server notifications may be retried, the same notification may be sent to the partner system multiple times. The partner system must handle duplicate notifications correctly. We recommend first checking the state of the corresponding business data when processing a notification to determine whether it has already been handled. Process it only if it has not been handled; otherwise, return success immediately. Before checking and processing the business data, use data locks for concurrency control to prevent data inconsistencies caused by function reentry.
- YabandPay sends asynchronous notifications from the following IP addresses. We recommend adding them to your firewall allowlist. 8.211.41.31 8.211.10.244 8.211.8.123
1. Asynchronous payment notifications
| Parameter | Type | Description |
|---|---|---|
| sign | String | Signature |
| type | String | payment |
| user | String | UID or Email of the cashier account |
| amount | String | Submitted payment amount |
| tip_amount | String | Tip included in the total amount |
| trade_id | String | YabandPay transaction number |
| currency | String | Submitted payment currency |
| settlement_amount | String | Amount in the settlement currency |
| settlement_currency | String | Settlement currency |
| exchange_rate | String | Payment amount/settlement amount |
| amount_cny | String | Payment amount in CNY |
| settlement_rate | String | CNY settlement exchange rate |
| order_id | String | Merchant order number |
| transaction_id | String | Order number returned by the payment method, such as the WeChat Pay or Alipay+ transaction number. In most cases, this is the same as acquirer_id. |
| acquirer_id | String | Acquirer Reference Number (ARN) |
| description | String | Order description |
| createDate | String | Order creation time |
| state | String | Payment status: Processing, Paid,Cancelled, Expired, Verify,Authorized,Declined,Failed |
| demo | String | Customer-defined field |
| out_trade_no | String | Internal order number in the transaction system |
| sub_pay_method | String | Payment method: WeChat Pay, Alipay+, etc. (see the payment method descriptions) |
| pay_method | String | Payment type: offline, online |
| paid_time | String | Payment time |
| yb_transaction_id | String | Unique YabandPay transaction ID |
| 3ds_status | String | 3ds status |
| 3ds_trxid | String | Unique 3ds ID |
| 3ds_version | String | 3ds version |
3DS response statuses:
| Parameter | Type | Description |
|---|---|---|
| A | String | Attempts Processing Performed; Not Authenticated/Verified, but a proof of attempted authentication/verification is provided. |
| C | String | Challenge Required; Additional authentication is required. |
| D | String | Challenge Required; Decoupled Authentication confirmed. |
| I | String | Informational Only; Merchant challenge preference acknowledged. |
| N | String | Not Authenticated /Account Not Verified; Transaction denied. |
| R | String | Authentication/ Account Verification Rejected; Issuer is rejecting authentication/verification and requests that authorisation not be attempted. |
| U | String | Authentication/Account Verification Could Not Be Performed, Technical or other problem. |
| Y | String | Authentication/Account Verification Successful. |
Example asynchronous notification:
{
"sign": "YOUR_SIGNATURE",
"data": {
"type": "payment",
"user": "YOUR_CASHIER_UID",
"order_id": "YOUR_ORDER_ID",
"trade_id": "8a8aa7c7-66d7-e2cc-e2a6-fff7c77aaefd",
"transaction_id": "4200000298201905227377147799",
"acquirer_id": "4200000298201905227377147799",
"yb_transaction_id": "c8823612-383f-35fc-f28d-c0eae039e870",
"amount": "1.00",
"tip_amount": "0.10",
"currency": "EUR",
"settlement_amount": "1.00",
"settlement_currency": "EUR",
"exchange_rate": "1",
"amount_cny": "0.77",
"settlement_rate": "7.779779",
"description": "yaband test",
"createDate": "1558510731",
"pay_method": "online",
"state": "paid",
"demo": "test",
"out_trade_no": "a4d7684a-e326-44c1-bea5-0601f7a9b191",
"sub_pay_method": "WeChat Pay",
"paid_time": "1603355159",
"3ds_status": "Y",
"3ds_trxid": "1d0c6eb3-6282-4cf9-9549-884410918d2d",
"3ds_version": "2.2.0"
}
}
2. Asynchronous refund notifications
| Parameter | Type | Description |
|---|---|---|
| sign | String | Signature |
| type | String | refund |
| user | String | UID or Email of the cashier account |
| pay_method | String | online or offline for the original payment order |
| sub_pay_method | String | Payment method of the original payment order: WeChat Pay,Alipay+, etc. (see the payment method descriptions) |
| refund_id | String | Refund number |
| m_refund_id | String | Merchant-defined refund order number specified when initiating the refund |
| transaction_id | String | Transaction number |
| acquirer_id | String | Settlement institution transaction number |
| refund_amount | String | Submitted refund amount |
| refund_currency | String | Refund currency |
| order_id | String | Merchant order number |
| refund_description | String | Order description |
| refund_time | String | Refund time |
| state | String | Refund status: to-be-approval, refund pending, refund processing, refunded, refund error, refund failed, refund cancelled |
Notification information:
{
"sign": "YOUR_SIGNATURE",
"data": {
"type": "refund",
"user": "YOUR_CASHIER_UID",
"refund_id": "b20d3668-d71f-432f-8809-f84f0d9139d4",
"m_refund_id":"20240301143029616187",
"transaction_id":"cf483d9e-637c-a92d-0716-5b8199d10f8c",
"refund_amount": "1.00",
"refund_currency": "EUR",
"order_id": "YOUR_ORDER_ID",
"refund_description": "test",
"refund_time": "0",
"state": "refunded",
"pay_method": "online",
"sub_pay_method": "WeChat Pay"}
}
Tip
- After a refund is submitted, we return the status refund processing.
- Once the refund is complete, we send a notification with the status refunded.
3. Asynchronous notification frequency
Please note: The notification response must return status-code 200 and “ok” in the body. If “ok” is not returned, we will send the notification again.
The notification frequency is as follows:
| Notification attempt | Interval |
|---|---|
| 1 | 10s |
| 2 | 30s |
| 3 | 60s |
| 4 | 300s |
| 5 | 3600s |
| ... | 3600s |
| 15 | 3600s |
If we do not receive the correct ok response, we stop sending notifications after 15 attempts.
4. Payment status descriptions in asynchronous notifications
1. Payment statuses:
| Code | Field | Description |
|---|---|---|
| 00 | paid | Payment successful |
| 01 | authorized | Authorization successful |
| 02 | pending | Payment created |
| 03 | processing | Awaiting payment |
| 04 | verify | The customer has paid, and the payment is under review for risk control reasons. |
| 05 | declined | Payment declined |
| 06 | failed | Payment failed |
| 07 | expired | Payment timed out |
| 08 | cancelled | Payment cancelled |
2. Refund statuses:
| Code | Field | Description |
|---|---|---|
| 20 | to-be-approval | Awaiting administrator approval. |
| 21 | refund pending | The current balance is insufficient. The refund is submitted automatically when sufficient funds are available. |
| 22 | refund processing | The refund request has been submitted and is being processed by the system. |
| 23 | refunded | The refund has completed successfully. |
| 24 | refund failed | The refund failed. Please try again. |
| 25 | refund error | The refund failed. Please contact our online customer support. |
| 26 | refund cancelled | The refund order has been cancelled. |
