# Banking

> Bank accounts with imported CAMT.053, MT940 and feed statements, matches of each transaction to invoices, expense reports and accounting entries with suggestions from RF and Dutch payment references, bank rules that book or set aside what they match, and a reconciliation status per account against the ledger.

- Category: Billing & commerce
- Module: `banking`
- Modes: `managed`, `custom`
- Docs: https://bettersupabase.com/docs/blocks/banking
- Page: https://bettersupabase.com/blocks/banking

## Install

```bash
npx better-supabase add banking
```

The command also installs `updated-at`, `memberships`, `permissions`.

## Configure

Add the block to `better-supabase.config.ts`:

```ts
import { defineConfig } from "better-supabase/config";

export default defineConfig({
  blocks: {
    // Required by banking; add installs them too.
    "updated-at": {},
    memberships: {},
    permissions: {},
    // Modes: "managed", "custom". The default is "managed".
    banking: { mode: "managed" },
  },
});
```

## Client

The block has no React entry yet. Its server-side TypeScript is in `better-supabase/blocks/banking`.

## Events

- `bank_statement.imported`
- `bank_transaction.matched`
- `bank_transaction.unmatched`

## Related blocks

Requires: [memberships](https://bettersupabase.com/blocks/memberships.md), [permissions](https://bettersupabase.com/blocks/permissions.md)

Works with: [accounting](https://bettersupabase.com/blocks/accounting.md), [invoices](https://bettersupabase.com/blocks/invoices.md), [expenses](https://bettersupabase.com/blocks/expenses.md), [attachments](https://bettersupabase.com/blocks/attachments.md), [outbox](https://bettersupabase.com/blocks/outbox.md), [audit](https://bettersupabase.com/blocks/audit.md)

## Recipes

- [Bank reconciliation](https://bettersupabase.com/recipes/bank-reconciliation.md): Each bank account's statement balance and what is left to match, then its latest transactions; an unmatched one offers its best invoice to match or can be ignored.
