sendPaymentResult
Use this API to notify Ant of the payment result of the transaction when the payment processing reaches a final state of success or failure. 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.
More information:
- Maximum length: 64 characters
paymentStatus String REQUIRED
Indicates the payment result. Valid values are:
SUCCESS
: Indicates that the payment succeeds.FAIL
: Indicates that the payment fails.
More information:
- Maximum length: 16 characters
authorizationError Error
The reason provided by a payment method provider for a failed card payment authorization.
Providing this information helps to increase the accuracy of fraud detection and improve payment success rates.
cardVerificationResult CardVerificationResult
The verification result of the card payment method.
Specify this parameter when the payment is completed.
paymentMethodProvider String REQUIRED
Payment method provider.
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. |