Skip to content

Case study 04

Invoice Extraction Pipeline

An extraction pipeline replacing hours of daily retyping, with a confidence threshold that routes anything uncertain to a person.

Next.jsAI SDKVision OCRQueuesPostgres
At a glance
Sector
Distribution
Year
2026
Service
AI Automation
Spine

PDF → structured data · human review

See this service
Mostly removed
Manual retyping
Human review
Low-confidence path
Per supplier
Accuracy tracking
Queue, not silence
Failure mode

The problem

A staff member spent most of each morning opening supplier invoice PDFs and retyping line items, quantities and rates into a spreadsheet. High volume, entirely mechanical, and error-prone in exactly the way that produces disputes with suppliers three weeks later.

What we built

Invoices land in a watched inbox, get parsed to structured line items, and are written straight through when extraction confidence is high. Anything below the threshold — a scanned copy, an unusual layout, a smudged total — goes to a review queue where one click confirms or corrects it. Accuracy is logged per supplier, and drift raises an alert rather than quietly corrupting a quarter of data.

Under the hood

Pipeline
  • inbox:watch
  • pdf:split
  • ocr:extract
  • schema:validate
  • confidence:gate
  • review:queue
  • commit:ledger
Guards
  • confidence_threshold=0.92
  • totals_must_reconcile
  • duplicate_invoice_hash
  • supplier_drift_alert
Endpoints
  • POST /ingest
  • GET /review/pending
  • POST /review/:id/confirm