refundACQP → Alipay+
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 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 Partner (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:
Note:
1. Set the data type of each parameter (except array) as String. This means that you must use double quotation marks (" ") to enclose the parameter value. Examples:
- If the data type of a parameter is Integer and its value is 20, set it as "20".
- If the data type of a parameter is Boolean and its value is
true
, set it as "true".
2. For optional parameters that are not required in your case, you can take one of the following actions:
- Exclude the parameters from the request body.
- Set the parameter values as
null
(without the double quotation marks).
Do NOT leave the optional parameters empty by setting their values as ""
; otherwise, an error might occur.
Request parameters
paymentRequestId String
The request ID of the payment to be refunded, assigned by the ACQP to identify the original payment order.
Specify this parameter if the value of the paymentId parameter is empty.
More information:
- Maximum length: 64 characters
paymentId String
The ID of the payment to be refunded, assigned by Alipay+ to identify the original payment order.
Specify this parameter 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 requests that are initiated with the same refundRequestId, Alipay+ regards the requests as repeated and processes the requests only once. Alipay+ checks the consistency of the following key request parameters: refundAmount and paymentRequestId, or refundAmount and paymentId. If either of their values is different from that in the previous request, 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.
Important: The value of the refundAmount.currency parameter must be the same as the value of the paymentAmount.currency parameter of the original payment order.
refundReason String
The reasons for the refund.
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. For more information about how to handle the result of the refund API, see How to handle the result.
acquirerId String
The unique ID that is assigned by Alipay+ to identify an ACQP.
This parameter is returned by Alipay+ if the value of the result.resultCode parameter is SUCCESS
, which means that the refund succeeds.
More information:
- Maximum length: 64 characters
pspId String
The unique ID that is assigned by Alipay+ to identify an MPP.
This parameter is returned by Alipay+ 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.
This parameter is returned by Alipay+ 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.
This parameter is returned by Alipay+ if the refund succeeds (the value of the result.resultCode parameter is SUCCESS
).
More information:
- The value follows the ISO 8601 standard format. For example, "2019-11-27T12:01:01+08:00".
refundAmount Amount
The refund amount that is paid by Alipay+ for this refund.
This parameter is returned by Alipay+ if the refund succeeds (the value of the result.resultCode parameter is SUCCESS
).
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.
This parameter is returned by Alipay+ if the refund succeeds (the value of the result.resultCode parameter is SUCCESS
).
settlementQuote Quote
The exchange rate between the settlement currency and the payment currency, also known as transaction currency.
This parameter is 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.
Request
Response
More information
How to handle the result
You might receive different results from Alipay+. Follow the instructions below to handle the result.
result.resultStatus | result.resultCode | Refund status | Actions |
|
| Successful | Update the status from the merchant side. |
| Multiple possible values exist, such as
| Failed | Take actions according to the error message in the result.resultMessage parameter. |
| Multiple possible values exist, such as
| Unknown | 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 connect_support@service.alipay.com. |
No result received after trying several times | Unknown | Contact connect_support@service.alipay.com. |
Partial refunds
The refund can be full or partial.
If multiple refunds exist for a particular payment, the total refund amount must not exceed the value of paymentAmount of the original payment.
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 pushPayment 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. |