# notifyReversal

> Antom uses this API to send the abnormal transaction reports status to the merchant after payment discrepancies occur. The merchant proceeds with further actions based on the notification results.

Antom uses this API to send the abnormal transaction reports status to the merchant after payment discrepancies occur. The merchant proceeds with further actions based on the notification results.

# 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](https://global.alipay.com/docs/ac/ams/api_fund#ML5ur)
-   [Response header](https://global.alipay.com/docs/ac/ams/api_fund#WWH90)

**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

#### notifyType (String, REQUIRED)

The reversal type. The valid value is: 

-   `PAYMENT_REVERSAL`: indicates that Antom did not promptly receive the payment success notification, closing transaction reports due to timeout. However, the payment method does not support or the refund operation fails.

#### result (Result, REQUIRED)

Details about the payment result, such as payment status, result code, and result message.

##### resultCode (String, REQUIRED)

Result code. The possible result codes are listed in the Result/Error codes table on this page.

Not all the result codes listed in the table can be returned by every payment method. Whether the result codes can be returned depends on the capability of each payment method.

More information:

- Maximum length: 64 characters

##### resultStatus (String, REQUIRED)

Payment status. The value is fixed as `S`.

##### resultMessage (String, REQUIRED)

Result message that explains the result code.

More information:

- Maximum length: 256 characters

#### paymentRequestId (String, REQUIRED)

The unique ID that is assigned by a merchant to identify a payment request.

More information:

- Maximum length: 64 characters

#### paymentId (String, REQUIRED)

The unique ID that is assigned by Antom to identify a payment. A one-to-one correspondence between _paymentId_ and _paymentRequestId_ exists.

More information:

- Maximum length: 64 characters

## Response parameters

#### result (Result, REQUIRED)

A fixed value, which is sent to Antom to acknowledge that the notification is received.

##### resultCode (String, REQUIRED)

The value is fixed as `SUCCESS`.

More information:

- Maximum length: 64 characters

##### resultStatus (String, REQUIRED)

The value is fixed as `S`.

##### resultMessage (String, REQUIRED)

The value is fixed as `success`.

More information:

- Maximum length: 256 characters

## Result/Error codes

| Code | Value | Message | Further action |
| --- | --- | --- | --- |
| SUCCESS | S | Success | The payment is successful, no further action is needed. |

## Request

```json
{
  "notifyType": "PAYMENT_REVERSAL",
  "result": {
    "resultCode": "SUCCESS",
    "resultStatus": "S",
    "resultMessage": "success"
  },
  "paymentRequestId": "2020010123456789XXXX",
  "paymentId": "2020010123456789XXXX"
}
```

## Response

```json
{
  "result": {
    "resultCode": "SUCCESS",
    "resultStatus": "S",
    "resultMessage": "Success"
  }
}
```