helper.lt
Menu

Invoices from the mailbox – straight into the books

We built invoice intake from the mailbox: AI recognises supplier invoices, and clear rules book them with no manual work and never declare VAT twice.

Three separate checks stop duplicates.

Client
Cloud accounting platform
Our role
New modules in an existing system
Years
2026
Technologies
TypeScript, Hono, Next.js, MongoDB, IMAP, document recognition with a language model, Vitest

The task

Supplier invoices arrive as PDFs by email. Typing them in takes time and risks declaring VAT twice.

The solution

We built the whole flow: the company's invoice mailbox feeds AI recognition, with clear booking rules, duplicate guards and marks in the interface.

How each document ends

  • Booked: the supplier is created if new, and the invoice is posted.
  • Attached: the PDF is added to an invoice already in the books.
  • Skipped: not an invoice, or a copy.
  • Waiting: the invoice is filed by another system, and the PDF waits to be attached.
  • Held: kept for a person to check.

Stricter than manual entry

A document is held when a VAT code is ambiguous, when a foreign supplier doesn't resolve to reverse charge, or when the lines don't add up to the printed totals. For suppliers that another system already files, the PDF waits and is then attached, so VAT is never declared twice.

Three guards against duplicates

  • A mailbox lease: only one process works the mailbox at a time.
  • Each message is reserved for processing.
  • A content hash: the same document is never booked twice.

Invoices read by AI are marked in the lists, and one button re-runs recognition.

What happens to every invoice from the mailbox
  1. A supplier invoice in the mailbox

    A PDF attached to an email

  2. Done by AI: AI recognition

    Invoice data read from the PDF

  3. Booking rules

    Clear checks decide, not the AI

  4. Five possible outcomes

    • Booked

      The invoice is posted; a new supplier is created if needed

    • Attached

      The PDF is added to an invoice already in the books

    • Skipped

      Not an invoice, or a copy

    • Waiting

      Until another system files the invoice

    • Held for review

      VAT or totals don't add up – a person decides

Results

  • Purchase invoices from the mailbox are booked with no manual step.
  • Duplicates are blocked by three separate guards.

Want a similar solution?

A few sentences are enough – we'll reply and talk through how we could help.