# 5.6 Callback

## 1. Payment Callback <a href="#id-1overview" id="id-1overview"></a>

### 1.1. Overview <a href="#id-1overview" id="id-1overview"></a>

Uses callBackUrl to send the payment result to the merchant when the payment processing reaches a final state of success or failure. Merchants promote merchant-side transactions based on the payment result.

Note: If the merchant response is { "transResult": "SUCCESS" } , the callback notification will stop. If not,the callback notification will be performed in 10 sec, 5 min, 30 min, After 3 retries, the callback notification will be stopped.

### 1.2. Request Info <a href="#id-2request-info" id="id-2request-info"></a>

* **Method: post**
* **Path: The callBackUrl parameter when the** [**Payment**](https://newpay-api-document.gitbook.io/newpay-api-document/5.-apis-v2/5.1-unified-order)

#### 1.2.1 Request Header <a href="#id-21-request-header" id="id-21-request-header"></a>

| Key          | Value            |
| ------------ | ---------------- |
| Content-Type | application/json |

#### 1.2.2 Request Data <a href="#request-data" id="request-data"></a>

| Name               | Description                                                                                                                                                                                                                     | Type    |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| success            | Success flag: true/false                                                                                                                                                                                                        | boolean |
| message            | Response message                                                                                                                                                                                                                | string  |
| code               | [Reponse code](https://newpay-api-document.gitbook.io/newpay-api-document/9.-business-code#response-code)                                                                                                                       | string  |
| timestamp          | Response timestamp                                                                                                                                                                                                              | long    |
| data               | Result                                                                                                                                                                                                                          | object  |
| > appId            | Unique identifier assigned to a third-party application platform                                                                                                                                                                | string  |
| > payStatus        | SUCCESS/EXPIRED/PROCESSING/FAIL                                                                                                                                                                                                 | string  |
| > payMethod        | <p>Payment method: <br>1.Wechat; <br>11.Alipay+;</p>                                                                                                                                                                            | int     |
| > orderType        | <p><em>STATIC\_CODE:</em> 静态收款码</p><p><em>DYNAMIC\_CODE:</em>动态收款码</p><p><em>MICRO\_CODE:</em>扫码收款(反扫)</p><p><em>MINI\_APP:微信</em>小程序</p><p><em>APP:</em>线上APP</p><p><em>ONLINE:</em>线上支付</p><p><em>AUTO\_DEBIT:</em>线上自动扣款</p> | string  |
| > orderAmt         | Payment amount                                                                                                                                                                                                                  | json    |
| >> value           | amount                                                                                                                                                                                                                          | string  |
| >> currency        | <p>CNY: 人民币<br>USD: 美元<br>LAK: 老挝币</p>                                                                                                                                                                                          | string  |
| > mchOrderNo       | Order number in third party mechant.                                                                                                                                                                                            | string  |
| > newpayOrderNo    | NewPay order number                                                                                                                                                                                                             | string  |
| > subject          | Commodity title                                                                                                                                                                                                                 | string  |
| > settlementStatus | <p>Settlement status: <br>0: No settlement;<br>1: In settlement;</p><p>2: Have already settled</p>                                                                                                                              | int     |
| > paytime          | payment timestamp                                                                                                                                                                                                               | long    |
| > attach           | Third party order supplementary fields                                                                                                                                                                                          | string  |
| > sign             | Data signature                                                                                                                                                                                                                  | string  |

## 2. Refund Callback

### 2.1. Overview <a href="#id-1overview" id="id-1overview"></a>

Uses callback url to send the refund result to the merchant when the refund processing reaches a final state of success or failure. Merchants promote merchant-side transactions based on the refund result.

Note: If the merchant response is { "transResult": "SUCCESS" } , the callback notification will stop. If not,the callback notification will be performed in 10 sec, 5 min, 30 min, After 3 retries, the callback notification will be stopped.

### 2.2. Request Info <a href="#id-2request-info" id="id-2request-info"></a>

* **Method: post**
* **Path: The callBackUrl parameter when the** [**Refund**](https://newpay-api-document.gitbook.io/newpay-api-document/5.-apis-v2/5.3-refund)

#### 2.2.1 Request Header <a href="#id-21-request-header" id="id-21-request-header"></a>

| Key          | Value            |
| ------------ | ---------------- |
| Content-Type | application/json |

#### 2.2.2 Request Data <a href="#request-data" id="request-data"></a>

<table><thead><tr><th>Name</th><th width="277">Description</th><th>Type</th></tr></thead><tbody><tr><td>success</td><td>Success flag: true/false</td><td>boolean</td></tr><tr><td>message</td><td>Response message</td><td>string</td></tr><tr><td>code</td><td><a href="../../9.-business-code#response-code">Reponse code</a></td><td>string</td></tr><tr><td>timestamp</td><td>Response timestamp</td><td>long</td></tr><tr><td>data</td><td>Result</td><td>object</td></tr><tr><td>> newpayRefundNo</td><td>Refund order number in NewPay</td><td>string</td></tr><tr><td>> mchRefundNo</td><td>Refund order number in third party merchant</td><td>string</td></tr><tr><td>> newpayOrderNo</td><td>payment order number in NewPay</td><td>string</td></tr><tr><td>> refundAmt</td><td>Refund amount and currency</td><td>json</td></tr><tr><td>   >> value</td><td>amount</td><td>string</td></tr><tr><td>   >> currency</td><td>CNY: 人民币<br>USD: 美元<br>LAK: 老挝币</td><td>string</td></tr><tr><td>> orderAmt</td><td>original order amount and currency</td><td>json</td></tr><tr><td>   >> value</td><td>amount</td><td>string</td></tr><tr><td>   >> currency</td><td>CNY: 人民币<br>USD: 美元<br>LAK: 老挝币</td><td>string</td></tr><tr><td>> refundStatus</td><td>refund status: SUCCESS/FAIL/PROCESSING</td><td>int</td></tr><tr><td>> sign</td><td>Data signature</td><td>string</td></tr></tbody></table>
