# 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="/files/cGmzYqFhG3WWqP8yXg6S" 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ccpayment.com/ccpayment-v1.0-api/webhook-notification/refund-webhook-notification.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
