← All insights

Hunting receipts with an AI agent: invoices from mailboxes and online shops, collected automatically

How a Claude agent finds the receipts for open bank transactions on its own – across several mailboxes and straight from online-shop customer accounts – and books them via the Lexware Office API. The agent collects and books, the human decides.

This is how I brought the books of my own companies up to date with a Claude agent, mail connectors, browser automation and the Lexware Office API. A use case, not a showcase: I apply the same patterns in data engineering pipelines for clients.

As managing director of two small companies, I want the receipts for open bank transactions to be collected automatically from my mailboxes and customer accounts and booked, so that I only decide the cases that genuinely need my decision.

Starting point

At the outset, the books showed more than 120 unmatched bank transactions. The real problem wasn’t booking – it was finding: receipts were scattered across several mailboxes, merchant portals, cloud billing consoles and PDF bank statements.

Many merchants don’t email an invoice at all, just a note saying “your invoice is available”. The PDF then sits in the merchant’s customer account and has to be downloaded one by one. That’s exactly the kind of chore that otherwise piles up.

On top of that, one detail costs time every month: the bank posts the VAT on interest and account fees as a separate transaction. A single statement thus turns into up to five bank transactions belonging to two receipts. The software’s automatic matching suggestion also regularly books the statement without tax – the input VAT would be lost.

The technical hurdle: the Lexware Office public API covers vouchers, contacts, categories and payments, but not bank transactions. Pure API automation isn’t enough.

Solution

A Claude agent works through three channels: the mailboxes via mail connectors, the browser for customer accounts and everything the API can’t do, and the Lexware Office API for vouchers and checks. A custom skill defines the order of work and how results are verified. There are two workflows.

A – Collecting receipts

  1. Read open bank transactions: amount, date, counterparty, reference.
  2. For each transaction, search every mailbox – by sender, amount, invoice number and a time window around the booking date. Take over PDF attachments.
  3. If the invoice only exists in a customer account, the agent opens the shop in the browser where I’m already signed in and downloads the invoice from the orders or invoices section.
  4. Check the receipt: amount, date, VAT – and above all the invoice recipient, i.e. which company.
  5. Create the voucher via the API, attach the PDF, then match the bank transaction.
  6. Anything that can’t be found goes onto the remaining list – optionally with a request email to the supplier that only goes out after approval.

B – Monthly bank close

  1. Read the month’s bank transactions in the web interface.
  2. Derive amounts from the reference text and check them against the statement, including the VAT net base.
  3. Create vouchers via the API, one for the loan and one for account fees.
  4. Immediately attach the bank statement as the voucher image.
  5. Only then match the bank transactions in the browser, including partial matches and early-payment discounts.
  6. Verify via the API: voucher image present, payment settled, open amount zero.

In both workflows, the order is not a detail. As soon as a bank transaction is attached to a voucher, the software locks any changes. A forgotten PDF then means: unmatch everything, upload, match again. After finalisation, only a reversal is possible.

Guardrails: what stays with the human

The agent collects, prepares and books, but doesn’t make judgement calls. These rules were fixed from the start:

Result

The backlog is cleared, and both receipt collection and the monthly close now run as repeatable workflows instead of an evening chore.

Transfer

Accounting is only the domain here. The patterns are the same as for job onboarding or audit bots on data platforms.

Stack: Claude · Mail connectors (Microsoft 365, Gmail) · Claude in Chrome · Lexware Office API · Python

← All insights