---
name: "books_match_bank_lines"
area: "books"
title: "Match bank lines"
price: "$0.02 per bank line matched"
method: "POST"
url: "https://api.conecto.chat/v1/tools/books_match_bank_lines"
mcp_server: "https://api.conecto.chat/mcp/books"
auth: "Authorization: Bearer <conecto_sk_ key>"
docs_url: "https://conecto.chat/tools/books/books_match_bank_lines"
---

# Match bank lines (`books_match_bank_lines`)

Says what bank lines were: entries already booked, invoices or bills they pay, an account to book them to, or nothing to book.

Say what bank lines were, up to 100 at a time, each one of: entries (entry numbers already booked whose lines on the bank account add up to the line), invoices (the open invoices money in pays: their payments are recorded and posted, the amount spread in the order given unless amounts are given), bills (the open supplier bills money out pays, the same way), account (book it there now, with an optional tax split off: a sale when money came in, a cost when it went out), rule (book it the way a bank rule says), ignore (not for the books, e.g. a duplicate), or unmatch (undo; a line booked to an account is reversed). Each line succeeds or fails on its own; only those done are charged.

Price: $0.02 per bank line matched. A call that fails costs nothing.

## Use it when

Bank lines wait to be matched (books_bank_lines); pass a suggestion's match as it is.

## Say this to your agent

> The 238 euros to Hamburg Energie is the electricity we booked, and the 89.25 to Würth is warehouse supplies with 19% VAT.

## Inputs

| Name | Type | Required | Description | Allowed values | Default |
|---|---|---|---|---|---|
| `matches` | array of objects | yes | 1 to 100 items. |  |  |
| `matches[].line_id` | integer | yes, in each item of `matches` | At least 1. |  |  |
| `matches[].entries` | array of integers | no | 1 to 20 items. |  |  |
| `matches[].invoices` | array of objects | no | 1 to 20 items. |  |  |
| `matches[].invoices[].invoice_id` | string | yes, in each item of `matches[].invoices` | Exactly 36 characters. |  |  |
| `matches[].invoices[].amount` | number or string | no | Up to 24 characters. |  |  |
| `matches[].bills` | array of objects | no | 1 to 20 items. |  |  |
| `matches[].bills[].bill_id` | string | yes, in each item of `matches[].bills` | Exactly 36 characters. |  |  |
| `matches[].bills[].amount` | number or string | no | Up to 24 characters. |  |  |
| `matches[].account` | string | no | An account code from the chart, e.g. "6600". 1 to 20 characters. |  |  |
| `matches[].tax` | string | no | A tax by name (books_get lists them), e.g. "VAT 19%". Up to 60 characters. |  |  |
| `matches[].description` | string | no | Up to 300 characters. |  |  |
| `matches[].rate` | number or string | no | One unit of currency in the base currency, e.g. "0.9241". Default: a standing rate, else the European Central Bank's reference rate for the date. Up to 24 characters. |  |  |
| `matches[].rule` | string | no | A bank rule by name (books_list_bank_rules). Up to 80 characters. |  |  |
| `matches[].tracking` | object | no | Tracking options by category, e.g. {"Department": "Service"} (books_list_tracking). |  |  |
| `matches[].ignore` | boolean | no |  |  |  |
| `matches[].unmatch` | boolean | no |  |  |  |

## Example

Written for Hansen & Voss, a restaurant-equipment wholesaler in Hamburg with 60 staff.

MCP: call `books_match_bank_lines` on the MCP server `https://api.conecto.chat/mcp/books` with these arguments:

```json
{
  "matches": [
    {
      "line_id": 41,
      "entries": [
        58
      ]
    },
    {
      "line_id": 42,
      "account": "8000",
      "tax": "VAT 19%",
      "description": "Packing tape for the warehouse"
    }
  ]
}
```

REST:

```bash
curl https://api.conecto.chat/v1/tools/books_match_bank_lines \
  -H "Authorization: Bearer $CONECTO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"matches": [{"line_id": 41, "entries": [58]}, {"line_id": 42, "account": "8000", "tax": "VAT 19%", "description": "Packing tape for the warehouse"}]}'
```

## Response

```json
{
  "call_id": "5f0c8a2e-3b7d-4c1e-9a64-2d8e1f7b0c93",
  "tool": "books_match_bank_lines",
  "status": "succeeded",
  "replayed": false,
  "cost_usd": "$0.04",
  "balance_usd": "$19.75",
  "result": {
    "results": [
      {
        "line_id": 4101,
        "account": "1010",
        "date": "2026-10-05",
        "amount": "-238.00",
        "currency": "EUR",
        "description": "Strom Lager Oktober",
        "counterparty": "Hamburg Energie",
        "reference": null,
        "status": "matched",
        "entries": [
          1
        ]
      },
      {
        "line_id": 4102,
        "account": "1010",
        "date": "2026-10-06",
        "amount": "-89.25",
        "currency": "EUR",
        "description": "Packband Lager",
        "counterparty": "Würth",
        "reference": null,
        "status": "matched",
        "entries": [
          3
        ]
      }
    ],
    "done": 2,
    "failed": 0
  }
}
```

`result`: results: each line as it now is (or its error), in the order sent; done and failed counts.

## Errors

| Code | Status | When | Fix |
|---|---|---|---|
| `no_books` | 409 | The business keeps no books yet. | Set them up with books_setup (base currency, start date). |
| `currency_mismatch` | 409 | In results, for one line: it and its match are in different currencies. | Record the payment with invoices_record_payment or purchasing_pay_bill instead. |
| `amount_mismatch` | 409 | In results, for one line: the entries, invoices or bills do not add up to it. | Give amounts, or pick the right records. |
| `already_matched` | 409 | In results, for one line: the line is matched already, or the entry is matched to another bank line. | Unmatch that line first. |
| `already_ignored` | 409 | In results, for one line: the line was ignored. | Unmatch it first. |
| `not_matched` | 409 | In results, for one line: unmatch was asked of a line that is not matched. | Leave it as it is. |
| `reversed` | 409 | In results, for one line: the entry is reversed, so nothing is left to match. | Match another entry. |
| `not_posting` | 409 | In results, for one line: invoices or bills do not post to the books, so their payments cannot be matched. | Turn post_invoices on with books_setup. |
| `wrong_account` | 409 | In results, for one line: payments of that kind do not land on the line's bank account. | Map a payment method to it with books_setup payment_accounts. |
| `invalid_input` | 400 | In results, for one line: no way to match it was given, money in was matched to bills (or money out to invoices), or the booking does not balance. | Give one of entries, invoices, bills, account, rule, ignore or unmatch. |
| `not_found` | 404 | In results, for one line: the line, entry, invoice, bill, account, tax or rule is unknown. | Use ids from books_bank_lines and its suggestions. |
| `no_match` | 409 | In results, for one line: the rule given does not match the line. | Pick the rule its suggestions name, or book it to an account. |
| `rule_broken` | 409 | In results, for one line: the rule books to an account that was archived or is gone. | Change the rule with books_save_bank_rule. |

The refusals every tool can give (401 key, 402 balance, 429 limits) are on the errors page: https://conecto.chat/docs/errors.md

## Related

- [books_setup](https://conecto.chat/tools/books/books_setup.md): Starts the business's double-entry books (currency, start date, chart of accounts) or changes their settings. $0.001 a call.
- [books_get](https://conecto.chat/tools/books/books_get.md): The books' settings: currency, start date, fiscal year, locked period, roles, payment accounts, taxes, and what is waiting. Free up to 1,000,000 reads a month.
- [books_list_accounts](https://conecto.chat/tools/books/books_list_accounts.md): Every account with its code, type, role and balance on a day. Free up to 1,000,000 reads a month.
- [books_save_accounts](https://conecto.chat/tools/books/books_save_accounts.md): Adds accounts or changes them, matched by code: name, type, description, code, role or archived. $0.001 a call.
- [books_save_tax](https://conecto.chat/tools/books/books_save_tax.md): Adds or changes a tax rate the books use (VAT, GST, sales tax), matched by name. $0.001 a call.
- [books_record_expense](https://conecto.chat/tools/books/books_record_expense.md): Books a cost the business paid, with its tax split off and the receipt attached. $0.01 a call.
- [books_record_entry](https://conecto.chat/tools/books/books_record_entry.md): Books a journal entry of two or more balancing lines, for whatever the other tools do not cover. $0.01 a call.
- [books_attach_receipt](https://conecto.chat/tools/books/books_attach_receipt.md): Attaches a receipt from the file store to an entry that has none. $0.01 a call.
- [books_reverse_entry](https://conecto.chat/tools/books/books_reverse_entry.md): Undoes an entry by booking its mirror image; entries are never edited or deleted. $0.01 a call.
- [books_list_entries](https://conecto.chat/tools/books/books_list_entries.md): Entries, newest first, with their lines, by dates, account, source or text. Free up to 1,000,000 reads a month.
- [books_import_bank](https://conecto.chat/tools/books/books_import_bank.md): Reads a bank statement from the file store (CSV, CAMT.053 or OFX) onto a bank account, skipping lines imported before. Free.
- [books_bank_lines](https://conecto.chat/tools/books/books_bank_lines.md): Imported bank lines (by default the ones still to match), each with up to three suggestions of what it was. Free up to 1,000,000 reads a month.
- [books_save_bank_rule](https://conecto.chat/tools/books/books_save_bank_rule.md): Saves a bank rule, like Xero's: which new bank lines it matches and how they are booked, to one account or split by percent, each part with its own tax. $0.001 a call.
- [books_list_bank_rules](https://conecto.chat/tools/books/books_list_bank_rules.md): Lists the bank rules in the order they are tried, with where they book and how often they were used. Free up to 1,000,000 reads a month.
- [books_apply_bank_rules](https://conecto.chat/tools/books/books_apply_bank_rules.md): Books every new bank line a rule matches, each by the first rule that matches. $0.02 per bank line booked.
- [books_delete_bank_rule](https://conecto.chat/tools/books/books_delete_bank_rule.md): Deletes a bank rule; what it booked stays booked. Free.
- [books_report](https://conecto.chat/tools/books/books_report.md): A report: profit and loss, balance sheet, trial balance, ledger, tax, the VAT or OSS return, the cash flow ahead or a snapshot of the business. Free up to 1,000,000 reads a month.
- [books_save_tracking](https://conecto.chat/tools/books/books_save_tracking.md): Saves a tracking category with its options, like Xero's: a department, a region or a project line that any line of the books can carry. $0.001 a call.
- [books_list_tracking](https://conecto.chat/tools/books/books_list_tracking.md): Lists the tracking categories and their options. Free up to 1,000,000 reads a month.
- [books_save_budget](https://conecto.chat/tools/books/books_save_budget.md): Saves a budget per income and expense account and month, like Xero's budget manager: amounts, monthly or yearly. $0.001 a call.
- [books_list_budgets](https://conecto.chat/tools/books/books_list_budgets.md): Lists the budgets with every line's monthly amounts and total. Free up to 1,000,000 reads a month.
- [books_delete_budget](https://conecto.chat/tools/books/books_delete_budget.md): Deletes a budget; the books don't change. Free.
- [books_repay_claims](https://conecto.chat/tools/books/books_repay_claims.md): Pays someone back for costs they paid with their own money (expense claims), like Xero's, with a SEPA file when asked. $0.01 a call.
- [books_list_claims](https://conecto.chat/tools/books/books_list_claims.md): Lists expense claims: what people paid for the business privately, and what each is owed. Free up to 1,000,000 reads a month.
- [books_save_asset](https://conecto.chat/tools/books/books_save_asset.md): Registers a fixed asset (a van, a machine) and how it depreciates, like Xero's: straight line, declining balance, at once or not at all. $0.001 a call.
- [books_list_assets](https://conecto.chat/tools/books/books_list_assets.md): The fixed asset register: each asset's cost, accumulated depreciation and book value, what a run would book now, and the register held against the books. Free up to 1,000,000 reads a month.
- [books_depreciate](https://conecto.chat/tools/books/books_depreciate.md): Books the depreciation of every registered asset through a month's end, one entry a month, like Xero's run depreciation; or undoes it after a date. $0.01 a call.
- [books_dispose_asset](https://conecto.chat/tools/books/books_dispose_asset.md): Sells or writes off a fixed asset, like Xero's dispose: depreciation to the day it goes, then its cost, the price and the gain or loss. $0.01 a call.
- [books_delete_asset](https://conecto.chat/tools/books/books_delete_asset.md): Takes an asset registered by mistake out of the register; the books don't change. Free.
- [books_lock](https://conecto.chat/tools/books/books_lock.md): Locks the books through a date, so nothing new is booked on or before it; null unlocks. $0.001 a call.
- [books_close_year](https://conecto.chat/tools/books/books_close_year.md): Closes a fiscal year for good: nothing is booked on or before its last day again, and it can't be undone. $0.001 a call.
- [books_export](https://conecto.chat/tools/books/books_export.md): A CSV of the journal or the accounts, a DATEV Buchungsstapel for a German tax adviser or a French FEC, with a download link. $0.001 a call.
