# Refund Webhook Notification

### Webhook notification

{% tabs %}
{% tab title="Header" %}

<table><thead><tr><th width="134">Name</th><th width="188">Value</th><th width="104" align="center">Required</th><th width="82">Type</th><th width="299">Description</th></tr></thead><tbody><tr><td>Content-Type</td><td></td><td align="center">Y</td><td>string</td><td>application/json; charset=utf-8</td></tr><tr><td>Appid</td><td>202302010636261620672405236006912</td><td align="center">Y</td><td>string</td><td>Merchant's unique credential. Find it on the Developer page.</td></tr><tr><td>Timestamp</td><td>1677152490</td><td align="center">Y</td><td>string</td><td>Timestamp in seconds (10-digit). The request is valid for two minutes.</td></tr><tr><td>Sign</td><td>871f0223c66ea72435208d03603a0cb00b90f6ac4a4ba725d00164d967e291f6</td><td align="center">Y</td><td>string</td><td>SHA-256 (appId + appSecret + timestamp+<mark style="color:red;"><strong>body (json string)</strong></mark>)</td></tr></tbody></table>
{% endtab %}

{% tab title="Body" %}

<pre><code><strong>```json
</strong>{
  "pay_status": "success",
  "order_type": "Refund",
  "record_id": "202307310544361685889174073212928",
  "amount": "1",
  "net_receivable": "1",
  "network_fee": "0",
  "network_crypto": "USDT",
  "network_coin_id": "8e5741cf-6e51-4892-9d04-3d40e1dd0128",
  "chain": "ETH",
  "contract": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
  "crypto": "USDT",
  "to_address": "0xA9F422BFBeB46f1FbcBBaf947E15b84D8Fbba80C",
  "memo": "",
  "txid": "internal transfer",
  "merchant_order_id": "test_xxxx1688370383377840"
}
```
</code></pre>

{% endtab %}

{% tab title="Parameters" %}

<table><thead><tr><th width="158.33333333333331">Name</th><th width="88">Type</th><th>Description</th></tr></thead><tbody><tr><td>pay_status</td><td>string</td><td>Payment status: success, failed</td></tr><tr><td>order_type</td><td>string</td><td>Refund</td></tr><tr><td>record_id</td><td>string</td><td>Trading record: one transaction generates one unique record_id</td></tr><tr><td>amount</td><td>string</td><td>Withdrawal amount, the amount will be deducted from the merchant account.</td></tr><tr><td>network_fee</td><td>string</td><td>Network fee</td></tr><tr><td>network_crypto</td><td>string</td><td>Token name of network fee.</td></tr><tr><td>network_coin_id</td><td>string</td><td>Coin ID for network fee crypto.</td></tr><tr><td>net_receivable</td><td>string</td><td>Net receivable= withdrawal amount- network fee</td></tr><tr><td>chain</td><td>string</td><td>Chain for this transaction</td></tr><tr><td>contract</td><td>string</td><td>Contract</td></tr><tr><td>crypto</td><td>string</td><td>Crypto symbol</td></tr><tr><td>to_address</td><td>string</td><td>Destination address of withdrawal</td></tr><tr><td>memo</td><td>string</td><td>Memo/tag; unique identification for address</td></tr><tr><td>txid</td><td>string</td><td>Txid</td></tr><tr><td>merchant_order_id</td><td>string</td><td>Order ID in Merchant's system. A unique ID for every order</td></tr></tbody></table>
{% endtab %}

{% tab title="Remarks" %}
Return Appid, Sign, Timestamp in the header of the response.  The signature method SHA-256 (appid+appSecret+Timestamp+body).

Please use the data with caution if the signature verification fails. It indicates that the data has been tampered with.
{% endtab %}
{% endtabs %}

{% hint style="info" %}
Once the merchant has processed the order, please return {http code: 200} and include a “success” string in the HTTP response body.&#x20;

If CCPayment does not receive “success” as a response from the merchant, CCPayment will keep pushing the notification up to 6 times. Any response other than “success” will be regarded as a failure, and CCPayment will keep sending the notification.

{% endhint %}

**Example**

{% tabs %}
{% tab title="PHP" %}

```php
$this->response->setString("success")
```

{% endtab %}

{% tab title="Java" %}

```java
this.response.setString("success");
```

{% endtab %}

{% tab title="Golong" %}

```go
this.response.SetString("success")
```

{% endtab %}

{% tab title="Python" %}

```python
self.response.set_string("success")
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
this.response.setString("success");
```

{% endtab %}
{% endtabs %}

<figure><img src="https://760693906-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKH8CbFKQ8Cydt24cgg2C%2Fuploads%2FZBy5dGy78dZaMoIzia08%2Fimage.png?alt=media&#x26;token=21b0c951-0d67-41a4-aa3c-d04b54fa0946" alt=""><figcaption><p>Response Example</p></figcaption></figure>

{% hint style="warning" %}
Due to scarce objective reasons, merchants may occasionally fail to receive webhook notifications. But such cases are extremely rare. If it involves a refund order, it is recommended that merchants confirm the actual notification delivery status first through the [Order Information Interface](https://doc.ccpayment.com/ccpayment-for-developer/payment-api/order-information-interface) API or the [Webhook Notification Log](https://admin.ccpayment.com/webhook/index) to avoid misjudgment caused by missing notifications.
{% endhint %}
