# Баланс

### Что делает метод

* Возвращает массив балансов вашего аккаунта

### Endpoint

<mark style="color:green;">`POST`</mark> `https://api.cryptocloud.plus/v2/merchant/wallet/balance/all`

### Headers

| Name                                            | Type   | Example                             | Description      |
| ----------------------------------------------- | ------ | ----------------------------------- | ---------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Token eyJ0eXAiOiJK<...>4npi1ksS8tSY | API-ключ проекта |

### Request Body

Тело запроса не требуется

### Примеры запроса

Эти примеры показывают, как можно выполнить запрос для получения для получения баланса аккаунта. Обратите внимание, что заполнять Request Body не требуется.

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

```bash
curl -X POST https://api.cryptocloud.plus/v2/merchant/wallet/balance/all \
     -H "Authorization: Token <API KEY>"
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.cryptocloud.plus/v2/merchant/wallet/balance/all"
headers = {
    "Authorization": "Token <API KEY>"
}

response = requests.post(url, headers=headers)

if response.status_code == 200:
    print("Success:", response.json())
else:
    print("Fail:", response.status_code, response.text)
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
fetch('https://api.cryptocloud.plus/v2/merchant/wallet/balance/all', {
    method: 'POST',
    headers: {
        'Authorization': 'Token <API KEY>'
    }
})
.then(response => {
    if (response.ok) {
        return response.json();
    } else {
        throw new Error('Fail: ' + response.status + ' ' + response.statusText);
    }
})
.then(data => console.log('Success:', data))
.catch(error => console.error('Error:', error));
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://api.cryptocloud.plus/v2/merchant/wallet/balance/all");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);

$headers = array(
    "Authorization: Token <API KEY>",
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
} else {
    $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    if ($statusCode == 200) {
        echo "Success: " . $response;
    } else {
        echo "Fail: " . $statusCode . " " . $response;
    }
}

curl_close($ch);
?>
```

{% endtab %}
{% endtabs %}

### Пример ответа

На успешный запрос приходит ответ со статусом success и объектом result.

{% tabs %}
{% tab title="200: OK – Balance" %}

```json
{
   "status": "success",
   "result": [
       {
           "currency": {
               "id": 4,
               "code": "USDT_TRC20",
               "short_code": "USDT",
               "name": "Tether",
               "is_email_required": false,
               "stablecoin": true,
               "icon_base": "https://cdn.cryptocloud.plus/img/currency/USDT.svg",
               "icon_network": "https://cdn.cryptocloud.plus/img/currency_network/USDT_TRC.svg",
               "icon_qr": "https://cdn.cryptocloud.plus/img/stroke/USDT_STROKE.svg",
               "order": 1,
               "obj_network": {
                   "code": "TRC20",
                   "id": 4,
                   "icon": "https://cdn.cryptocloud.plus/img/network/TRC20.svg",
                   "fullname": "Tron"
               },
               "enable": true
           },
           "balance_crypto": 10.0,
           "balance_usd": 10.0,
           "available_balance": 10.0,
           "available_balance_usd": 10.0
       },
…
]
}
```

{% endtab %}
{% endtabs %}

### Параметры ответа

Объект `result` содержит:

| Name                    | Type  | Example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Description                                          |
| ----------------------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| currency                | dict  | <p>"currency": {</p><p>               "id": 4,</p><p>               "code": "USDT\_TRC20",             "short\_code": "USDT",</p><p>               "name": "Tether",               "is\_email\_required": false,               "stablecoin": true,               "icon\_base": "<https://cdn.cryptocloud.plus/img/currency/USDT.svg>",               "icon\_network": "<https://cdn.cryptocloud.plus/img/currency_network/USDT_TRC.svg>",</p><p>               "icon\_qr": "<https://cdn.cryptocloud.plus/img/stroke/USDT_STROKE.svg>",</p><p>               "order": 1,               "obj\_network": {</p><p>                   "code": "TRC20",</p><p>                   "id": 4,</p><p>                   "icon": "<https://cdn.cryptocloud.plus/img/network/TRC20.svg>",                   "fullname": "Tron"</p><p>               },</p><p>               "enable": true</p><p>           }</p> | Объект валюты, к которой относится баланс            |
| balance\_crypto         | float | 10.0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Баланс в криптовалюте                                |
| balance\_usd            | float | 10.0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Баланс в USD, по курсу в момент формирования запроса |
| available\_balance      | float | 10.0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Доступный к выводу баланс в криптовалюте             |
| available\_balance\_usd | float | 10.0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Доступный к выводу баланс в USD                      |

> Мы регулярно работаем над улучшением документации сервиса для разработчиков. Пожалуйста, оцените качество и полезность материалов [по ссылке](https://survey.zohopublic.eu/zs/G6TdRh).


---

# 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.cryptocloud.plus/ru/api-reference-v2/balance.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.
