sendRefundResult
Use this API to notify Ant of the refund result of the transaction when the refund processing reaches a final state of success or failure. The refund can be full or partial. This API is used for future risk evaluation.
Structure
A message consists of a header and body. The following sections are focused on the body structure. For the header structure, see:
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
referenceTransactionId String REQUIRED
The unique ID assigned by the merchant that directly provides services or goods to users, to identify a transaction. The value of this field is identical to that of referenceOrderId for a payment.
More information:
- Maximum length: 64 characters
referenceRefundId String REQUIRED
The unique ID to identify a refund, which is assigned by the merchant that directly provides services or goods to the customer.
More information:
- Maximum length: 64 characters
actualRefundAmount Amount REQUIRED
The total refund amount of this transaction.
refundRecords Array<RefundRecord> REQUIRED
The refund records of this transaction.
More information:
- Maximum size: 100 elements
Response parameters
result Result REQUIRED
The result of the API call.
Request
Response
Result/Error codes
Code | Value | Message | Further action |
---|---|---|---|
SUCCESS | S | Success | The API is called successfully, no further action is needed. |
ACCESS_DENIED | F | Access is denied. | Contact Alipay Technical Support for detailed reasons. |
INVALID_API | F | The called API is invalid or not active. | Contact Alipay Technical Support to resolve the issue. |
INVALID_CONTRACT | F | The parameter values in the contract do not match those in the current transaction. | Check whether the parameter values in the contract match those in the current transaction. If the values match, contact Alipay Technical Support to troubleshoot the issue. |
KEY_NOT_FOUND | F | The private key or public key of Alipay or the merchant is not found. | Check whether the private key or public key exists. If not, upload the private key in Alipay Developer Center. |
MERCHANT_KYB_NOT_QUALIFIED | F | The payment failed because of the merchant's KYB status. The merchant is either not KYB compliant, or the KYB status is not qualified for this transaction. | Contact Alipay Technical Support for detailed reasons. |
MERCHANT_NOT_REGISTERED | F | The merchant is not registered. | Please register the merchant by using the registration interface. Contact Alipay Technical Support if failed to call the registration interface. |
NO_INTERFACE_DEF | F | API is not defined. | Check whether the URL is correct. Please refer to the endpoint in the API documentation. |
REQUEST_TRAFFIC_EXCEED_LIMIT | U | The request traffic exceeds the limit. | Call the interface again to resolve the issue. If not resolved, contact Alipay Technical Support. |
PARAM_ILLEGAL | F | The required parameters are not passed, or illegal parameters exist. For example, a non-numeric input, an invalid date, or the length and type of the parameter are wrong. | Check and verify whether the required request fields (including the header fields and body fields) of the current API are correctly passed and valid. |
SYSTEM_ERROR | F | A system error occurred. | Do not retry, and contact Alipay Technical Support for more details. |
UNKNOWN_EXCEPTION | U | An API call has failed, which is caused by unknown reasons. | Call the interface again to resolve the issue. If not resolved, contact Alipay Technical Support. |