> ## Documentation Index
> Fetch the complete documentation index at: https://docs.filexpress.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Banks, petty cash funds and checkbooks

> Query the payment sources used to register collections and payments

| Permission | Endpoints |
| - | - |
| `treasury` | `GET /treasury/banks`, `GET /treasury/petty-cashes`, `GET /treasury/checkbooks` |
| `treasury.write` | Create and edit: see [Create and edit banks, petty cash funds and checkbooks](https://docs.filexpress.app/en/docs/api/tesoreria-alta.md) |

> [!NOTE]
>
> This is an **explicit** permission (it includes bank balances): it must be checked in **External integrations**; existing integrations do not receive it automatically.

Read-only endpoints with the company's banks, petty cash funds and checkbooks. Their `id` values are the ones you send when registering:

* [Customer collections](https://docs.filexpress.app/en/docs/api/cuentas-por-cobrar.md#register-payment): `bank_id` or `petty_cash_id`.
* [Supplier payments](https://docs.filexpress.app/en/docs/api/cuentas-por-pagar.md#register-payment): `bank_id`, `petty_cash_id`, `checkbook_id`.

Only records of the API key's company are returned; deleted ones do not appear.

## Banks

```http theme={null}
GET /treasury/banks
```

```bash theme={null}
curl https://api.filexpress.app/api/external/v1/treasury/banks \
  -H "X-API-Key: fx_xxxxxxxx"
```

```json theme={null}
{
  "status": true,
  "data": [
    {
      "id": "3f1c...",
      "name": "Banco Agrícola - Corriente",
      "account_number": "0012-345678-9",
      "balance": 15420.35
    }
  ]
}
```

| Field | Description |
| - | - |
| `balance` | Current balance recorded in FileXpress (includes deposits from collections and applied payments). |

## Petty cash funds

```http theme={null}
GET /treasury/petty-cashes
```

```json theme={null}
{
  "status": true,
  "data": [
    { "id": "8b2e...", "name": "Caja chica Sucursal Centro", "balance": 250.00 }
  ]
}
```

> [!TIP]
>
> Use `petty_cash_id` in a supplier payment or in a customer collection whose payment method is cash.

## Checkbooks

```http theme={null}
GET /treasury/checkbooks?bank_id={bank_id}&status=ACTIVE
```

| Parameter | Type | Required | Description |
| - | - | - | - |
| `bank_id` | string | No | Only the checkbooks of that bank. |
| `status` | string | No | `ACTIVE`, `EXHAUSTED` or `CANCELLED`. |

```json theme={null}
{
  "status": true,
  "data": [
    {
      "id": "c71a...",
      "bank_id": "3f1c...",
      "name": "Chequera 2026",
      "code": "A",
      "start_number": 1,
      "end_number": 100,
      "current_number": 37,
      "status": "ACTIVE"
    }
  ]
}
```

> [!TIP]
>
> For a payment by check, send the `checkbook_id` of an `ACTIVE` checkbook and the `check_number`.

## Errors

| Code | When |
| - | - |
| `401` | Missing or invalid API key. |
| `403` | The integration does not have the `treasury` permission. |
| `422` | `status` with a value other than `ACTIVE`, `EXHAUSTED` or `CANCELLED`. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.