Bookkeeping

Match bank lines

books_match_bank_lines · Changes data · Markdown

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

$0.02 per bank line matched

From your agent’s balance. A call that fails costs nothing.

An example

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

Your agent callsbooks_match_bank_lines$0.02 per bank line matched

The example business is Hansen & Voss, a restaurant-equipment wholesaler in Hamburg with 60 staff. The reply is the one the tool really gives.

With these arguments
{
  "matches": [
    {
      "line_id": 41,
      "entries": [
        58
      ]
    },
    {
      "line_id": 42,
      "account": "8000",
      "tax": "VAT 19%",
      "description": "Packing tape for the warehouse"
    }
  ]
}
What comes back
{
  "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
}

Use it when

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

What it does

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.

What comes back

results: each line as it now is (or its error), in the order sent; done and failed counts. Every reply also carries cost_usd and balance_usd.

Inputs

NameTypeWhat it is
matchesRequiredarray of objects1 to 100 items.
matches[].line_idRequiredintegerAt least 1.
matches[].entriesarray of integers1 to 20 items.
matches[].invoicesarray of objects1 to 20 items.
matches[].invoices[].invoice_idRequiredstringExactly 36 characters.
matches[].invoices[].amountnumber or stringUp to 24 characters.
matches[].billsarray of objects1 to 20 items.
matches[].bills[].bill_idRequiredstringExactly 36 characters.
matches[].bills[].amountnumber or stringUp to 24 characters.
matches[].accountstringAn account code from the chart, e.g. "6600". 1 to 20 characters.
matches[].taxstringA tax by name (books_get lists them), e.g. "VAT 19%". Up to 60 characters.
matches[].descriptionstringUp to 300 characters.
matches[].ratenumber or stringOne 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[].rulestringA bank rule by name (books_list_bank_rules). Up to 80 characters.
matches[].trackingobjectTracking options by category, e.g. {"Department": "Service"} (books_list_tracking).
matches[].ignoreboolean
matches[].unmatchboolean

The call

Over MCP, call books_match_bank_lines on https://api.conecto.chat/mcp/books. Over REST:

Terminal
curl -X POST 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"}]}'

When it refuses

A refused call costs nothing and says what to do next.

CodeWhenWhat to do
no_books409The business keeps no books yet.Set them up with books_setup (base currency, start date).
currency_mismatch409In 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_mismatch409In results, for one line: the entries, invoices or bills do not add up to it.Give amounts, or pick the right records.
already_matched409In results, for one line: the line is matched already, or the entry is matched to another bank line.Unmatch that line first.
already_ignored409In results, for one line: the line was ignored.Unmatch it first.
not_matched409In results, for one line: unmatch was asked of a line that is not matched.Leave it as it is.
reversed409In results, for one line: the entry is reversed, so nothing is left to match.Match another entry.
not_posting409In 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_account409In 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_input400In 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_found404In 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_match409In 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_broken409In results, for one line: the rule books to an account that was archived or is gone.Change the rule with books_save_bank_rule.

Give this to your agent.

Set up Conecto from https://conecto.chat/SKILL.md