> For the complete documentation index, see [llms.txt](https://docs.trybit.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.trybit.com/pt/referencia-da-api-v2/balance.md).

# Saldo

O método permite recuperar o saldo da sua conta enviando uma solicitação POST.

### O que o método permite fazer

* Retorna um array dos saldos da sua conta.

### Endpoint

<mark style="color:verde;">`POST`</mark> `https://api.trybit.com/v2/merchant/wallet/balance/all`

### Cabeçalhos

<table><thead><tr><th>Nome</th><th width="249">Tipo</th><th>Exemplo</th><th>Descrição</th></tr></thead><tbody><tr><td>Autorização<mark style="color:vermelho;">*</mark></td><td>string</td><td>Token eyJ0eXAiOiJK&#x3C;...>4npi1ksS8tSY</td><td>Chave de API do projeto</td></tr></tbody></table>

### Corpo da solicitação

Nenhum corpo da requisição é necessário.

### Exemplos de solicitação

Estes exemplos mostram como enviar uma requisição para obter o saldo da conta. Note que o Corpo da Requisição não precisa ser preenchido.

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

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

{% endtab %}

{% tab title="Python" %}

```python
import requests

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

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

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

{% endtab %}

{% tab title="JavaScript" %}

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

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://api.trybit.com/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 'Erro:' . curl_error($ch);
} else {
    $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    if ($statusCode == 200) {
        echo "Sucesso: " . $response;
    } else {
        echo "Falha: " . $statusCode . " " . $response;
    }
}

curl_close($ch);
?>
```

{% endtab %}
{% endtabs %}

### Exemplos de resposta

Uma solicitação bem-sucedida retorna uma resposta com o status `sucesso` e um `resultado` objeto.

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

```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.trybit.com/img/currency/USDT.svg",
               "icon_network": "https://cdn.trybit.com/img/currency_network/USDT_TRC.svg",
               "icon_qr": "https://cdn.trybit.com/img/stroke/USDT_STROKE.svg",
               "order": 1,
               "obj_network": {
                   "code": "TRC20",
                   "id": 4,
                   "icon": "https://cdn.trybit.com/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 %}

### Parâmetros de resposta

O `resultado` objeto contém:

<table><thead><tr><th>Nome</th><th width="249">Tipo</th><th>Exemplo</th><th>Descrição</th></tr></thead><tbody><tr><td>currency</td><td>dict</td><td><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.trybit.com/img/currency/USDT.svg",               "icon_network": "https://cdn.trybit.com/img/currency_network/USDT_TRC.svg",</p><p>               "icon_qr": "https://cdn.trybit.com/img/stroke/USDT_STROKE.svg",</p><p>               "order": 1,               "obj_network": {</p><p>                   "code": "TRC20",</p><p>                   "id": 4,</p><p>                   "icon": "https://cdn.trybit.com/img/network/TRC20.svg",                   "fullname": "Tron"</p><p>               },</p><p>               "enable": true</p><p>           }</p></td><td>Objeto de moeda associado ao saldo</td></tr><tr><td>balance_crypto</td><td>float</td><td>10.0</td><td>Saldo em criptomoeda</td></tr><tr><td>balance_usd</td><td>float</td><td>10.0</td><td>Saldo em USD à taxa de câmbio no momento da requisição</td></tr><tr><td>available_balance</td><td>float</td><td>10.0</td><td>Saldo disponível para levantamento em criptomoeda</td></tr><tr><td>available_balance_usd</td><td>float</td><td>10.0</td><td>Saldo disponível para levantamento em USD</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.trybit.com/pt/referencia-da-api-v2/balance.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
