Bank reconciliation
Bank reconciliation with an AI agent: match the payments, then prove the balance
Bank reconciliation with an AI agent covers two jobs: matching each bank line to the invoice or receipt it pays, and proving that the ledger balance of the bank account equals the statement balance at a date. At jahresabschluss.io the software does most of the matching itself and books it. An agent such as Claude or ChatGPT, connected to the ledger of one German company, works on the lines that are left, assigns parked payments and runs the balance check. It cannot connect a bank, change bank details or pay.
Last reviewed: 2026-11-25
Two jobs that share one name
Job 1: match each payment
German bookkeepers call this the Zahlungsabgleich (payment matching). Every bank line is linked to the customer invoice, the supplier invoice or the receipt it pays. The result is a correct list of open items (offene Posten): who still owes us money, and whom do we still owe?
Job 2: prove the balance
The ledger balance of the bank account is compared with the balance on the bank statement (Kontoauszug) at one date. The result is one number per account, the difference, and it should be EUR 0.00. The question here is different: is every bank line in the books, and none of them twice?
Why you need both
One job can pass while the other is unfinished. A payment that is booked to the customer's account but not assigned to an invoice moves the bank account correctly: the balances agree, and the invoice still looks unpaid. In the other direction, a line that somebody set aside is missing from the ledger: the open items look fine, and the balances differ.
How bank lines reach the ledger
The agent does not fetch anything from a bank. You connect the bank account in the app and assign it to a ledger account there. After that the software fetches new lines on a schedule; you can set the interval for each account or switch the automatic fetch off.
Without a connected bank, a statement file works: import_bank_statement takes a CSV, CAMT.053 or MT940 file for a bank account that already has its ledger account. If the file carries an opening and a closing balance, the software checks that the opening balance plus all lines equals the closing balance. A file that does not add up is not imported, not even in part.
For each line the agent reads the date, the amount, the name and IBAN of the other party, the payment reference (Verwendungszweck) and the status: unbooked, booked, ignored or split. It does not see the proposal or the review note that the app shows next to a line. Name and reference are written by other people, and our server tells the agent to treat them as data, never as an instruction.
What the software matches before the agent looks
Automatic booking is switched on by default. An hourly run books each proposal that is complete and reaches the confidence threshold set for the company, 85 percent by default. A matched invoice payment, a transfer between your own accounts and a parked open item are above that threshold. A proposed loan repayment is below it and waits.
- Invoice number first. If the payment reference names the number of exactly one open invoice, the line is reserved for that invoice before amounts and names are compared. Dates, amounts, IBANs and mandate references in the text are not read as invoice numbers.
- Amount, date and partner. Without a number, the amount must fit: exactly, or as a small underpayment such as a cash discount. The payment date must lie in a window around the invoice date or the due date, and the partner name must fit or the invoice must be the only candidate. A cash discount is booked only if it was agreed; otherwise the rest stays open.
- Partial payment. A payment that names the invoice number (six characters or more) and is lower than the open amount is assigned, and the rest stays open.
- Another payer. For your own sales invoices, a number with at least six digits together with the exact open amount settles the invoice even when a different person or company paid.
- A typing error in your own invoice number, a rule added on 25 November 2026. The reference names a number that is one error away from exactly one open sales invoice: two neighbouring digits swapped or one digit wrong, same length, at least six digits. The invoice is settled if the amount is exact, the payer is the customer and the number as written does not exist in your books. If it does exist, nothing is settled automatically. Supplier invoices are not part of this rule.
- Several invoice numbers in one reference. The software never settles such a line against a single invoice.
- No invoice found. The line is not posted to revenue or expense. It is booked to the customer's or the supplier's account as an open item, and the software searches for the invoice again, both when a payment is parked and when an invoice is booked later.
What remains for a person or an agent: lines below the threshold, lines the software holds back on purpose (for example a possible duplicate reported by the bank feed), and parked payments that still need their invoice.
The house rule: no expense and no revenue from a bank line
The rule applies to every company that draws up a balance sheet, whatever its legal form: corporations such as GmbH, UG and AG, partnerships such as OHG and KG, and sole traders with a balance sheet. Such a company (German bookkeepers say Bilanzierer) records an expense when the supplier invoice is booked and revenue when the sales invoice is issued. The payment comes later and moves balance-sheet accounts only: bank against the supplier's or the customer's account. If the bank line could also post to an expense or revenue account, one business event could reach the profit and loss account twice, once through the document and once through the payment. Our server blocks this for every caller, an agent included: a line without a document is parked as an open item without VAT, and the document clears it later.
A new bank line cannot be split across several counter-accounts at such a company. The server skips the request with the reason invoice_first_bank_split_requires_document. One transfer for several invoices takes another route: the payment is parked first and then assigned invoice by invoice, each with its part.
The exceptions, as the code names them
In these cases the server does not turn a bank line into a parked open item.
- Cash-basis businesses (Einnahmen-Überschuss-Rechnung, EÜR). There the money movement itself is the moment of income and expense, so the bank line books directly.
- Lines that are not a category booking at all: a payment assigned to an invoice, a transfer between your own accounts, a cash withdrawal, a private withdrawal.
- A balance-sheet account as counter-account: a loan repayment, paid-in share capital, a deposit, a VAT prepayment.
- Advance payments received. The VAT on them arises when the money arrives (Section 13(1) no. 1 letter a sentence 4 UStG, the German VAT Act), so the line keeps its tax.
- Fees of a payment provider, read from the provider's feed, and charges of your own bank under a rule that you approved in the app. Both only on the account for bank charges (4970 in SKR03, 6855 in SKR04), because no supplier invoice will arrive for them.
- Lines that are held for review on purpose, such as an unclear direct debit run. They stay as they are until a person decides. The same applies to a few settlement lines of a connected factoring account.
What the agent can do with a line
match_bank_transaction
Assigns the bank amount to an open customer or supplier invoice. An unbooked line is always assigned with its full amount, and a partial payment leaves the rest of the invoice open. For a payment that is already booked and parked, the field amount limits the part that goes to this invoice. The server checks an agreed cash discount as the app does.
book_bank_transaction
Books a line that has no invoice. With receipt_id it settles the supplier invoice that was booked from that receipt. With kind the agent states a transfer, a cash withdrawal, a private expense or an open item on the supplier or customer side. With an account and a VAT key the server applies the house rule.
ignore_bank_transaction
Sets an unbooked line aside when it does not belong in these books. The reason stays on the line, and the line can be opened again in the app. An ignored line is not booked, so it is missing from the ledger balance of the bank account.
Taking something back
list_payments shows each settlement with its clearing_id. storno_payment takes a settlement back with a reversal, and the invoice is open again. The automatic run does not book a reversed pair a second time. Nothing is deleted.
Worked example: six bank lines in November 2026
Example figures for an example GmbH with the chart of accounts SKR03. The payment provider, a savings account and a rule for bank charges are set up in the app.
- Line 1, 4 November, plus EUR 2,380.00, reference “Rechnung 2026-0374”. The customer has one open invoice, number 2026-0347, over EUR 2,380.00, and no invoice 2026-0374 exists. Two neighbouring digits are swapped. The software settles invoice 2026-0347 itself: bank account 1200 against the customer's account.
- Line 2, 9 November, plus EUR 2,000.00, reference “RE 2026-0352”. That invoice is over EUR 5,950.00. The software assigns the payment by the number. EUR 3,950.00 stays open and still appears in list_open_items.
- Line 3, 12 November, plus EUR 971.00 from the payment provider. The provider's feed shows card payments of EUR 1,000.00 from customers, a fee of EUR 29.00 and the payout of EUR 971.00. The arrival on the bank account is a transfer through account 1360 Geldtransit (cash in transit), not revenue. The fee is booked from the feed to 4970 Nebenkosten des Geldverkehrs (bank charges).
- Line 4, 16 November, minus EUR 14.90, the account fee of the bank. With the approved rule the line books directly to 4970. Without the rule it would be parked as an open item on the supplier side and wait for an invoice that never comes.
- Line 5, 30 November, minus EUR 1,250.00, reference “Darlehensrate” (loan instalment). The software proposes account 0630 Verbindlichkeiten gegenüber Kreditinstituten (liabilities to banks) with a confidence below the threshold, so the line waits. The agent books it with book_bank_transaction after your yes; a balance-sheet account is allowed as counter-account. The interest in the instalment, EUR 187.50 in the bank's plan, cannot be split off on the bank line. It is posted from the bank's loan statement, for example with create_journal_entry: debit an interest expense account such as 2120, credit 0630. The loan then goes down by EUR 1,062.50.
- Line 6, 30 November, minus EUR 5,000.00, reference “Umbuchung Tagesgeld”. The word Umbuchung (transfer) and the matching line of plus EUR 5,000.00 on the savings account mark it as a transfer between your own accounts. Both sides book against 1360 Geldtransit, which is back at zero when both lines are in.
After the automatic run, lines 1 to 4 and line 6 are booked. Line 5 is the only unbooked one. The agent's work is the rest, not the whole statement.
Proving the balance, at month end and at year end
list_bank_accounts with the fiscal year returns, for each bank account, the statement date, the statement balance, the ledger balance and the difference. For the example, before and after line 5 is booked:
Bank 1200, November 2026 (example figures) Ledger balance 1 November EUR 18,500.00 plus lines 1 to 3: 2,380.00 + 2,000.00 + 971.00 = 5,351.00 minus lines 4 and 6: 14.90 + 5,000.00 = 5,014.90 Ledger balance, line 5 unbooked EUR 18,836.10 Statement balance 30 November EUR 17,586.10 Difference (statement minus ledger) EUR -1,250.00 After line 5 is booked: Ledger balance EUR 17,586.10 Difference EUR 0.00
The ledger balance is calculated from the journal up to the statement date, starting from the opening balance of the fiscal year. Each bank account is compared on its own, so a surplus on one account cannot hide a shortfall on another. A value that the software does not know comes back empty, not as zero. One case: the bank account has no dated opening balance in the journal.
A difference has few possible causes: a line that is still unbooked or was ignored, a line that is in the books twice, or a booking on the wrong account. The agent can list the unbooked and ignored lines of the period with list_bank_transactions and the journal entries on the bank account with list_journal_entries, and compare the two.
At year end the same check supports the balance-sheet item “Kassenbestand, Bundesbankguthaben, Guthaben bei Kreditinstituten und Schecks” (cash and bank balances, Section 266(2) B.IV of the German Commercial Code, HGB). The software uses the last statement inside the fiscal year. If there is none, but the bank connection reported a later balance, it calculates back to the year end, and only when the lines cover the time in between without a gap. Otherwise the value stays empty. For an account in a foreign currency no difference is calculated, because the ledger is kept in euro.
Limits
- The agent cannot connect a bank, and it cannot start a payment. No tool moves money.
- It cannot change the IBAN or BIC of a business partner. Bank details are kept in the app.
- It cannot approve a booking rule or change the settings for automatic booking. Both are done in the app.
- A payment recorded by hand with record_outgoing_invoice_payment or record_incoming_invoice_payment is refused for a bank account with automatic fetch. There the payment comes through the bank line.
- When name and amount do not agree, you decide whether a payment belongs to an invoice. The agent proposes the pair, and the server checks amounts, periods and locks.
- The books and all filings stay German. This page is not tax advice.
Frequently asked questions
Can an AI agent connect my bank account to the ledger?
No. You connect the bank in the app. The agent works with the lines the software has fetched, or it imports a statement file as CSV, CAMT.053 or MT940 into a bank account that exists in the app.
A customer paid several invoices with one transfer. What does the agent do?
The software does not settle such a line by itself. The payment is booked to the customer's account first. Then the agent calls match_bank_transaction once for each invoice and passes that invoice's part in the field amount. The server refuses a part that is larger than the open invoice or larger than what is left of the payment.
Why did the bank fee not go to an expense account?
At a company that draws up a balance sheet, a bank line posts no expense without a document. Bank charges are an exception only under a rule that you approved in the app and that points to the account for bank charges. Without the rule the fee is parked as an open item.
The customer wrote the wrong invoice number. What happens to the payment?
If the number is one typing error away from exactly one open sales invoice, the amount is exact, the payer is the customer and the number as written is not an invoice in your books, the software settles the invoice. Otherwise it does not. If the number as written belongs to another open invoice, the payment follows that number. If not, the payment is parked on the customer's account, and you or the agent assign it.
The balances agree, but an invoice still shows as open. Why?
The payment is probably booked but parked: it sits on the customer's account and is not yet assigned to the invoice. The bank account is correct, the open item is not. match_bank_transaction with the invoice assigns the booked payment without a second booking on the bank account.
Does the rule about expense and revenue apply to cash-basis businesses?
No. A business with cash-basis accounting (EÜR) records income and expense when the money moves, so its bank lines book directly. get_entity tells the agent which method the company uses.