# refund

`POST /aps/api/v1/payments/refund`

The Acquiring Partner (ACQP) uses the **refund** API to initiate a refund of a successful payment. 

The refund can be full or partial. A transaction can have multiple refunds as long as the total refund amount is less than or equal to the original transaction amount. 

If being out of the refund window, the refund request will be declined. The refund window is usually within one calendar year. 

Use the same _refundRequestId_ parameter to retry a refund in case of timeout or when the returned _resultStatus_ is U. The _refundRequestId_ parameter is designed to be idempotent. 

**Note:** In the following sections, Mobile Payment Provider (MPP) is also known as PSP. For example, _pspId_ refers to the ID that identifies an MPP.

Structure

A message consists of a header and body. The following sections are focused on the body structure. For the header structure, see:

-   [Request header](api_overview.md#3mLq0)
-   [Response header](api_overview.md#YdmVS) 

**Note:** 

Set the data type of each field (except array) as String. This means that you must use double quotation marks (" ") to enclose the field value. Examples:

-   If the data type of a field is Integer and its value is 20, set it as "20".
-   If the data type of a field is Boolean and its value is true, set it as "true".

## Request parameters

#### paymentRequestId (String)

The request ID of the payment to be refunded, assigned by the ACQP to identify the original payment order.

**Note:** Required if the value of the _paymentId_ parameter is empty.

More information:

- Maximum length: 64 characters

#### paymentId (String)

The ID of the payment to be canceled, assigned by Alipay+ to identify the original payment order.

**Note:** Required if the value of the _paymentRequestId_ parameter is empty.

More information:

- Maximum length: 64 characters

#### refundRequestId (String, REQUIRED)

The unique ID that is assigned by the ACQP to identify a refund request.

More information:

- This field is an API idempotency field.For refund requests which are initiated with the same refundRequestId, Alipay+ regards the requests as repeated and processes the requests only once. If the values for the other parameters in repeated requests are different, Alipay+ returns the REPEAT_REQ_INCONSISTENT result code.
- Maximum length: 64 characters

#### refundAmount (Amount, REQUIRED)

The refund amount that is paid by Alipay+ for this refund.

**Note**: The value of the _refundAmount.currency_ parameter must be the same as the value of the _paymentAmount.currency_ parameter of the original payment order.

##### currency (String, REQUIRED)

The currency code of the amount. The value of this parameter must be an alphabetic code that follows the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, for example, "EUR" for Euros.

More information:

- Maximum length: 3 characters

##### value (Integer, REQUIRED)

The value of the amount as a natural number. By default, the value of this parameter is in the smallest currency unit. For example, if the currency is USD and the amount is $1.00, set the value of this parameter to 100; or if the currency is JPY and the amount is ￥1, set the value of this parameter to 1.

Due to the currency practices in Indonesia, when the currency is IDR, round the amount with banker's rounding and fix the last two digits of the value of this parameter as `00`.

More information:

- Value range: 1 - unlimited

#### refundReason (String)

The reasons for the refund.

**Note:** You can specify the reason for the refund that the user provided to the merchant.

More information:

- Maximum length: 256 characters

## Response parameters

#### result (Result, REQUIRED)

The refund result. If this API is successfully called, the refund succeeds. See Result processing logic for details.

##### resultCode (String, REQUIRED)

The result code that indicates the detailed processing result.

More information:

- Maximum length: 64 characters

##### resultStatus (String, REQUIRED)

The result status that indicates the processing result. Valid values are:

-   `S`: Successful
-   `F`: Failed
-   `U`: Unknown

##### resultMessage (String)

The result message that describes the result code in detail.

More information:

- Maximum length: 256 characters

#### acquirerId (String)

The unique ID that is assigned by Alipay+ to identify an ACQP.

**Note:** Returned if the refund succeeds (the value of the _result_._resultCode_ parameter is `SUCCESS`).

More information:

- Maximum length: 64 characters

#### pspId (String)

The unique ID that is assigned by Alipay+ to identify an MPP.

**Note:** Returned if the refund succeeds (the value of the _result_._resultCode_ parameter is `SUCCESS`).

More information:

- Maximum length: 64 characters

#### refundId (String)

The unique ID that is assigned by Alipay+ to identify a refund.

**Note:** Returned if the refund succeeds (the value of the _result_._resultCode_ parameter is `SUCCESS`).

More information:

- Maximum length: 64 characters

#### refundTime (Datetime)

The date and time when the refund reaches a final state of success.

**Note:** Returned if the refund succeeds (the value of the _result_._resultCode_ parameter is `SUCCESS`).

More information:

- The value follows the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) standard format. For example, "2019-11-27T12:01:01+08:00".

#### refundAmount (Amount)

The refund amount that is paid by Alipay+ for this refund. 

**Note:** Returned if the refund succeeds (the value of the _result_._resultCode_ parameter is `SUCCESS`).

##### currency (String, REQUIRED)

The currency code of the amount. The value of this parameter must be an alphabetic code that follows the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, for example, "EUR" for Euros.

More information:

- Maximum length: 3 characters

##### value (Integer, REQUIRED)

The value of the amount as a natural number. By default, the value of this parameter is in the smallest currency unit. For example, if the currency is USD and the amount is $1.00, set the value of this parameter to 100; or if the currency is JPY and the amount is ￥1, set the value of this parameter to 1.

More information:

- Value range: 1 - unlimited

#### settlementAmount (Amount)

The gross amount that Alipay+ settles to the ACQP for this refund. If the settlement currency is different from the currency specified by _paymentAmount_, the value is calculated based on _paymentAmount_ and _settlementQuote_.

**Note:** Returned if the refund succeeds (the value of the _result_._resultCode_ parameter is `SUCCESS`).

##### currency (String, REQUIRED)

The currency code of the amount. The value of this parameter must be an alphabetic code that follows the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, for example, "EUR" for Euros.

More information:

- Maximum length: 3 characters

##### value (Integer, REQUIRED)

The value of the amount as a natural number. By default, the value of this parameter is in the smallest currency unit. For example, if the currency is USD and the amount is $1.00, set the value of this parameter to 100; or if the currency is JPY and the amount is ￥1, set the value of this parameter to 1.

More information:

- Value range: 1 - unlimited

#### settlementQuote (Quote)

The exchange rate between the settlement currency and the payment currency.

**Note**: Returned by Alipay+ if the refund succeeds and the value of the settlementAmount.currency parameter is different from the value of the _paymentAmount.currency_ parameter_._

##### quoteId (String, REQUIRED)

The unique ID that is assigned by Alipay+ to identify an exchange rate.

More information:

- Maximum length: 64 characters

##### quoteCurrencyPair (String, REQUIRED)

A currency pair, of which the first listed currency (also called base currency) is quoted against the second currency (also called quote currency). The value of this parameter is in the format of `{``_base_currency_``}/{``_quote_currency_``}`, where `{``_base_currency_``}` and `{``_quote_currency_``}` are alphabetic codes that follow the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard. For example, if the base currency is euro and the quote currency is dollar, the value of this parameter is EUR/USD.

More information:

- Maximum length: 8 characters

##### quotePrice (Decimal, REQUIRED)

The quotation of the exchange rate between the currency pair that is specified on the _quoteCurrencyPair_ parameter.

More information:

- Value range: 0 - unlimited

##### quoteStartTime (Datetime)

The time when the quotation (specified on the _quotePrice_ parameter) takes effect.

More information:

- The value follows the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) standard format. For example, "2019-11-27T12:01:01+08:00".

##### quoteExpiryTime (Datetime)

The time when the quotation (specified on the _quotePrice_ parameter) expires.

More information:

- The value follows the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) standard format. For example, "2019-11-27T12:01:01+08:00".

##### baseCurrency (String)

The first currency in the currency pair that is specified on the quoteCurrencyPair parameter. The value is an alphabetic code that follows the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard.

More information:

- Maximum length: 3 characters

##### quoteUnit (String)

The amount in the base currency that is specified on the _baseCurrency_ parameter.

More information:

- Maximum length: 12 characters

More information

**Refund amount and payment amount:**

The value of the _refundAmount.currency_ parameter must be the same as the value of the _paymentAmount.currency_ parameter of the original payment. 

**Partial refunds**:

If multiple refunds exist for a particular payment, the total refund amount must not exceed the value of _paymentAmount_ of the original payment.

**Result processing logic**

For different results returned by Alipay+, take actions as below:

<table style="width:731px;outline:none;border-collapse:collapse;border:1px solid rgb(217, 217, 217)" class="lake-table"><colgroup><col width="107" span="1"><col width="235" span="1"><col width="119" span="1"><col width="270" span="1"></colgroup><tbody><tr style="height:33px"><td style="background-color:rgb(212, 238, 252);min-width:90px;font-size:14px;white-space:normal;overflow-wrap:break-word;border:1px solid rgb(217, 217, 217);padding:4px 8px;cursor:default"><p id="c21141e215cba296b2909da7725db8aa" data-lake-id="f1cd88ee2d7391cd5bbc2089579c7269" style="font-size:14px;color:rgb(38, 38, 38);line-height:1.74;letter-spacing:0.05em;outline-style:none;overflow-wrap:break-word;margin-top:0px;margin-bottom:0px"><strong><span>result.resultStatus</span></strong></p></td><td style="background-color:rgb(212, 238, 252);min-width:90px;font-size:14px;white-space:normal;overflow-wrap:break-word;border:1px solid rgb(217, 217, 217);padding:4px 8px;cursor:default"><p id="81210665a070220bc2cdaa3462a1f01c" data-lake-id="53f60646a579dbfcc66029b5eaa3b426" style="font-size:14px;color:rgb(38, 38, 38);line-height:1.74;letter-spacing:0.05em;outline-style:none;overflow-wrap:break-word;margin-top:0px;margin-bottom:0px"><strong><span>result.resultCode</span></strong></p></td><td style="background-color:rgb(212, 238, 252);min-width:90px;font-size:14px;white-space:normal;overflow-wrap:break-word;border:1px solid rgb(217, 217, 217);padding:4px 8px;cursor:default"><p id="76b9268ddc9d808da277f4f518b05118" data-lake-id="392d5f92f1f5ca924c48a72208f3c8f3" style="font-size:14px;color:rgb(38, 38, 38);line-height:1.74;letter-spacing:0.05em;outline-style:none;overflow-wrap:break-word;margin-top:0px;margin-bottom:0px"><strong><span>Refund status</span></strong></p></td><td style="background-color:rgb(212, 238, 252);min-width:90px;font-size:14px;white-space:normal;overflow-wrap:break-word;border:1px solid rgb(217, 217, 217);padding:4px 8px;cursor:default"><p id="813eb2bb0d8c34e1dc630e871e760ad1" data-lake-id="91ee235fa205f5430b57ea77bb4af2a6" style="font-size:14px;color:rgb(38, 38, 38);line-height:1.74;letter-spacing:0.05em;outline-style:none;overflow-wrap:break-word;margin-top:0px;margin-bottom:0px"><strong><span>Actions</span></strong></p></td></tr><tr style="height:33px"><td style="min-width:90px;font-size:14px;white-space:normal;overflow-wrap:break-word;border:1px solid rgb(217, 217, 217);padding:4px 8px;cursor:default"><p id="bb5e6986de7f0a8fec9a653f241b7a64" data-lake-id="b5ea69ecb99c1c83192eb192c8a21ca4" style="font-size:14px;color:rgb(38, 38, 38);line-height:1.74;letter-spacing:0.05em;outline-style:none;overflow-wrap:break-word;margin-top:0px;margin-bottom:0px"><code style="font-family:monospace;font-size:inherit;background-color:rgba(0, 0, 0, 0.06);padding:0px 2px;border:1px solid rgba(0, 0, 0, 0.08);border-radius:2px;line-height:inherit;overflow-wrap:break-word;text-indent:0px"><span>S</span></code></p></td><td style="min-width:90px;font-size:14px;white-space:normal;overflow-wrap:break-word;border:1px solid rgb(217, 217, 217);padding:4px 8px;cursor:default"><p id="96ccaed2c29140bbd3bceb2dbaf12c77" data-lake-id="480055bdd38c59481c5c37447a6baca7" style="font-size:14px;color:rgb(38, 38, 38);line-height:1.74;letter-spacing:0.05em;outline-style:none;overflow-wrap:break-word;margin-top:0px;margin-bottom:0px"><code style="font-family:monospace;font-size:inherit;background-color:rgba(0, 0, 0, 0.06);padding:0px 2px;border:1px solid rgba(0, 0, 0, 0.08);border-radius:2px;line-height:inherit;overflow-wrap:break-word;text-indent:0px"><span>SUCCESS</span></code></p></td><td style="min-width:90px;font-size:14px;white-space:normal;overflow-wrap:break-word;border:1px solid rgb(217, 217, 217);padding:4px 8px;cursor:default"><p id="39289cb674b61130723e770da943ffef" data-lake-id="8eb70cfc1d527905053e21b64d5830d1" style="font-size:14px;color:rgb(38, 38, 38);line-height:1.74;letter-spacing:0.05em;outline-style:none;overflow-wrap:break-word;margin-top:0px;margin-bottom:0px"><span>Successful</span></p></td><td style="min-width:90px;font-size:14px;white-space:normal;overflow-wrap:break-word;border:1px solid rgb(217, 217, 217);padding:4px 8px;cursor:default"><p id="d873fe3fd6f4f0e05850bd87057e8486" data-lake-id="7589fca2651ec401a724e6075f7703ae" style="font-size:14px;color:rgb(38, 38, 38);line-height:1.74;letter-spacing:0.05em;outline-style:none;overflow-wrap:break-word;margin-top:0px;margin-bottom:0px"><span>Update </span><span>the</span><span> status from the merchant side.</span></p></td></tr><tr style="height:33px"><td style="min-width:90px;font-size:14px;white-space:normal;overflow-wrap:break-word;border:1px solid rgb(217, 217, 217);padding:4px 8px;cursor:default"><p id="50547b90a126515fba647d330df8c18d" data-lake-id="0a685cc27cc5ddf796c82f6b8891584e" style="font-size:14px;color:rgb(38, 38, 38);line-height:1.74;letter-spacing:0.05em;outline-style:none;overflow-wrap:break-word;margin-top:0px;margin-bottom:0px"><code style="font-family:monospace;font-size:inherit;background-color:rgba(0, 0, 0, 0.06);padding:0px 2px;border:1px solid rgba(0, 0, 0, 0.08);border-radius:2px;line-height:inherit;overflow-wrap:break-word;text-indent:0px"><span>F</span></code></p></td><td style="min-width:90px;font-size:14px;white-space:normal;overflow-wrap:break-word;border:1px solid rgb(217, 217, 217);padding:4px 8px;cursor:default"><p id="ffec1685c14eedf46f6d80e97cd7d5e8" data-lake-id="c0ed784a136ac122d8ce0c232c0f8800" style="font-size:14px;color:rgb(38, 38, 38);line-height:1.74;letter-spacing:0.05em;outline-style:none;overflow-wrap:break-word;margin-top:0px;margin-bottom:0px"><span>Multiple possible values exist, such as </span></p><p id="u30224224" data-lake-id="03c27bb3032cea690b47e0a628c7d4e1" style="font-size:14px;color:rgb(38, 38, 38);line-height:1.74;letter-spacing:0.05em;outline-style:none;overflow-wrap:break-word;margin-top:0px;margin-bottom:0px"><code style="font-family:monospace;font-size:inherit;background-color:rgba(0, 0, 0, 0.06);padding:0px 2px;border:1px solid rgba(0, 0, 0, 0.08);border-radius:2px;line-height:inherit;overflow-wrap:break-word;text-indent:0px"><span>ACCESS\_DENIED</span></code><span>, </span></p><p id="u44a508b6" data-lake-id="c8d499b8a23f2d55a51833b2ccb89080" style="font-size:14px;color:rgb(38, 38, 38);line-height:1.74;letter-spacing:0.05em;outline-style:none;overflow-wrap:break-word;margin-top:0px;margin-bottom:0px"><code style="font-family:monospace;font-size:inherit;background-color:rgba(0, 0, 0, 0.06);padding:0px 2px;border:1px solid rgba(0, 0, 0, 0.08);border-radius:2px;line-height:inherit;overflow-wrap:break-word;text-indent:0px"><span>KEY\_NOT\_FOUND</span></code><span>, etc.</span></p></td><td style="min-width:90px;font-size:14px;white-space:normal;overflow-wrap:break-word;border:1px solid rgb(217, 217, 217);padding:4px 8px;cursor:default"><p id="9d71bdde0af683cc4a855150723f075a" data-lake-id="938b36e5d0863864fabf254dda85ea5b" style="font-size:14px;color:rgb(38, 38, 38);line-height:1.74;letter-spacing:0.05em;outline-style:none;overflow-wrap:break-word;margin-top:0px;margin-bottom:0px"><span>Failed</span></p></td><td style="min-width:90px;font-size:14px;white-space:normal;overflow-wrap:break-word;border:1px solid rgb(217, 217, 217);padding:4px 8px;cursor:default"><p id="984813f5fa0439076a30762e3dcb520b" data-lake-id="5463ede99ef7dc4ddafb6f0a291f8b47" style="font-size:14px;color:rgb(38, 38, 38);line-height:1.74;letter-spacing:0.05em;outline-style:none;overflow-wrap:break-word;margin-top:0px;margin-bottom:0px"><span>Take actions according to the error message in the </span><em><span>result.resultMessage</span></em><span> parameter.</span></p></td></tr><tr style="height:33px"><td style="min-width:90px;font-size:14px;white-space:normal;overflow-wrap:break-word;border:1px solid rgb(217, 217, 217);padding:4px 8px;cursor:default"><p id="78dbc7be4044122ee77ba67b2cfebde1" data-lake-id="fb69e6837b1a7545a7b47ed6c3949958" style="font-size:14px;color:rgb(38, 38, 38);line-height:1.74;letter-spacing:0.05em;outline-style:none;overflow-wrap:break-word;margin-top:0px;margin-bottom:0px"><code style="font-family:monospace;font-size:inherit;background-color:rgba(0, 0, 0, 0.06);padding:0px 2px;border:1px solid rgba(0, 0, 0, 0.08);border-radius:2px;line-height:inherit;overflow-wrap:break-word;text-indent:0px"><span>U</span></code></p></td><td style="min-width:90px;font-size:14px;white-space:normal;overflow-wrap:break-word;border:1px solid rgb(217, 217, 217);padding:4px 8px;cursor:default"><p id="2f04c229b6fc67e52a27f35638ad33f8" data-lake-id="f4e281cf0e88d17c5071926ca6de8c06" style="font-size:14px;color:rgb(38, 38, 38);line-height:1.74;letter-spacing:0.05em;outline-style:none;overflow-wrap:break-word;margin-top:0px;margin-bottom:0px"><span>Multiple possible values exist, such as </span></p><p id="u7f584bbc" data-lake-id="d77eb5912a161f5941784d0f40840380" style="font-size:14px;color:rgb(38, 38, 38);line-height:1.74;letter-spacing:0.05em;outline-style:none;overflow-wrap:break-word;margin-top:0px;margin-bottom:0px"><code style="font-family:monospace;font-size:inherit;background-color:rgba(0, 0, 0, 0.06);padding:0px 2px;border:1px solid rgba(0, 0, 0, 0.08);border-radius:2px;line-height:inherit;overflow-wrap:break-word;text-indent:0px"><span>UNKNOWN\_EXCEPTION</span></code><span>, </span></p><p id="u50eb2a45" data-lake-id="04228289480e31d28ffe5ca9fead55be" style="font-size:14px;color:rgb(38, 38, 38);line-height:1.74;letter-spacing:0.05em;outline-style:none;overflow-wrap:break-word;margin-top:0px;margin-bottom:0px"><code style="font-family:monospace;font-size:inherit;background-color:rgba(0, 0, 0, 0.06);padding:0px 2px;border:1px solid rgba(0, 0, 0, 0.08);border-radius:2px;line-height:inherit;overflow-wrap:break-word;text-indent:0px"><span>REQUEST\_TRAFFIC\_EXCEED\_LIMIT</span></code><span>, etc.</span></p></td><td style="min-width:90px;font-size:14px;white-space:normal;overflow-wrap:break-word;border:1px solid rgb(217, 217, 217);padding:4px 8px;cursor:default"><p id="3b0fccb1086f21911c43efc82d27144f" data-lake-id="bbeebb423b91d9194032267706490894" style="font-size:14px;color:rgb(38, 38, 38);line-height:1.74;letter-spacing:0.05em;outline-style:none;overflow-wrap:break-word;margin-top:0px;margin-bottom:0px"><span>Unknown</span></p></td><td style="min-width:90px;font-size:14px;white-space:normal;overflow-wrap:break-word;border:1px solid rgb(217, 217, 217);padding:4px 8px;cursor:default"><p id="affbd959f3bbabf61a4f88ccf91aa3ca" data-lake-id="399511812c7c48fa6edd75bb45b2141c" style="font-size:14px;color:rgb(38, 38, 38);line-height:1.74;letter-spacing:0.05em;outline-style:none;overflow-wrap:break-word;margin-top:0px;margin-bottom:0px"><span>Use the same parameters to retry the refund request. It is recommended to keep trying for at least 1 hour. If you keep receiving the same result indicating the unknown status, contact </span><a href="mailto:connect\_support@service.alipay.com" target="\_blank"><span>connect\_support@service.alipay.com</span></a><span>.</span></p></td></tr><tr style="height:33px"><td colspan="2" style="min-width:90px;font-size:14px;white-space:normal;overflow-wrap:break-word;border:1px solid rgb(217, 217, 217);padding:4px 8px;cursor:default"><p id="a4b02b824cc72ca770c38b61d432535b" data-lake-id="156fdc4412d0dec6c8a0576bc75436b6" style="font-size:14px;color:rgb(38, 38, 38);line-height:1.74;letter-spacing:0.05em;outline-style:none;overflow-wrap:break-word;margin-top:0px;margin-bottom:0px"><span>No result received&nbsp;after trying several times</span></p></td><td style="min-width:90px;font-size:14px;white-space:normal;overflow-wrap:break-word;border:1px solid rgb(217, 217, 217);padding:4px 8px;cursor:default"><p id="a20d224c568e48b9d67847a2c66a8c01\_p\_0" data-lake-id="2f03d9cd7a4b006344d9672e14a1407e" style="font-size:14px;color:rgb(38, 38, 38);line-height:1.74;letter-spacing:0.05em;outline-style:none;overflow-wrap:break-word;margin-top:0px;margin-bottom:0px"><span>Unknown</span></p></td><td style="min-width:90px;font-size:14px;white-space:normal;overflow-wrap:break-word;border:1px solid rgb(217, 217, 217);padding:4px 8px;cursor:default"><p id="uda12c1e3" data-lake-id="7f88fe219f959027313d3c3aa127f4c2" style="font-size:14px;color:rgb(38, 38, 38);line-height:1.74;letter-spacing:0.05em;outline-style:none;overflow-wrap:break-word;margin-top:0px;margin-bottom:0px"><span>Contact </span><a href="mailto:connect\_support@service.alipay.com" target="\_blank"><span>connect\_support@service.alipay.com</span></a><span>.</span></p></td></tr></tbody></table>

## Result/Error codes

| Code | Value | Message | Further action |
| --- | --- | --- | --- |
| SUCCESS | S | Success | Update the status from merchant side. |
| ACCESS_DENIED | F | Access is denied. | It is recommended that you contact connect_support@service.alipay.com to troubleshoot the issue. |
| CURRENCY_NOT_SUPPORT | F | The refund currency is not the same as the currency of the original payment. | Try the refund in the currency of the original payment, which is the value of the paymentAmount.currency parameter in the pay API. |
| INVALID_CLIENT | F | The client is invalid. | It is recommended that you contact connect_support@service.alipay.com to troubleshoot the issue. |
| INVALID_ORDER_STATUS | F | The order status is invalid for this operation. | Check the status of the original payment by using the inquiryPayment API or the notifyPayment. Only successful payments can be refunded. If the order status is success, contact connect_support@service.alipay.com to troubleshoot the issue. |
| INVALID_SIGNATURE | F | The signature is invalid. | Check whether the public key, signed message, and signature algorithm are as expected. |
| KEY_NOT_FOUND | F | The key is not found. | It is recommended that you contact connect_support@service.alipay.com to troubleshoot the issue. |
| MEDIA_TYPE_NOT_ACCEPTABLE | F | The server does not implement the media type that is acceptable to the client. | Use a media type that is accepted by Alipay+. |
| METHOD_NOT_SUPPORTED | F | The server does not implement the requested HTTPS method. | Ensure the HTTP method is POST. |
| NO_INTERFACE_DEF | F | API is not defined. | Check whether the request URL is correct. Ensure that the endpoint of the called API is correct. |
| ORDER_NOT_EXIST | F | The order doesn't exist. | The original payment does not exist. Check the payment status manually. If the payment does exist, contact connect_support@service.alipay.com to troubleshoot the issue. |
| PARAM_ILLEGAL | F | Illegal parameters. For example, non-numeric input, invalid date. | Check whether the request parameters, including the header parameters and body parameters, are correct and valid. For more information about the parameters of each API, see the Structure section of the specific API reference topic. |
| PROCESS_FAIL | F | A general business failure occurred. Do not retry. | It is recommended that you contact connect_support@service.alipay.com to troubleshoot the issue. |
| REFUND_AMOUNT_EXCEED | F | The total refund amount exceeds the payment amount. | Instruct the user to retry the refund with an amount that is not greater than the original payment amount. |
| REFUND_AMOUNT_INVALID | F | Refund amount is invalid. | Instruct the user to retry the refund with an amount that is high enough. For example, if the refund currency is JPY and the settlement currency is USD, the refund amount cannot be 1 JPY because the amount in USD would be rounded to 0. |
| REFUND_WINDOW_EXCEED | F | Exceed Refund window. | N/A |
| REPEAT_REQ_INCONSISTENT | F | Repeated requests are inconsistent. | Ensure the fields in the requests are the same. |
| USER_AMOUNT_EXCEED | F | The user balance exceeds the balance limit. | It is recommended that you contact connect_support@service.alipay.com to troubleshoot the issue. |
| USER_NOT_EXIST | F | The user does not exist. | It is recommended that you inform the user of the error. |
| REQUEST_TRAFFIC_EXCEED_LIMIT | U | The request traffic exceeds the limit. | Reduce the frequency of API calls. |
| UNKNOWN_EXCEPTION | U | An API call failed, which is caused by unknown reasons. | Try to recall the API. |

## Request

### ALIPAY, ALIPAY_HK, DANA, H5, DIRECT

```json
{
  "paymentRequestId": "pay_1089760038715669_102775745070000",
  "refundRequestId": "20200101234567890000",
  "refundAmount": {
    "value": "100",
    "currency": "JPY"
  },
  "refundReason": "refund reason"
}
```

## Response

```json
{
  "acquirerId": "1111088000000000000",
  "pspId": "1022172000000000000",
  "result": {
    "resultCode": "SUCCESS",
    "resultStatus": "S",
    "resultMessage": "success"
  },
  "refundAmount": {
    "value": "100",
    "currency": "JPY"
  },
  "refundId": "20200101234567890130000",
  "refundTime": "2020-10-10T12:01:01+08:30",
  "settlementAmount": {
    "value": "74",
    "currency": "USD"
  },
  "settlementQuote": {
    "quoteCurrencyPair": "USD/JPY",
    "quoteExpiryTime": "2021-06-02T13:15:48+08:00",
    "quoteId": "046793306919850000",
    "quotePrice": "1.35",
    "quoteStartTime": "2021-05-30T13:15:48+08:00"
  }
}
```