reportRisk
Use this API to notify Ant of a risk case. This API is used for future risk evaluation and Ant will upgrade anti-risk strategies accordingly.
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
reportReason String
Indicates the reason for the report.
Providing this information helps to increase the accuracy of fraud detection and improve payment success rates.
More information:
- Maximum length: 2048 characters
riskType String
The type of the reported risk. Valid values are:
SUSPICIOUS
: Indicates that the transaction is deemed risky by the merchant, such as when the buyer hits the merchant's blocklist.CHARGEBACK
: Indicates a forced refund issued by the buyer.FRAUD
: Indicates an EMV (Europay, Mastercard, and Visa) counterfeit fraud.
Providing this information helps to increase the accuracy of fraud detection and improve payment success rates.
More information:
- Maximum length: 16 characters
riskOccurrenceTime Datetime REQUIRED
Indicates the time when the risk case occurs, which is defined in the following ways:
- If the value of riskType is
SUSPICIOUS
, the value is the time when you identify the transaction as risky. - If the value of riskType is
CHARGEBACK
, the value is the time that is specified in the notification sent by the specific payment method provider. - If the value of riskType is
FRAUD
, the value is the time that is specified in the notification sent by the specific payment method provider.
More information:
- Maximum length: 64 characters
- The value follows the ISO 8601 standard format. For example, "2019-11-27T12:01:01+08:00".
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. |