Skip to content

Allocation Finish ​

Updated: 11/28/26, 2:33:55 PM

Description ​

Finish an allocation order and unfreeze the remaining frozen funds to the merchant itself. Use it when:

  • Allocated but not finished (allocated): after all receivers of a multiple allocation (finishMode=manual) are settled, call this endpoint to unfreeze the remaining funds;
  • Pending allocation (none): the funds were frozen at order creation but no allocation has been made yet; the order can also be finished directly to unfreeze funds that do not need to be split.

Single allocations (finishMode=auto, allocation completes immediately) are unfrozen automatically upon success and do not need this call.

On the platform, a finish request is stored as an allocType=finish order (no receiver details, amount 0) and shares the allocation order table, sync, and notification pipeline.

Product and channel limits

Allocation is supported only by WeChat / Alipay / Douyin direct products (the mock channel is for integration testing only). Service-provider products (wechat_isv / alipay_isv) and other third-party channels do not support allocation or finish. Finishing also requires the channel to support standalone finish, which all allocation-capable channels currently do.

Request ​

POST /unipay/alloc-finish

  • Auth: RSA signature (@PaymentVerify)
  • Response: DaxResult<AllocResult>

Parameters ​

Common params same as Pay - Common Parameters. Business parameters:

ParameterTypeRequiredMaxDescription
bizAllocNostringYes100Merchant allocation number (idempotency key, unique per app, sharing the same dimension as allocation orders, not reusable)
tradeNostringNo*100Original payment fund trade number
bizOrderNostringNo*100Original payment merchant business order number
descriptionstringNo500Finish description
attachstringNo500Merchant custom data (returned as-is in callback)
notifyUrlstringNo200Async notification URL

*At least one of tradeNo / bizOrderNo required. Priority: tradeNo > bizOrderNo

Idempotency and Numbers ​

  • bizAllocNo is the idempotency key and shares the same dimension as allocation orders: a number already used for an allocation or a finish under the same app cannot be used again, and a duplicate submission is rejected outright (the existing order is not returned).
  • Always use a new bizAllocNo for the finish; do not reuse a previous allocation's merchant number.
  • An original payment order can have at most one successful finish order; after it succeeds, no further allocation is allowed.

Example ​

json
{
  "mchNo": "M200000001",
  "appId": "APP001",
  "reqId": "REQ20241201032",
  "reqTime": "2024-12-01 13:00:00",
  "sign": "Base64Signature",
  "bizAllocNo": "ALOC20241201002",
  "tradeNo": "T2024120112345700001",
  "description": "Allocation Finish",
  "notifyUrl": "https://your-domain.com/notify"
}

Response ​

DaxResult<AllocResult>; the data structure is the same as the Allocate Response:

FieldTypeDescription
allocNostringPlatform allocation finish number
bizAllocNostringMerchant allocation number
statusstringAllocation status (AllocOrderStatusEnum); the terminal result is subject to the async notification or allocation sync
errorMsgstringError message (returned on failure)

On acceptance it returns allocNo and bizAllocNo; the terminal result is obtained via async notification (events alloc.success / alloc.fail) or Allocation Sync.

Example ​

json
{
  "code": 0,
  "msg": "success",
  "data": {
    "allocNo": "A2024120113000000001",
    "bizAllocNo": "ALOC20241201002"
  },
  "sign": "Base64Signature",
  "resTime": "2024-12-01 13:00:00",
  "reqId": "REQ20241201032"
}

Usage Tips ​

  • When to call: in multiple-allocation mode, the last allocation may pass finishMode=auto to finish with the allocation, or all allocations may use manual and this endpoint is called once at the end; a pending order can be finished directly.
  • Only specific states can finish: the original payment must be successful and its allocation status must be none (pending) or allocated (allocated but not finished); processing (in flight), finished / done (already finished), unsupported (product unsupported and downgraded), and non-allocation orders are rejected.
  • No allocation after finish: a successful finish unfreezes the remaining funds and moves the original payment to the finished terminal state.
  • Back-office entry: the allocation order list offers a "Finish Allocation" action for finishMode=manual allocation orders (see Allocation); single allocations do not show the entry.
  • Async notification: the platform notifies via notifyUrl once the terminal state is known (events alloc.success / alloc.fail); you may also call Allocation Sync to pull the channel status actively.