# Direct Deposit to Permanent Address Webhook Notification

### Webhook notification

{% hint style="danger" %}
There are three transaction statuses in the webhook notification under the field name “pay\_status”. CCPayment will credit assets if the pay\_status is “success”, which is ***the one and only status you should consider as the confirmation of the transaction***. The other two pay\_status, “pending” and “processing”, can not be regarded as the confirmation of the transaction.
{% endhint %}

{% 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": "Direct Deposit",
	"record_id": "202307191012191681607895159656448",
	"paid_amount": "666",
	"credit_amount": "665.8002",
	"chain": "BSC",
	"from_address": "0x3E89fcC505xxxxxx6AA4b78fecB3b2d2D8",
	"to_address": "0x3E89fcC5050bCEc6xxxxxx096F386AA4b78f",
	"contract": "0x55d398326f99059ff775485246999027b3197955",
	"crypto": "USDT",
	"txid": "internal transfer",
	"service_fee": "0.1998",
	"memo": "",
	"user_id": "10192128173"
}
```
</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: pending, processing, success, failed<br>pending: The transaction started, it is waiting to be sent out to the blockchain.<br>processing: It’s being processed on the blockchain.</td></tr><tr><td>order_type</td><td>string</td><td>Direct Deposit</td></tr><tr><td>record_id</td><td>string</td><td>Trading record: one transaction generates one unique record_id</td></tr><tr><td>paid_amount</td><td>string</td><td>Received amount</td></tr><tr><td>service_fee</td><td>string</td><td>Service fee charged by CCPayment</td></tr><tr><td>credit_amount</td><td>string</td><td>Amount credited to merchant's account <br>credit_amount=paid_amount-service_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>from_address</td><td>string</td><td>Sending address of the payment</td></tr><tr><td>to_address</td><td>string</td><td>Permanent deposit address for users </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>user_id</td><td>string</td><td>The unique user id of this address</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" %}
The direct deposit webhook notification was only posted the token configured by the merchant was deposited.
{% endhint %}

<figure><img src="/files/SG6bpCvPHtkIHDkFZA2S" alt=""><figcaption></figcaption></figure>

{% 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. <br>

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>


---

# 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/direct-deposit-to-permanent-address-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.
