Skip to content

Refund

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

Description

Issue a refund for a successfully paid order.

Notes:

  • Supports partial and full refunds
  • Refund amount cannot exceed the order's refundable balance (refundableBalance from order query)
  • For multiple refunds on the same order, bizRefundNo must be unique (auto-generated if omitted)

Endpoints

Refund endpoints belong to the Management API (/mch/*), authenticated via Sa-Token session. Responses use Result wrapper (field name message, not msg).

vs Payment API

Payment API (/unipay/*) uses RSA signature auth and DaxResult responses; refund endpoints use Accesstoken header auth and Result responses.

Request

POST /mch/order/refund/refund

  • Auth: Sa-Token (Accesstoken header)
  • Response: Result<RefundOrderResult>

Headers

HeaderRequiredDescription
AccesstokenYesSa-Token session token
Content-TypeYesapplication/json

Parameters

RefundParam:

ParameterTypeRequiredDescription
tradeNostringNo*Original fund trade number (platform tradeNo)
bizOrderNostringNo*Merchant order number
amountlongYesRefund amount in cents (@Positive, must be > 0)
bizRefundNostringNoMerchant refund number (auto-generated if omitted)
reasonstringNoRefund reason

*At least one of tradeNo / bizOrderNo required; tradeNo preferred. If tradeNo is not found by fund number, the system falls back to looking up by gateway container orderNo.

Example

json
{
  "bizOrderNo": "ORDER20241201001",
  "amount": 100,
  "bizRefundNo": "REFUND20241201001",
  "reason": "Customer requested refund"
}

Response

Result<RefundOrderResult>, data fields (main fields; full 27 fields in source RefundOrderResult):

FieldTypeDescription
idlongRefund order ID
mchNostringMerchant number
mchNamestringMerchant name (translated)
appIdstringApplication ID
refundNostringSystem refund number
bizRefundNostringMerchant refund number
relationOrderNostringActual relation number sent to channel
titlestringTitle
tradeNostringOriginal fund trade number
tradeTypestringOriginal trade type
bizOrderNostringOriginal merchant order number
outOrderNostringChannel payment order number
outRefundNostringChannel refund流水 number
amountlongRefund amount (cents)
orderAmountlongOriginal order total amount (cents)
currencystringCurrency
reasonstringRefund reason
statusstringRefund status (RefundOrderStatusEnum)
finishTimestringRefund completion time (UTC)
channelstringPayment channel
productstringPayment product
channelMchNostringChannel merchant number
channelAppIdstringChannel App ID
notifyUrlstringAsync notification URL
attachstringMerchant custom data
clientIpstringClient IP
storeNostringStore number
errorMsgstringError message (on failure)

Refund Status (RefundOrderStatusEnum)

statusDescription
progressRefund processing (created and channel invoked, awaiting result)
successRefund successful
failRefund failed
closeRefund closed (timeout, etc.)

Example

json
{
  "code": 0,
  "message": "success",
  "data": {
    "id": "1853123456789012345",
    "refundNo": "R2024120112345700001",
    "bizRefundNo": "REFUND20241201001",
    "bizOrderNo": "ORDER20241201001",
    "tradeNo": "T2024120112345700001",
    "amount": 100,
    "orderAmount": 100,
    "status": "progress",
    "reason": "Customer requested refund"
  }
}

Refund Callback

After a successful refund, the platform sends an async notification with event=refund.success to the original payment order's notifyUrl. See Async Callback.

Released under the GNU LGPL v3.0