Processing Requirements
For every callback received, you must:- Verify the signature first — See Authentication and Security for signature verification details
- Parse the business data and perform idempotent processing
- Return the agreed success response
Trigger and Retry Mechanism
Trigger When the order status changes (payment success, timeout, cancellation, closure, or exception), GatePay sends a notification to your configured callback URL. Retry If you do not return the agreed success response or the request times out, GatePay will retry the callback. Signature Verification You must verify all callback signatures before processing. See Authentication and Security for details.Callback Message Structure
All callbacks contain the following top-level fields:| Field | Type | Description |
|---|---|---|
| bizType | string | Notification category (see bizType Enumeration) |
| bizId | string | Order ID or business ID |
| bizStatus | string | Business status (varies by bizType) |
| client_id | string | Merchant client_id |
| data | string | Business payload as a JSON string; structure varies by bizType |
Callback Acknowledgement Response
Return the following JSON response with HTTP 200:bizType Enumeration
| Value | Description |
|---|---|
| PAY | Status change for non-address payment orders |
| PAY_REFUND | Status change for refund orders |
| PAY_BATCH | Status change for batch reward orders |
| PAY_GIFT_BATCH | Status change for batch gift-card payments |
| PAY_ADDRESS | Status change for address payment orders |
| TRANSFER_ADDRESS | Funds-flow notification for address payments |
| PAY_FIXED_ADDRESS | Static-address collection notification |
| WITHDRAW | Withdrawal / payout status change |
| INSTITUTION | Institution API account-related notification |
Hosted Checkout Payment Notification
Hosted checkout payments follow the generalPAY callback model. For non-address payments, interpret the payment amount using orderAmount. For more details on payment integrations, see Payments.
Address Payment Notifications
PAY_ADDRESS Status Enumeration
| Status | Applicable Mode | Description |
|---|---|---|
| PAY_SUCCESS | Non-convert / Convert | Payment succeeded |
| PAY_ERROR | Non-convert / Convert | Payment failed |
| PAY_CLOSE | Non-convert / Convert | Order closed |
| PAY_EXPIRED_IN_PROCESS | Non-convert / Convert | Target amount reached within validity period, but still unconfirmed on-chain records |
| PENDING | Convert | Pending |
| PROCESS | Convert | Processing |
| PAID | Convert | Paid |
| EXPIRED | Convert | Expired |
PAY_ADDRESS data Fields
| Field | Applicable Mode | Description |
|---|---|---|
| merchantTradeNo | Non-convert / Convert | Merchant order number |
| productType | Non-convert / Convert | Product type |
| productName | Non-convert / Convert | Product name |
| goodsName | Non-convert / Convert | Goods name |
| tradeType | Non-convert / Convert | Transaction type |
| terminalType | Non-convert / Convert | Terminal type |
| currency | Non-convert / Convert | Pricing currency |
| orderAmount | Non-convert / Convert | Order amount |
| payerId | Non-convert / Convert | Payer identifier |
| createTime | Non-convert / Convert | Creation time |
| transactionId | Non-convert / Convert | Platform transaction ID |
| waitAmountOnChain | Non-convert / Convert | On-chain amount detected but not yet finally credited |
| doneAmountOnChain | Non-convert / Convert | On-chain amount already confirmed and credited |
| channelId | Non-convert / Convert | Channel identifier |
| chain | Non-convert / Convert | Chain name |
| address | Non-convert / Convert | Collection address |
| fromAddress | Non-convert / Convert | Payer address |
| payCurrency | Convert | Payment currency used for conversion |
| payAmount | Convert | Payment amount used for conversion |
| rate | Convert | Exchange rate |
| overPay | Convert | Overpayment amount |
TRANSFER_ADDRESS Status Enumeration
| Status | Description |
|---|---|
| TRANSFERRED_ADDRESS_IN_TERM | Credited within the validity period |
| TRANSFERRED_ADDRESS_DELAY | Credited after the validity period |
| CONVERT_ADDRESS_PAY_DELAY | Convert delayed-payment notification only; no credit |
| TRANSFERRED_ADDRESS_BLOCK | Risk-controlled funds; not credited |
TRANSFER_ADDRESS data Fields
| Field | Description |
|---|---|
| merchantTradeNo | Merchant order number |
| currency | Currency |
| orderAmount | Order amount |
| createTime | Creation time |
| transactionId | Platform transaction ID |
| transferAmount | On-chain transfer amount |
| txHash | Blockchain transaction hash |
| chain | Chain name |
| address | Address |
| channelId | Channel identifier |
Static Address Collection Notification
bizType:PAY_FIXED_ADDRESS
bizStatus: PAY_SUCCESS (credit succeeded) or PAY_BLOCK (risk funds, not credited)
data Fields
| Field | Type | Required | Description |
|---|---|---|---|
| channelId | string | Yes | Channel identifier |
| currency | string | Yes | Currency |
| orderAmount | string | No | Order amount |
| amount | string | Yes | Actual credited amount |
| createTime | number | Yes | Creation time (milliseconds) |
| transactionId | string | Yes | Platform transaction ID |
| transactionTime | number | Yes | Transaction time (milliseconds) |
| chain | string | Yes | Chain name |
| address | string | Yes | Collection address |
Withdrawal / Payout Callbacks
For withdrawal and payout operations, see Payouts for detailed callback structures and field descriptions. bizType:WITHDRAW
Main Order Fields
| Field | Required | Description |
|---|---|---|
| batch_id | Yes | Batch ID |
| merchant_id | Yes | Merchant ID |
| status | Yes | INIT / PROCESSING / PARTIAL / FAIL / SUCCESS |
| client_id | Yes | client_id used to create the batch |
| pay_back_status | Yes | Rollback status |
| channel_id | Yes | Channel identifier |
Sub-order Fields
| Field | Required | Description |
|---|---|---|
| suborder_id | Yes | Sub-order ID |
| chain | Yes | Chain |
| address | Yes | Address |
| currency | Yes | Currency |
| amount | Yes | Amount |
| fee | Yes | Fee |
| txHash | Yes | Transaction hash |
| status | Yes | DONE / FAIL |
| merchant_withdraw_id | Yes | Merchant withdrawal ID |
| fee_type | Yes | 0=internal deduction; 1=external deduction |
| finish_time | Yes | Completion time |
| sub_amount | Yes | Total sub-order amount |
| done_amount | Yes | Actually completed amount |
Institution API Callbacks
bizType:INSTITUTION
bizStatus: INSTITUTION_ACCOUNT_SUCCESS or INSTITUTION_ACCOUNT_FAIL
For institution account-related notifications, see Institutional API.
data Fields (JSON string)
| Field | Description |
|---|---|
| request_id | Request identifier |
| account_id | Account ID |
| customer_id | Customer ID |
| display_name | Account display name |
| status | ACTIVE or FAIL |
| created | Timestamp in milliseconds |
Callback Integration Guide
Integration Requirements
| Item | Recommendation |
|---|---|
| Endpoint | Use a dedicated path such as /webhook/gatepay |
| Protocol | HTTPS with TLS 1.2+ |
| Processing Strategy | Verify signature → store idempotently → process business asynchronously → return SUCCESS |
| Signature Verification | Never return SUCCESS if signature verification fails |
| data Parsing | The data field is a JSON string and requires secondary parsing |
| Duplicate Handling | Support duplicate notifications using idempotent processing |
Recommended Processing Flow
- Receive the callback request
- Verify the signature using the merchant secret key (see Authentication and Security)
- Extract and parse the
datafield (JSON string → object) - Check idempotency key (e.g., transactionId or merchantTradeNo)
- Store the notification durably before processing
- Process the business logic asynchronously
- Return
{"returnCode": "SUCCESS", "returnMessage": ""}with HTTP 200
Related Documentation
- Authentication and Security — Signature verification and security practices
- Payments — Payment callback details
- Payouts — Payout callback details
- Institutional API — Institution callback details

