# Subaccount Balance

{% hint style="success" %}
**Your business must have a custodial services agreement with Beta Ramps to use this service.**
{% endhint %}

## Retrieve the balance of an specific asset for a specific account or subaccount

<mark style="color:blue;">`GET`</mark> `https://live.betaapp.com/v1/balance`

#### Query Parameters

| Name                                    | Type   | Description                                             |
| --------------------------------------- | ------ | ------------------------------------------------------- |
| asset<mark style="color:red;">\*</mark> | String | Check Crypto and Fiat capabilities for more information |

#### Headers

| Name                                               | Type   | Description            |
| -------------------------------------------------- | ------ | ---------------------- |
| Authorization<mark style="color:red;">\*</mark>    | String | Bearer {access\_token} |
| x-sub-account-id<mark style="color:red;">\*</mark> | String | Subaccount ID.         |

{% tabs %}
{% tab title="200: OK Sucess" %}

```json
{
  "message": "string",
  "number_of_orders_associated": 0,
  "total_asset": "string",
  "total_amount": 0,
}
```

{% endtab %}

{% tab title="400: Bad Request Error message " %}

```json
{
  "message": "string"
}
```

{% endtab %}
{% endtabs %}

**Request Example:**

{% code overflow="wrap" %}

```json
curl -X 'GET' \
  'https://live.betaapp.com/v1/balance?asset=BRL' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InJlaEF1NURPY...ctfx2I4g'
```

{% endcode %}

**Response Example:**

```json
{
  "total_amount": 18500,
  "total_fees": 185,
  "number_of_orders_associated": 22
}
```

{% hint style="info" %}
The `total_fees` parameter represents the amount in fees that will be discounted during the settlement process.
{% endhint %}


---

# 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.betaramps.com/documentation-beta-ramps/exchange-crypto-to-fiat/subaccount-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.
