Skip to main content
WEBHOOK

Overview

This page documents asynchronous order-status notifications for reward distribution, corresponding to webhook batchTransferWebhook. Based on the current implementation, this notification is sent by the batch processing task after all sub-orders succeed:
  • Call site: BatchTransferProcessTask (line 187)
  • Send method: BatchNotifyService.batchNotify(...)
The notification uses the standard notification envelope:
  • bizType is always PAY_BATCH
  • bizId is the batch order ID (batchTransferModel.getBatchId())
  • bizStatus is the batch order status (on this send path it is PAID)
  • data is a JSON string from JSON.toJSONString(batchOrderNotify)

Notes

Trigger scenarios

In the current code, reward-distribution notifications are sent only when the entire batch succeeds:
  • BatchTransferProcessTask first checks batch processing status
  • When the status is BatchTransferProcessStatusEnum.AllPaid
  • It calls batchNotifyService.batchNotify(batchTransferModel.getMerchantBatchNo(), batchTransferModel, batchTransferProcessStatus.getTransferOrderModels())
Therefore, bizStatus and each sub-order status in examples on this path should match the success scenario.

Message structure

Example message

data fields

After parsing data, the object fields are:

batchItemList item fields

Code mapping

The payload is built by BatchNotifyService.batchNotify(...):
  • Top-level notification fields:
    • bizType = BizTypeEnum.PAY_BATCH.getType()
    • bizId = batchTransferModel.getBatchId()
    • bizStatus = batchTransferModel.getStatus()
    • data = JSON.toJSONString(batchOrderNotify)
  • Inner batchOrderNotify fields in data:
    • currency
    • merchant_batch_no
    • batchItemList
  • batchItemList item fields:
    • receiver_id
    • amount
    • currency
    • status
    • reward_id
    • create_time
    • channel_id

Callback example

Reward distribution batch success

Integration tips

  1. Verify the signature before parsing the body.
  2. Deserialize data as JSON, then read merchant_batch_no and batchItemList.
  3. Identify the batch with merchant_batch_no and each reward with reward_id.
  4. Treat each item’s status as the actual payout result.
  5. After successful handling, return HTTP 200 with the standard success body:

Body

application/json
bizType
enum<string>
required

Business type; always PAY_BATCH.

Available options:
PAY_BATCH
bizId
string
required

Batch order ID.

bizStatus
enum<string>
required

Batch order status; commonly PAID when transfer/reward completes.

Available options:
PAID
data
string
required

Business data as a JSON string; parsed structure see batchTransferData.

client_id
string

Merchant client_id that created the order.

batchTransferData
object

Parsed batch transfer details from data.

description
any

Response

200 - application/json

HTTP 200 indicates the merchant successfully received the notification.

Response body returned by the merchant after receiving the notification.

returnCode
string
required

Return status code; SUCCESS indicates success.

returnMessage
string | null

Return message; may be empty on success.