﻿# Refund Notification
### 1. API Parameters
For details, please refer: [API](https://docs.payermax.com/api.html?docName=New%20Version&docVer=v1.0&docLang=en#/paths/RefundResultNotifyUrl/post)
 
>Request Parameters

| Parameter        | Type   | If Required | Max. Length | Description                                                                                                                                                 | Example                                                               |
| ---------------- | ------ | ----------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
| code             | String | M           | 32          | returned code，’APPLY_SUCCESS’means success                                                                                                               |                                                                       |
| msg              | String | M           | 256         | returned message，'Success.'                                                                                                                                |                                                                       |
| appId            | String | O           | 64          | merchant app id                                                                                                                                             |                                                                       |
| merchantNo       | String | M           | 15          | merchant Id                                                                                                                                                 |                                                                       |
| keyVersion       | String | M           | 8           | Signature Algorithm Version, Current value: 1.0                                                                                                             |                                                                       |
| notifyTime       | String | M           | 32          | Request time, compliant with rfc3339 specification, format: yyyy-MM-dd'T'HH:mm:ss.SSSXXX                                                                    | 2022-12-14T06:35:45.722Z or 2022-12-14T06:35:45.722+08:00             |
| notifyType       | String | M           | 16          | notify type: REFUND                                                                                                                                         |                                                                       |
| +data            | Object | O           |             |                                                                                                                                                             |                                                                       |
| 「outRefundNo    | String | M           | 64          | merchant refund order id                                                                                                                                    |                                                                       |
| 「refundTradeNo  | String | M           | 64          | PayerMax refund order id.                                                                                                                                   |                                                                       |
| 「outTradeNo     | String | M           | 64          | original merchant order id.                                                                                                                                 |                                                                       |
| 「refundAmount   | Number | M           | (20,4)      | The amount of the refund, the unit of the amount is yuan, and it will be returned according to the decimal point supported by the currency of each country. |                                                                       |
| 「refundCurrency | String | M           | 3           | refund currency                                                                                                                                             |                                                                       |
| 「status         | String | M           | 32          | Refund status：REFUND_SUCCESS, REFUND_FAILED                                                                                                                | [Refund Status](https://docs.payermax.com/en/202606-version/appendix/collection/refund-status.md) |

>Response Parameters

| Parameter | Type   | If Required | Max. Length | Description        | Example |
| --------- | ------ | ----------- | ----------- | ------------------ | ------- |
| code      | String | M           | 32          | response 'SUCCESS' |         |
| msg       | String | O           | 256         | response 'Success' |         |

# 2. Sample Code
>PayerMax refund result notification

```json
{
    "code": "APPLY_SUCCESS",
    "msg": "",
    "keyVersion": "1",
    "appId": "3b242b56a8b64274bcc37dac281120e3",
"merchantNo": "020213827212251",
    "notifyTime": "2022-01-17T09:33:54.540+00:00",
    "notifyType": "REFUND",
    "data": {
        "outRefundNo": "R1642411016202",
        "refundTradeNo": "20220117091657TI790000055087",
        "outTradeNo": "P1642410680681",
        "refundAmount": 10000,
        "refundCurrency": "IDR",
        "status": "REFUND_SUCCESS"
    }
}
```
>Merchant response

```json
{
    "code": "SUCCESS",
    "msg": "Success"
}
```
