Refund
Description
Refund a successfully paid order. Supports partial and full refunds.
Notes:
- The refund amount cannot exceed the refundable balance of the order (
refundableBalancereturned by order query) - For multiple refunds against the same order,
bizRefundNomust be unique (auto-generated if omitted) - Refund is asynchronous: after the API returns
progress, confirm the final state via async notification or Refund Sync
Endpoint
POST /unipay/refund
- Auth: RSA signature (
@PaymentVerify) - Response:
DaxResult<RefundResult>
Request Parameters
Common parameters follow Pay - Common Parameters. Business parameters:
| Parameter | Type | Required | Max Length | Description |
|---|---|---|---|---|
| tradeNo | string | no* | 100 | Original payment funds trade number (platform tradeNo) |
| bizOrderNo | string | no* | 100 | Original merchant order number |
| amount | long | yes | — | Refund amount in cents (must be > 0) |
| reason | string | no | 50 | Refund reason |
| bizRefundNo | string | no | 100 | Merchant refund number (auto-generated if omitted) |
*At least one of
tradeNo/bizOrderNois required;tradeNotakes precedence.
Request Example
json
{
"mchNo": "M200000001",
"appId": "APP001",
"reqId": "REQ20241201002",
"reqTime": "2024-12-01 12:30:00",
"nonceStr": "RANDOMSTR123",
"sign": "Base64Signature",
"bizOrderNo": "ORDER20241201001",
"amount": 100,
"bizRefundNo": "REFUND20241201001",
"reason": "Customer requested refund"
}Response Parameters
DaxResult<RefundResult>, structure of data:
| Parameter | Type | Description |
|---|---|---|
| refundNo | string | Platform refund number |
| bizRefundNo | string | Merchant refund number |
| status | string | Refund status (RefundOrderStatusEnum) |
| errorMsg | string | Error message (returned on failure) |
Response Example
json
{
"code": 0,
"msg": "success",
"data": {
"refundNo": "R2024120112345700001",
"bizRefundNo": "REFUND20241201001",
"status": "progress"
},
"sign": "Base64Signature",
"resTime": "2024-12-01 12:30:00",
"reqId": "REQ20241201002"
}Refund Status (RefundOrderStatusEnum)
| status | Description |
|---|---|
| progress | Refunding (created and submitted to channel, awaiting result) |
| success | Refund successful |
| fail | Refund failed |
| close | Refund closed (e.g. not confirmed before timeout) |
Refund Callback
After a refund succeeds, the platform sends an async notification with event=refund.success to the notifyUrl of the original payment order. See Async Callback for the message structure.