# Asset Balance Interface

## Return balance of target token

<mark style="color:green;">`POST`</mark> `https://admin.ccpayment.com/ccpayment/v1/assets`

Return the balance of the target token

#### Headers

| Name                                           | Type   | Description                                                                                                                                                                                                                   |
| ---------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Appid<mark style="color:red;">\*</mark>        | string | Merchant's unique credential. Find it on the [Developer page](https://admin.ccpayment.com/developer/config).                                                                                                                  |
| Timestamp<mark style="color:red;">\*</mark>    | string | Timestamp in seconds (10-digit). The request is valid for two minutes.                                                                                                                                                        |
| Sign<mark style="color:red;">\*</mark>         | string | SHA-256 (APPID + APP Secret +timestamp+<mark style="color:red;">**body (json string)**</mark>). [Signature guide](https://doc.ccpayment.com/~/changes/HSMg9pcC4k6HIczMjOvx/ccpayment-for-developer/to-get-started/signature). |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json; charset=utf-8                                                                                                                                                                                               |

#### Request Body

| Name     | Type   | Description                                                                                                                                                                                                                                                                  |
| -------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| coin\_id | string | <p>Coin ID for the target coin. Get coin id by <a href="/pages/w74ZGEfgyTo3BYvP4ebC">calling interface</a> or checking it <a href="https://bit.ly/CCsupportedcoins">on the sheet</a><br>Get the balance of all assets if no parameters are included in the request body.</p> |

{% tabs %}
{% tab title="200: OK Success (200)/Fail (201)" %}
{% tabs %}
{% tab title="Success (200)" %}

#### Response

#### Header

#### Body

```json
{
    "code": 10000,
    "msg": "success",
    "data": {
        "list": [
            {
                "coin_id": "8e5741cf-6e51-4892-9d04-3d40e1dd0128",
                "crypto": "USDT",
                "name": "Tether USD",
                "value": "127.9514",
                "price": "1",
                "logo": "https://resource.cwallet.com/token/icon/usdt.png"
            }
        ]
    }
}
```

#### Parameters

{% endtab %}

{% tab title="Fail (201)" %}

```json
{
    "code": 224066,
    "msg": "service err, please try again"
}
```

{% endtab %}

{% tab title="Remarks" %}
As a security measure, we will sign the returned data (and according to this only { code: 10000 } should be signed, but it's signing all the returned body.). Additionally, it will 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 %}
{% endtab %}
{% endtabs %}

<table><thead><tr><th width="175">Name</th><th width="296">Value</th><th width="105" data-type="checkbox">Required</th><th width="87">Type</th><th width="175">Description</th></tr></thead><tbody><tr><td>code</td><td>10000</td><td>true</td><td>Integer</td><td></td></tr><tr><td>msg</td><td>Success</td><td>true</td><td>String</td><td></td></tr><tr><td>data</td><td></td><td>true</td><td>Object</td><td></td></tr><tr><td>data.list</td><td></td><td>true</td><td>array</td><td></td></tr><tr><td>data.list.coin_id</td><td>8e5741cf-6e51-4892-9d04-3d40e1dd0128</td><td>true</td><td>String</td><td>Token ID of the target token</td></tr><tr><td>data.list.crypto</td><td>USDT</td><td>true</td><td>String</td><td>Token symbol</td></tr><tr><td>data.list.name</td><td>Tether USD</td><td>true</td><td>string</td><td>Token fullname</td></tr><tr><td>data.list.value</td><td>127.9514</td><td>true</td><td>string</td><td>Balance of the target token</td></tr><tr><td>data.list.price</td><td>1</td><td>true</td><td>string</td><td>Current rate of the target token</td></tr><tr><td>data.list.logo</td><td><a href="https://resource.cwallet.com/token/icon/usdt.png">https://resource.cwallet.com/token/icon/usdt.png</a></td><td>true</td><td>string</td><td>Token icon</td></tr></tbody></table>

<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>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>

### Request Body Example

```json
{
	"coin_id": "8e5741cf-6e51-4892-9d04-3d40e1dd0128"
}
```

###


---

# 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/resources-document/asset-balance-interface.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.
