Skip to main content
WEBHOOK
callbackWebhook
{
  "main_order": {
    "batch_id": "1526052914503263472",
    "merchant_id": 48177363,
    "status": "SUCCESS",
    "client_id": "DlaHYwkeGDjSGRVr",
    "pay_back_status": "NO",
    "channel_id": ""
  },
  "suborders": [
    {
      "fee": "0.0499",
      "desc": "",
      "chain": "BASEEVM",
      "tx_id": "0x2546829d95b7614acebde9dcc92d5b880ae82fa9791c2f80faa7ca668fc5cd3b",
      "amount": "0.1",
      "status": "DONE",
      "address": "0x524287c1e5a312a12c76380a3227611d3cb20ddf",
      "currency": "USDC",
      "fee_type": 0,
      "channel_id": "",
      "sub_amount": "0.1",
      "done_amount": "0.0501",
      "finish_time": 1780037579000,
      "merchant_id": 48177363,
      "suborder_id": "79553574716833917",
      "from_address": "0x0D0707963952f2fBA59dD06f2b425ace40b492Fe",
      "batch_withdraw_id": "1526052914503263472",
      "merchant_withdraw_id": "1526052914503263472",
      "reconciliation_status": 0
    }
  ]
}
{
  "returnCode": "SUCCESS",
  "returnMessage": ""
}

Overview

This page documents webhook callbackWebhook. The full schema, parameters, and examples are rendered from the linked OpenAPI or webhook definition above. When batch withdrawal/payout status changes, GatePay notifies your callback URL using the dedicated WITHDRAW payload (no data field).

Notes

Trigger Scenarios

  • When a batch withdrawal/payout order status changes (all succeeded, all failed, or partially succeeded), GatePay sends a notification to the callback URL configured at merchant registration
  • If delivery fails, see retry rules in Notifications Overview.
Scope: Batch and sub-order withdrawal/payout status changes, corresponding to bizType=WITHDRAW in the general callback taxonomy. For integration guidance, see Payout.

bizType Reference

In the Notifications Overview bizType enumeration, withdrawal notifications use WITHDRAW to indicate withdrawal/payout status changes. Unlike payment or refund callbacks that use the standard envelope (bizType, bizId, bizStatus, client_id, data), WITHDRAW callbacks use a dedicated payload: the request body contains main_order (batch header) and suborders (line items) directly, with batch status in main_order.status.

bizStatus Values

Terminal notification semantics align with the bizStatus values below. Batch progress is also reflected in main_order.status (including intermediate values such as INIT and PROCESSING).
ValueDescription
WITHDRAW_SUCCESSEntire batch succeeded; all sub-orders reached a terminal state (maps to main_order.status=SUCCESS)
WITHDRAW_PARTIALBatch partially succeeded; some sub-orders succeeded and some failed (maps to main_order.status=PARTIAL)
WITHDRAW_FAILEntire batch failed (maps to main_order.status=FAIL)

Message Structure

FieldTypeDescription
main_orderobjectBatch header; see table below
subordersarraySub-order list; see table below

Example Message

{
  "main_order": {
    "batch_id": "831618381568",
    "merchant_id": 17329983,
    "status": "SUCCESS",
    "client_id": "igasgasdbub",
    "pay_back_status": "NO",
    "channel_id": ""
  },
  "suborders": [
    {
      "suborder_id": "30969031299072",
      "status": "DONE",
      "merchant_withdraw_id": "1839295815",
      "currency": "USDT",
      "amount": 2362.1
    }
  ]
}

Batch Status (main_order.status)

ValueTerminalDescription
INITNoBatch created; initial validation in progress
PROCESSINGNoBatch processing; funds in transit
PARTIALYesSome sub-orders succeeded, some failed
FAILYesEntire batch failed
SUCCESSYesEntire batch succeeded; all sub-orders completed
Typical callback sequence: INITPROCESSING → terminal state (SUCCESS / PARTIAL / FAIL).

main_order Field Reference

FieldTypeDescription
batch_idstringBatch ID
merchant_idint64Merchant ID
statusstringBatch status; see table above
client_idstringclient_id used when creating the batch
pay_back_statusstringRollback status
channel_idstringCustomer name / channel identifier

suborders Item Fields

FieldTypeDescription
suborder_idstringSub-order ID
merchant_idint64Merchant ID
channel_idstringCustomer name / channel identifier
chainstringBlockchain network
from_addressstringSender on-chain address
addressstringRecipient address
currencystringCurrency
amountnumberTransfer amount
feenumberFee
tx_idstringTransaction hash
memostringMemo
statusstringSub-order status: DONE (success) or FAIL (failure)
merchant_withdraw_idstringMerchant withdrawal ID; recommended idempotency key
fee_typeintFee type: 0 internal deduction, 1 external deduction
batch_withdraw_idstringBatch withdrawal ID
descstringDescription
reconciliation_statusintReconciliation status
is_placedintSubmission flag: 0 not submitted, 1 submitted
finish_timeint64Completion time (milliseconds)
sub_amountnumberTotal sub-order amount
done_amountnumberActually completed amount
Use batch_id + merchant_withdraw_id as the idempotency key to avoid duplicate updates. If no callback is received for an extended period, poll via Withdrawal query.

Callback Example

Batch withdrawal fully succeeded (main_order.status=SUCCESS)

{
  "main_order": {
    "batch_id": "1526052914503263472",
    "merchant_id": 48177363,
    "status": "SUCCESS",
    "client_id": "DlaHYwkeGDjSGRVr",
    "pay_back_status": "NO",
    "channel_id": ""
  },
  "suborders": [
    {
      "fee": "0.0499",
      "desc": "",
      "chain": "BASEEVM",
      "tx_id": "0x2546829d95b7614acebde9dcc92d5b880ae82fa9791c2f80faa7ca668fc5cd3b",
      "amount": "0.1",
      "status": "DONE",
      "address": "0x524287c1e5a312a12c76380a3227611d3cb20ddf",
      "currency": "USDC",
      "fee_type": 0,
      "channel_id": "",
      "sub_amount": "0.1",
      "done_amount": "0.0501",
      "finish_time": 1780037579000,
      "merchant_id": 48177363,
      "suborder_id": "79553574716833917",
      "from_address": "0x0D0707963952f2fBA59dD06f2b425ace40b492Fe",
      "batch_withdraw_id": "1526052914503263472",
      "merchant_withdraw_id": "1526052914503263472",
      "reconciliation_status": 0
    }
  ]
}

Partial success (main_order.status=PARTIAL)

{
  "main_order": {
    "batch_id": "1526052914503263472",
    "merchant_id": 48177363,
    "status": "PARTIAL",
    "client_id": "DlaHYwkeGDjSGRVr",
    "pay_back_status": "NO",
    "channel_id": ""
  },
  "suborders": [
    {
      "fee": "0.0499",
      "desc": "",
      "chain": "BASEEVM",
      "tx_id": "0x2546829d95b7614acebde9dcc92d5b880ae82fa9791c2f80faa7ca668fc5cd3b",
      "amount": "0.1",
      "status": "DONE",
      "address": "0x524287c1e5a312a12c76380a3227611d3cb20ddf",
      "currency": "USDC",
      "fee_type": 0,
      "channel_id": "",
      "sub_amount": "0.1",
      "done_amount": "0.0501",
      "finish_time": 1780037579000,
      "merchant_id": 48177363,
      "suborder_id": "79553574716833917",
      "from_address": "0x0D0707963952f2fBA59dD06f2b425ace40b492Fe",
      "batch_withdraw_id": "1526052914503263472",
      "merchant_withdraw_id": "1526052914503263472",
      "reconciliation_status": 0
    },
    {
      "fee": "0.0499",
      "desc": "",
      "chain": "BASEEVM",
      "tx_id": "",
      "amount": "0.1",
      "status": "FAIL",
      "address": "0x524287c1e5a312a12c76380a3227611d3cb20ddf",
      "currency": "USDC",
      "fee_type": 0,
      "channel_id": "",
      "sub_amount": "0.1",
      "done_amount": "0.0501",
      "finish_time": 1780037579000,
      "merchant_id": 48177363,
      "suborder_id": "79553574716833918",
      "from_address": "0x0D0707963952f2fBA59dD06f2b425ace40b492Fe",
      "batch_withdraw_id": "1526052914503263472",
      "merchant_withdraw_id": "1526052914503263473",
      "reconciliation_status": 0
    }
  ]
}

All failed (main_order.status=FAIL)

{
  "main_order": {
    "batch_id": "1526052914503263472",
    "merchant_id": 48177363,
    "status": "FAIL",
    "client_id": "DlaHYwkeGDjSGRVr",
    "pay_back_status": "NO",
    "channel_id": ""
  },
  "suborders": [
    {
      "fee": "0.0499",
      "desc": "",
      "chain": "BASEEVM",
      "tx_id": "",
      "amount": "0.1",
      "status": "FAIL",
      "address": "0x524287c1e5a312a12c76380a3227611d3cb20ddf",
      "currency": "USDC",
      "fee_type": 0,
      "channel_id": "",
      "sub_amount": "0.1",
      "done_amount": "0.0501",
      "finish_time": 1780037579000,
      "merchant_id": 48177363,
      "suborder_id": "79553574716833917",
      "from_address": "0x0D0707963952f2fBA59dD06f2b425ace40b492Fe",
      "batch_withdraw_id": "1526052914503263472",
      "merchant_withdraw_id": "1526052914503263472",
      "reconciliation_status": 0
    }
  ]
}

Body

application/json

Data structure for GatePay callback to merchant when withdrawal order status changes, including main order object and suborder array.

main_order
object
required

Main withdrawal order information in callback notification.

suborders
object[]
required

Suborder callback details array.

Response

200 - application/json

Returns HTTP 200 to indicate the notification has been received successfully.

Response body returned by the merchant after receiving the notification.

returnCode
string
required

Return status code; SUCCESS indicates successful processing.

returnMessage
string | null

Return message; may be empty on success.