POST /v1/payments/refund deducts funds from the merchant and returns them to the user for a successful payment. Partial or full refunds are supported, and multiple refund requests can be made against a single payment as long as the cumulative amount does not exceed the original payment value.
All monetary amounts must be provided in the smallest currency unit (IQD fils). For example, 100 IQD equals 100000.
/v1/payments/inquiryRefund if the refund status remains REFUND_IN_PROCESS after submission.cancelPayment before merchant accepts, or voidPayment after acceptance. Use refund only after order completion or void.
my.getAuthCode.authCode.authCode to the Mini Program.authCode to the merchant backend.authCode for tokens using applyToken.accessToken, refreshToken, customerId) to the merchant backend.customerId./v1/payments/pay.redirectionUrl).my.tradePay to launch the cashier.paymentNotifyUrl./v1/payments/refund.REFUND_IN_PROCESS, merchant backend polls /v1/payments/inquiryRefund.| Method | Path |
|---|---|
POST | /v1/payments/refund |
A message consists of a header and body. The following sections are focused on the body structure. For the header structure, see: OpenAPIs Overview.
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
refundRequestId | string | Yes | Merchant-generated refund ID (max 64 characters). Used for idempotence—repeat submissions with the same ID yield the same final result. | "202311271907410100070000008881xxxx" |
paymentId | string | Conditional | Wallet payment ID associated with the refund. Provide either paymentId, paymentRequestId, or captureId. | "202312061112128001001660090000xxxx" |
paymentRequestId | string | Conditional | Merchant payment ID associated with the refund. | "20230101234567890133333xxxx" |
captureId | string | Conditional | Wallet capture ID (used in capture flows). | "202311271907410100070000007777xxxx" |
refundAmount | object | Yes | Refund amount object. value must not exceed the remaining refundable amount. | { "currency": "IQD", "value": "100000" } |
refundReason | string | No | Description of why the refund is issued (max 256 characters). | "Returned goods to merchant" |
extendInfo | string | No | Additional metadata in JSON format (max 2048 characters). | "extendInfo": "additional information" |
{
"refundRequestId": "202311271907410100070000008881xxxx",
"paymentId": "202312061112128001001660090000xxxx",
"refundAmount": {
"currency": "IQD",
"value": "100000"
},
"refundReason": "Customer requested cancellation."
}
At least one of
paymentId,paymentRequestId, orcaptureIdmust be provided. If multiple are supplied, the wallet prioritizespaymentId, thenpaymentRequestId, thencaptureId.
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
result | object | Yes | Outcome metadata including resultCode, resultStatus, and resultMessage. | { "resultCode": "SUCCESS", "resultStatus": "S", "resultMessage": "Success." } |
refundId | string | Conditional | Wallet-generated refund ID. Present when resultStatus is S. | "202312061112128013001660090000xxxx" |
refundTime | string | Conditional | ISO 8601 timestamp indicating when funds were deducted from the merchant (returned when resultStatus is S). | "2023-11-27T12:01:01+08:30" |
{
"result": {
"resultCode": "SUCCESS",
"resultStatus": "S",
"resultMessage": "Success."
},
"refundId": "202312061112128013001660090000xxxx",
"refundTime": "2023-11-27T12:01:01+08:30"
}
| Status | Description |
|---|---|
S | Refund succeeded—funds deducted from merchant; await user settlement. |
U | Refund request encountered an unknown exception. Do not retry immediately; use /v1/payments/inquiryRefund to check status. |
F | Refund failed. Review resultCode and resultMessage; see Error codes. Common reasons include exceeding refund window or amount. |
| resultStatus | resultCode | resultMessage | Recommended Action |
|---|---|---|---|
U | REFUND_IN_PROCESS | Refund is under processing. | Poll /v1/payments/inquiryRefund. |
F | MULTI_REFUND_NOT_ALLOWED | Multiple refund not allowed in agreement. | Verify agreement rules; issue a single refund. |
F | REFUND_NOT_ALLOWED | Refund not allowed in agreement. | Check agreement configuration. |
F | REPEAT_REQ_INCONSISTENT | Data inconsistent with prior request. | Ensure idempotent parameters match original submission. |
F | PARTNER_STATUS_ABNORMAL | Merchant status abnormal. | Resolve merchant account issues before retrying. |
F | ORDER_NOT_EXIST | The order does not exist. | Confirm payment identifiers. |
F | ORDER_STATUS_INVALID | Order has invalid status (e.g., closed). | Verify payment lifecycle. |
F | REFUND_WINDOW_EXCEED | Exceeded allowable refund window. | Decline refund or seek manual intervention. |
F | REFUND_AMOUNT_EXCEED | Requested refund exceeds payment amount. | Adjust to remaining refundable amount. |
F | PARTNER_BALANCE_NOT_ENOUGH | Merchant balance insufficient. | Top up merchant account before retrying. |
F | CURRENCY_NOT_SUPPORT | Currency not supported. | Use supported currency (e.g., IQD). |
F | USER_NOT_EXIST | User identifier invalid. | Verify user account. |
F | USER_STATUS_ABNORMAL | User account status abnormal. | Resolve user status before retrying. |