Close / Cancel Order
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:
| Parameter | Type | Required | Max | Description |
|---|---|---|---|---|
| orderNo | string | No* | 100 | Platform order number |
| bizOrderNo | string | No* | 100 | Merchant order number |
| useCancel | boolean | No | — | Use cancel mode (channel-dependent, default false) |
*At least one of
orderNo/bizOrderNorequired. 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
| Channel | Close | Cancel |
|---|---|---|
| Alipay | ✓ | ✓ |
| WeChat Pay | ✓ | ✗ (V3 close only) |
| UnionPay | ✓ | ✓ |
| Lakala | ✓ | per 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.