Skip to content

Close / Cancel Order

Updated: 7/26/26, 9:23:52 PM

Description

Close an order. Only orders in wait or progress status can be closed.

Some channels support cancel mode (e.g., same-day reversal on WeChat or UnionPay), triggered via useCancel=true. Unsupported channels silently ignore this flag and fall back to close.

Close vs Cancel

  • Close: terminates an unpaid order; no funds movement; idempotent.
  • Cancel: targets same-day authorized-but-unsettled transactions; triggers channel reversal (e.g., UnionPay same-day cancel); funds return to buyer.

Request

POST /unipay/close

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

Parameters

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

ParameterTypeRequiredMaxDescription
orderNostringNo*100Platform order number
bizOrderNostringNo*100Merchant order number
useCancelbooleanNoUse cancel mode (channel-dependent, default false)

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

Example

json
{
  "mchNo": "M200000001",
  "appId": "APP001",
  "reqId": "REQ20241201002",
  "reqTime": "2024-12-01 12:05:00",
  "sign": "Base64Signature",
  "orderNo": "P2024120112345700001",
  "useCancel": false
}

Response

DaxResult<Void>, data is null.

Example

json
{
  "code": 0,
  "msg": "success",
  "data": null,
  "sign": "Base64Signature",
  "resTime": "2024-12-01T04:05:00Z",
  "reqId": "REQ20241201002"
}

Channel Support for Cancel

ChannelCloseCancel
Alipay
WeChat Pay✗ (V3 close only)
UnionPay
Lakalaper contract
Fuyou
Shande

useCancel is silently ignored

When the channel doesn't support cancel, useCancel=true is silently ignored and the request is processed as close — no error is returned. Verify channel support against the table above for production integration.

Released under the GNU LGPL v3.0