# API Deposit 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": "API Deposit",
   "record_id": "202302201213531627642695975706624",
   "order_id": "202302200951001627606736097771520",
   "product_price": "25", 
   "denominated_currency": "USD", //The currency for calculating the order price, it could be cryptocurrency or fiat currency
   "order_amount": "25", 
   //When denominated_currency is set to a fiat currency, order_amount=product_price/fiat_rate/token_rate; 
   //When denominated_currency is set to 'Token', order_amount is the token amount required to pay for the order;
   "fiat_rate": "0.08",
   "paid_amount": "10",
   "token_rate": "0.08",
   //Token paid in USD value = token_rate*paid_amount
   "chain": "BSC",
   "txid": "0xbA2aE424d96...c32edC70B295c744C43",
   "contract": "0xbA2aE424d960c26247Dd6c32edC70B295c744C43",
   "crypto": "DOGE",
   "extend": {
        "merchant_order_id": "202211154785795"
      }
 }
```
</code></pre>

{% endtab %}

{% tab title="Parameters" %}

<table><thead><tr><th width="155.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.<br></td></tr><tr><td>order_type</td><td>string</td><td>API Deposit</td></tr><tr><td>record_id</td><td>string</td><td>Trading record: one transaction generates one unique record_id which can be used to distinguish multiple transactions under one merchant_order_id</td></tr><tr><td>order_id</td><td>string</td><td>CCPayment order ID</td></tr><tr><td>product_price</td><td>string</td><td>Initial pricing (price submitted by merchant or invoice). </td></tr><tr><td>denominated_ currency</td><td>string</td><td>Currency unit of the product price.<br>Call <a href="/pages/VUYNoeUCAdtQ5vH1QbsB">the interface</a> to get all denominated_ currency.</td></tr><tr><td>order_amount</td><td>string</td><td>If the denominated currency is crypto currency, order_amount = product_price; <br>when the denominated currency is fiat currency, order_amount=product_price/fiat_rate/token_rate</td></tr><tr><td>paid_amount</td><td>string</td><td>Token amount actually paid</td></tr><tr><td>fiat_rate</td><td>string</td><td>Fiat tax rate (in USD by default)</td></tr><tr><td>token_rate</td><td>string</td><td>Token price (in USDT by default), Token value in USD = token_rate*paid_amount</td></tr><tr><td>chain</td><td>string</td><td>Used to record the blockchain from which the user deposits.</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>extend</td><td>object</td><td></td></tr><tr><td>extend.merchant_order_id</td><td>string</td><td>Merchant order ID, order_type is the Api type</td></tr><tr><td>custom_value</td><td>string</td><td>Merchant custom field - This custom value field will be returned in the transaction status notification.</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>


---

# 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/api-deposit-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.
