# Balances

## GET Balances

<mark style="color:green;">`POST`</mark> `https://api.finqware.com/v1/balances/get`

Get balances data related to a certain **credentials\_id**.

#### Request Body

| Name                                               | Type   | Description                                                      |
| -------------------------------------------------- | ------ | ---------------------------------------------------------------- |
| client\_id<mark style="color:red;">\*</mark>       | string | An identifier for your tenant app.                               |
| client\_secret<mark style="color:red;">\*</mark>   | string | A tenant app secret.                                             |
| credentials\_id<mark style="color:red;">\*</mark>  | string | A pointer to a consent record created via an onboarding session. |
| access\_token<mark style="color:red;">\*</mark>    | string | An authorization key for this particular consent record.         |
| tenant\_user\_id<mark style="color:red;">\*</mark> | string | A unique identifier for your end-user.                           |
| filter                                             | object | A filter object. Criteria in the table below.                    |

{% tabs %}
{% tab title="200: OK A list of bank account balances and related info." %}

```javascript
[
  {
    "account_id": "69a19df6-../-3bc1bddfd89a",
    "data": {
      // always a positive decimal number.
      // for overdraft/negative balances check the credit_debit_indicator.
      "amount": "210.23",

      // credit   -> positive or zero amount
      // debit    -> negative amount (overdraft)
      "credit_debit_indicator": "credit",

      "credit_limit_included": false,

      "credit_line": null,
      "currency": "RON",

      // `date` returned by the bank for certain balance types (eg: ClosingBooked)
      "native_date": "2018-03-30",
      
      // `date-time` for an intermediate balance (eg: InterimAvailable) 
      // note: potentially null
      "native_timestamp": "2021-10-14T09:00:00Z",
      
      "type": "Expected",
    },
    id: "6aac5b32-...-8f8c5f6c653d",

    // `data-time` when this balance was queried by the Finqware middleware
    timestamp: "2020-01-29T07:31:51.689168",
  },
];
```

{% endtab %}

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

```javascript
// check the errors docs page for details
{
  "id": "uuid",
  "type": "invalid_request",
  "http": 400,
  "code": "invalid_client_id",
  "message": "error message"
}
```

{% endtab %}
{% endtabs %}

| Filter element | Type   | Info                             |
| -------------- | ------ | -------------------------------- |
| account\_id    | string | finqware id for the bank account |
| type           | string | The balance type                 |
| currency       | string | The balance currency             |

```javascript
// Filter example

"filter": {
  "type": "Expected",
  "currency": "RON"
}
```

Finqware always presents at least one type of balance, normalised under the name of ‘Available’ and may also present a normalised ‘Closing’ type, depending on bank data, with the following meaning:

| Balance type | Description                                                                                                                                                                                                                                                                                                 |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Available    | Available balance calculated by the bank in the course of the account servicer's business day, at the time specified, and subject to further changes during the business day. The interim balance is calculated on the basis of booked credit and debit items during the calculation time/period specified. |
| Closing      | Closing balance of amount of money that is cleared on the date specified. Finqware provides a normalised Closing balance only for the accounts where the bank provides an explicit ClosingCleared/ Booked balance for the day.                                                                              |

A more detailed explanation of what each balance means, taking into account other balance parameters, can be found in the following tabel:

| Balance type | Credit\_limit\_included | Credit\_debit\_indicator | Description                                                                                                                                                                                                                                                                                    |
| ------------ | ----------------------- | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Available    | false                   | credit/ positive amount  | account balance representing the amount of money which can be spent                                                                                                                                                                                                                            |
|              |                         | debit/ negative amount   | account balance representing borrowed funds out of the account associated overdraft                                                                                                                                                                                                            |
|              | true                    | credit/ positive amount  | total balance representing the sum between the account balance and the value of the associated overdraft; in correlation with a negative amount for the Available                                                                                                                              |
|              |                         | debit/ negative amount   | NA                                                                                                                                                                                                                                                                                             |
| Closing      | false                   | credit/ positive amount  | account balance representing the accounting balance for the amount of money for the official banking date closing                                                                                                                                                                              |
|              |                         | debit/ negative amount   | account balance representing borrowed funds out of the account associated overdraft, at the moment of the banking day closing                                                                                                                                                                  |
|              | true                    | credit/ positive amount  | total balance representing the sum between the account balance and the value of the associated overdraft; in correlation with a negative amount for the Closing credit\_limit\_included = false, it represents the remaining unused amount of the overdraft, at the closing of the banking day |
|              |                         | debit/ negative amount   | NA                                                                                                                                                                                                                                                                                             |

In addition to the two standardised balance types, Finqware may also present other types of balances retrieved from the bank API:

| Balance type           | Description                                                                                                                                                                                                                                                                                                                                         |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ClosingAvailable       | Closing balance of amount of money that is at the disposal of the account owner on the date specified.                                                                                                                                                                                                                                              |
| ClosingBooked          | Balance of the account at the end of the pre-agreed account reporting period. It is the sum of the opening booked balance at the beginning of the period and all entries booked to the account during the pre-agreed account reporting period.                                                                                                      |
| ClosingCleared         | Closing balance of amount of money that is cleared on the date specified.                                                                                                                                                                                                                                                                           |
| Expected               | Balance, composed of booked entries and pending items known at the time of calculation, which projects the end of day balance if everything is booked on the account and no other entry is posted.                                                                                                                                                  |
| ForwardAvailable       | Forward available balance of money that is at the disposal of the account owner on the date specified.                                                                                                                                                                                                                                              |
| Information            | Balance for informational purposes.                                                                                                                                                                                                                                                                                                                 |
| InterimAvailable       | Available balance calculated in the course of the account servicer's business day, at the time specified, and subject to further changes during the business day. The interim balance is calculated on the basis of booked credit and debit items during the calculation time/period specified.                                                     |
| InterimBooked          | Balance calculated in the course of the account servicer's business day, at the time specified, and subject to further changes during the business day. The interim balance is calculated on the basis of booked credit and debit items during the calculation time/period specified.                                                               |
| InterimCleared         | Cleared balance calculated in the course of the account servicer's business day, at the time specified, and subject to further changes during the business day.                                                                                                                                                                                     |
| OpeningAvailable       | Opening balance of amount of money that is at the disposal of the account owner on the date specified.                                                                                                                                                                                                                                              |
| OpeningBooked          | Book balance of the account at the beginning of the account reporting period. It always equals the closing book balance from the previous report.                                                                                                                                                                                                   |
| OpeningCleared         | Opening balance of amount of money that is cleared on the date specified.                                                                                                                                                                                                                                                                           |
| PreviouslyClosedBooked | Balance of the account at the previously closed account reporting period. The opening booked balance for the new period has to be equal to this balance. Usage: the previously booked closing balance should equal (inclusive date) the booked closing balance of the date it references and equal the actual booked opening balance of the current |


---

# 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.finqware.com/api/balances.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.
