---
title: "Bank rules"
description: "Automate categorization of expenses and bank transactions with rules by vendor, description, amount or reference, and rules suggested by Frihet."
canonical_url: "https://docs.frihet.io/en/finanzas/reglas-bancarias"
language: "en"
---

# Bank rules

Bank rules automatically categorize your expenses and imported bank transactions according to criteria you define. You define the rule once and Frihet applies it to matching transactions.

Go to **Settings** → **Bank rules**.

## Prerequisites and when to use a bank rule {#requisitos-reglas-bancarias}

Before creating automatic rules inside your bank reconciliation workflow, keep the following in mind:

- **Bank account and prior statement**: Have at least one imported batch or know the recurring concept strings that appear on your bank statement (see [Bank connections and statement import](./conexiones-bancarias#ejemplo-extracto-sintetico)).
- **Bank rules (`categorized`) vs. Invoice reconciliation (`matched`)**:
  - Use **Bank rules** for recurring charges without an individual invoice or with a fixed statement pattern: account maintenance fees (`-12,50 €`), SaaS subscriptions (`GOOGLE`, `AWS`), utilities, or insurance. The rule assigns an accounting category, tax rate, and deductibility, moving the transaction to **Categorized** (`categorized`).
  - Use **Bank reconciliation** (**Finance** → **Banking** → **Transactions**) when the movement settles an issued invoice (for example, the `1.815,00 €` transfer from `Estudio Norte S.L.` for invoice `F-2026-0001`) or a recorded supplier bill with its document number, so it transitions to **Reconciled** (`matched`) and updates the document's open balance.

:::note Verifiable synthetic fixture (does not represent a live bank transfer)
The details for `Estudio Norte S.L.` (tax ID `B12345674`, email `facturacion@example.com`, invoice `F-2026-0001`) and the statement entries cited in this guide are a synthetic documentation fixture. Tax ID `B12345674` only passes algorithmic check-digit validation (it does not prove non-existence or ownership in the AEAT census) and `example.com` is an IANA-reserved domain (RFC 6761). Bank rules classify ledger entries inside your Frihet account and never execute real bank transfers.
:::

## How they work

Each rule has:

1. **Conditions**: when it applies (vendor, description, amount or reference).
2. **Actions**: what Frihet assigns when they are met (category, tax rate, deductible, notes, tags).

Frihet evaluates rules in priority order. With **All** logic every condition must be met; with **Any**, one is enough.

**Example:**

```
Rule: "Google"
  Condition: Description contains "GOOGLE"
  Action: Category → Software
```

## Create a rule

1. Go to **Settings** → **Bank rules**.
2. Click **Create Rule** (or **Create first rule** if you have none yet).
3. Enter a **Rule name**, add conditions and choose the actions.
4. Save.

While you define the conditions, Frihet shows how many of your existing expenses the rule would match. Conditions and actions are detailed in [Bank rule builder](./reglas-bancarias-constructor).

## Verifiable example: rule for bank fees and recurring charges {#ejemplo-regla-conciliacion}

In the [synthetic statement imported in the previous step](./conexiones-bancarias#ejemplo-extracto-sintetico), row `2026-10-18` records the charge `COMISION MANTENIMIENTO CUENTA OCT` for `-12,50 €` with reference `COM-202610-01`. To avoid classifying this fee manually every month:

1. Open **Settings** → **Bank rules** and click **Create Rule**.
2. Configure the rule with these verifiable values:

| Field                  | Configured value                                      |
| ---------------------- | ----------------------------------------------------- |
| **Rule name**          | `Comisiones bancarias mensuales`                      |
| **Condition logic**    | `All` (`AND`)                                         |
| **Condition 1**        | `Description` → `Contains` → `COMISION MANTENIMIENTO` |
| **Condition 2**        | `Amount` → `Less than` → `0` (outflows/charges only)  |
| **Action: Category**   | `Servicios bancarios y financieros`                   |
| **Action: Tax rate**   | `Exempt / 0%` (financial fees exempt from VAT)        |
| **Action: Deductible** | `Yes` (deductible expense for corporate / income tax) |
| **Action: Tag**        | `comision-banco`                                      |
| **Auto-apply**         | Enabled (`true`)                                      |

3. Save the rule. Whenever you import the next CSV/OFX/MT940/CAMT.053 statement (or apply the rule to pending movements under **Finance** → **Banking** → **Transactions**), any charge whose description contains `COMISION MANTENIMIENTO` automatically transitions from `pending` to **Categorized** (`categorized`) and flows directly into **Reports** → **Expenses** (`/reports/expenses`).

### API and MCP automation {#automatizacion-via-api-y-mcp}

If you manage rules through integrations or AI agents, you can list and create rules using the MCP tools `frihet_bank_rules_list` and `frihet_bank_rule_create` (and categorize individual transactions via `PATCH /v1/banking/transactions/{transactionId}/categorize` in the [REST API](/desarrolladores/api-rest)):

```json
{
  "name": "Comisiones bancarias mensuales",
  "matchMode": "all",
  "conditions": [
    { "field": "description", "operator": "contains", "value": "COMISION MANTENIMIENTO" },
    { "field": "amount", "operator": "lt", "value": 0 }
  ],
  "actions": {
    "category": "Servicios bancarios y financieros",
    "taxRate": 0,
    "deductible": true,
    "tags": ["comision-banco"]
  },
  "autoApply": true
}
```

## Priority order

Change a rule's order with **Move up** and **Move down**. Put more specific rules before generic ones: a "GOOGLE ADS" rule must come before a general "GOOGLE" rule.

## Suggested rules

Frihet analyzes your expenses and proposes rules under **Suggested Rules**. Click **Accept** to create the proposed rule, or click **Dismiss** to discard it.

## Enable, disable and auto-apply

Each rule can be enabled or disabled without deleting it; a disabled rule stops applying until you re-enable it. The **Auto-apply** option applies the rule when importing transactions.

To remove a rule entirely, use **Delete Rule**.

## Real limits of bank rules {#limites-reglas-bancarias}

- **First-match by priority**: When a transaction satisfies multiple active rules, Frihet applies the highest-priority rule in the list and stops evaluating lower-priority rules to prevent conflicting overwrites.
- **Rules do not replace document-level invoice matching (`matched`)**: A bank rule assigns accounting metadata (`categorized`), but it does not mark a specific issued invoice as paid or create a collection record in **Reports** → **Payments**. Customer collections such as invoice `F-2026-0001` (`1.815,00 €` / `1.590,00 €` / `907,50 €`) must be linked from [Bank reconciliation](./conciliacion-bancaria#recorrido-conciliacion-extracto) or via `match_transaction_to_invoice`.
- **No retroactive changes to closed periods or reconciled movements**: Disabling or deleting a rule does not undo the categorization of past transactions or alter closed fiscal periods.
- **Next step in the walkthrough**: Once recurring fees are categorized and statement invoices are reconciled, verify the final impact in the [Reports center](/informes/centro-informes#verificar-conciliacion-informes).

---

**Previous:** [Bank connections](./conexiones-bancarias) | **Next:** [Bank reconciliation](./conciliacion-bancaria) | [Reports center](/informes/centro-informes#verificar-conciliacion-informes)
