AI document processing

A B2B tool that extracts fields from invoices and contracts, ties every value to its source in the document, asks a person when it isn't sure and posts approved documents to the accounting system.

All projects

Whose need

For an accounts payable team, month-end means moving hundreds of invoices from PDFs into the ledger by hand. Automated readers are fast but hard to trust: they don't show where a value came from, and when they're unsure they guess. So the team either re-checks everything, or finds the wrong payment term, the short delivery or the invoice that arrived twice on the day it gets paid.

What I built

I built Snapline around trust before speed. Documents land in one inbox from email, upload or a supplier link, and are sorted by type automatically. Every field is tied to its place in the document: click a value and a line reaches into the page and highlights the source. Each field carries a confidence score; below the threshold nothing is guessed, and the question goes to a person with both candidates shown, the answer becoming a rule for that supplier. Invoices are matched line by line against purchase orders and receipts, duplicates are stopped before payment, and renewal and notice dates from contracts land on the calendar. Approved documents are written to NetSuite, QuickBooks Online or Xero exactly once.

The flow

  1. Invoices, credit notes and contracts arrive by email, upload or supplier link; Snapline sorts them by type and extracts the fields.
  2. Every field is tied to its source in the document and gets a confidence score; documents above the threshold are verified automatically.
  3. The rest go to an exception queue by reason: low-confidence field, PO mismatch, possible duplicate, new supplier, contract clause.
  4. The team answers Snapline's question in one click, looking at the source; the answer becomes a rule for that supplier.
  5. Bills over the threshold go to the finance director for approval on the phone; approved documents are posted to the ledger and the day's close summary is ready.

Key decisions

  • No value without a source

    Mistral OCR 4 returns every block with its box on the page; Claude extracts fields against a per-document-type JSON schema and must tie each value to one of those blocks. A value that can't be tied is rejected. In the interface that tie is a line: one click between a value and where it came from.

  • Confidence is computed, not asked for

    A model's own confidence isn't reliable on its own. The score combines agreement with the OCR text, business rules like line totals and date logic, and the supplier's past invoices, and it's calibrated on a labeled document set. Every model or prompt change runs a regression against that set.

  • When unsure, it asks

    Fields below the threshold are never guessed; a person sees both candidates with their sources and picks one. The choice is stored as a rule for that supplier, so the same question isn't asked twice. Who approved each field, and from which source, is kept in an immutable audit log.

  • Posting is durable and happens once

    Approvals can wait for days and accounting APIs can go down, so approval and posting run as Temporal workflows. Every entry is written with an idempotency key, so an invoice never lands in the ledger twice. In the multi-tenant setup, each company's data is isolated with Postgres row-level security.

Technology

  • Next.js 16
  • TypeScript
  • Claude API
  • Mistral OCR
  • Postgres
  • Temporal
  • NetSuite / QuickBooks / Xero API
  • OpenTelemetry

Screens

Related serviceAI products and integrations

Need something similar?

Tell me in a few sentences what you want to build.

Start a project