Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.gate.com/llms.txt

Use this file to discover all available pages before exploring further.

Overview

When order status changes, GatePay sends an asynchronous notification to the merchant callback URL. Typical events include payment success, timeout, and order cancellation. For the current-version callback guide with business-specific breakdowns, refer first to Notification. This page is retained as the API Reference notification overview.

Retry mechanism

GatePay retries failed notifications at: 15s, 30s, 3min, 10min, 20min, 30min, 60min, 3hr, 6hr.

Signature verification

You must verify the signature for every callback you receive.

Message structure

FieldDescription
bizTypeBusiness type
bizIdBusiness ID
bizStatusBusiness status
client_idApplication ClientId
dataBusiness data in JSON format

Message JSON example

{
  "bizType": "PAY",
  "bizId": "order_123456",
  "bizStatus": "PAY_SUCCESS",
  "client_id": "your_client_id",
  "data": "{...}"
}

bizType enum

bizTypeDescription
PAYPayment
PAY_REFUNDPayment refund
PAY_BATCHBatch payment
TRANSFER_ADDRESSAddress transfer
PAY_GIFT_BATCHGift batch payment
WITHDRAWWithdrawal
PAY_ADDRESSAddress payment
PAY_FIXED_ADDRESSFixed address payment

bizStatus enum

bizStatusDescription
PAY_SUCCESSPayment successful
PAY_ERRORPayment failed
PAY_CLOSEPayment closed
PAY_BLOCKPayment blocked
REFUND_SUCCESSRefund successful
REFUND_PROCESSRefund in process
REFUND_REJECTEDRefund rejected
PAY_EXPIRED_IN_PROCESSPayment expired while processing
TRANSFERRED_ADDRESS_IN_TERMAddress transferred within term
TRANSFERRED_ADDRESS_DELAYAddress transfer delayed
CONVERT_ADDRESS_PAY_DELAYConverted address payment delayed
TRANSFERRED_ADDRESS_BLOCKAddress transfer blocked
PAIDPaid

Data structure by bizType

PAY and TRANSFER_ADDRESS fields

FieldTypeDescription
merchantTradeNostringMerchant order number
orderIdstringGatePay order ID
amountstringPayment amount
currencystringCurrency type
statusstringOrder status
payTimestringPayment completion time
remarkstringRemark

refundInfo type

FieldTypeDescription
refundIdstringRefund ID
refundRequestIdstringMerchant refund request ID
refundAmountstringRefund amount
refundCurrencystringRefund currency
refundStatusstringRefund status
refundTimestringRefund completion time

batchItemList type

FieldTypeDescription
itemIdstringItem ID
amountstringAmount
currencystringCurrency
statusstringItem status

Callback JSON examples

PAY callback (payment success)

{
  "bizType": "PAY",
  "bizId": "pay_order_001",
  "bizStatus": "PAY_SUCCESS",
  "client_id": "client_123",
  "data": "{\"merchantTradeNo\":\"M001\",\"orderId\":\"G001\",\"amount\":\"100.00\",\"currency\":\"USDT\",\"status\":\"PAID\",\"payTime\":\"1673613945000\"}"
}

PAY_REFUND callback (refund success)

{
  "bizType": "PAY_REFUND",
  "bizId": "refund_001",
  "bizStatus": "REFUND_SUCCESS",
  "client_id": "client_123",
  "data": "{\"merchantTradeNo\":\"M001\",\"refundId\":\"R001\",\"refundRequestId\":\"RR001\",\"refundAmount\":\"50.00\",\"refundStatus\":\"SUCCESS\",\"refundTime\":\"1673614000000\"}"
}

TRANSFER_ADDRESS callback

{
  "bizType": "TRANSFER_ADDRESS",
  "bizId": "transfer_001",
  "bizStatus": "TRANSFERRED_ADDRESS_IN_TERM",
  "client_id": "client_123",
  "data": "{\"merchantTradeNo\":\"M002\",\"orderId\":\"T001\",\"amount\":\"200.00\",\"currency\":\"USDT\",\"status\":\"TRANSFERRED\"}"
}

OTC-specific callback notes

For this OTC document set, callback notifications may include OTC business payloads routed through the merchant callback URL. Common OTC callback states include:
bizStatusDescription
RECHARGE_SUCCESSOTC on-ramp succeeded
RECHARGE_FAILOTC on-ramp failed
WITHDRAW_DISPATCHEDOTC off-ramp payout has been dispatched
WITHDRAW_SUCCESSOTC off-ramp completed successfully
WITHDRAW_FAILOTC off-ramp failed
Typical OTC callback body:
{
  "bizType": "OTC",
  "bizId": "2016768770965639168",
  "bizStatus": "WITHDRAW_DISPATCHED",
  "clientId": "merchant_client_id",
  "data": "{\"orderId\":\"2016768770965639168\",\"clientOrderId\":\"7490324045\",\"type\":\"SELL\",\"fiatCurrency\":\"USD\",\"fiatAmount\":\"9800\",\"cryptoCurrency\":\"USDT\",\"cryptoAmount\":\"10000\"}"
}