Skip to main content
  • Last Updated: 2022-02-23 21:31:02
The notification system sends transaction result messages to merchants via asynchronous callback notifications.
Notes:
• The same notification may be sent to the merchant system multiple times. The merchant system must handle duplicate notifications correctly.
• The recommended approach is to check the status of the corresponding business data when a notification is received, and determine whether it has already been processed.
• If not yet processed, proceed with processing; if already processed, return a success response directly.
• Before checking and processing business data status, use a data lock for concurrency control to avoid data inconsistency caused by function re-entry.
• If no callback is received after all notification retries, the merchant should call the order query API to confirm the order status.

Important:
The merchant system must perform signature verification on all payment result notifications, and verify that the notification data matches the merchant's own records. This prevents "fake notifications" caused by data leakage and protects against financial loss.

API Description

Request method: POST Callback URL: Set via the notifyUrl parameter in the order creation request. Must be an HTTPS address. Ensure the callback URL is publicly accessible and does not contain query string parameters, otherwise the merchant may not receive callback notifications. Example: "https://pay.example.com/notify"

Notification Rules

After the user completes payment, the payment result and user information are sent to the merchant. The merchant must receive, process, and respond to the message. If the system receives a non-compliant response or no response within the timeout, the notification is considered failed. The system will retry notifications periodically to maximize delivery success, but cannot guarantee final delivery. (Retry intervals: 1m, 4m, 10m, 15m, 60m, 60m, 60m — total 3 hours 30 minutes)

Notification Message

Payment result notifications are sent via POST to the merchant’s configured callback URL. Data is transmitted in JSON format in the request body.

Callback Description

Callback messages are used to receive notifications for transaction events such as payments and transfers.

Callback Message Format

  • All callback messages use HTTP POST with Content-Type: application/json.
  • Callback messages include a signature. The service provider must verify the signature of the request. Refer to the Asynchronous Notification Signature Verification documentation for details.

Notification Response

Notes:
  1. When the merchant backend responds, the payment system records the response. Regardless of the transaction outcome, always respond in the following format upon successfully receiving a notification:
{
    "code": "00000000",
    "message": "Success"
}
  1. If the merchant fails to receive the notification due to signature verification failure or other reasons, respond in the following format. If the system does not receive a 00000000 response, it will keep retrying at the configured intervals until the maximum retry count is reached.
{
    "code": "99999999",
    "message": "Failed"
}

Notification Message Format

{"data":{"completeTime":"20220810135013","currency":"HKD","merchantId":"1001000000002514","merchantOrderId":"20220810134800","orderAmount":"3.01","orderId":"1557242720127553536","payMethod":"ALIPAY_CN","status":"SUCCESS"},"code":"00000000","message":"Success","isSuccess":true,"status":"SUCCESS","traceId":"0933def246872b6d"}

WeChat Notification Message Format

{"data":{"bankType":"WPCN","completeTime":"20240320150059","currency":"CNY","merchantId":"2022000000008454","merchantOrderId":"20240320150006","orderAmount":"1341.60","orderId":"4584348502244357","payMethod":"WEIXIN","status":"SUCCESS"},"code":"00000000","message":"Success","isSuccess":true,"status":"SUCCESS","traceId":"3e0485700f2a0cb9"}

Request Header Format

Signature in header

 Content-Type: application/json; charset=utf-8

 signature: Xgvlc3we9HBWuJv/FJd1ysXB7rZWk/wEMxQKzyA4MqInfhxBn0ALpHnagXkEfwtKvCZ+QWbZTJ9Nyi0WAEagTo0GjwQnY0sJO5fF8bGhNvpKTES+Ljd5iirudH8zyPj8u0F25J3ifo8NHLOGzyoTXtLwkOpq6Ul0tgXwJvKUlKE=