InvoiceRecon — Autonomous 3-Way AP Reconciliation Engine
The Problem
System Bottlenecks & Technical Friction
A high-volume wholesale distributor processing $85M in annual perishable goods was losing an estimated $320,000 annually to un-reconciled vendor discrepancies. Four full-time accounts payable clerks spent 140 combined hours every week manually cross-referencing vendor PDF invoices against NetSuite purchase orders and physical warehouse receiving slips. Discrepancies in catch-weight unit pricing, un-credited freight damages, and retroactive vendor rebate variances routinely slipped past human auditors because manual checking of 80-line invoices under tight payment windows was unsustainable.
Our Engineering Approach
Architecture Design & Implementation
We engineered InvoiceRecon as a deterministic 3-way reconciliation pipeline. When a vendor emails an invoice PDF or EDI payload, the system parses multi-page line items using layout-aware Pydantic schemas powered by Claude 3.5 Sonnet. A PostgreSQL fuzzy-matching engine (`pg_trgm`) correlates SKU variants, vendor aliases, and purchase orders in NetSuite. Line-item unit prices, delivered quantities from dock scanners, and freight terms are mathematically cross-verified. Clean matches (<$5 variance threshold) auto-approve and push directly to NetSuite for batch ACH payment. Discrepancies generate interactive Slack approval cards with exact side-by-side line-item diffs for buyer sign-off.
Technical Architecture
System breakdown & stack.
Layout-aware document parser extracting multi-page tabular invoice items with 99.4% field accuracy
Fuzzy line-item matcher in PostgreSQL (pg_trgm + custom SKU normalization) handling 12,000+ vendor aliases
Deterministic 3-way reconciliation state machine comparing PO, Goods Receipt Note, and Invoice
NetSuite SuiteTalk REST API bidirectional sync for real-time ledger write-back and status updates
Slack Bolt SDK workflow engine dispatching interactive audit cards for variances > $250
Redis semantic cache storing recurring vendor invoice templates for sub-500ms processing
FastAPI backend deployed on AWS ECS with end-to-end OpenTelemetry tracing and audit logs
Next.js AP finance portal featuring live discrepancy queues, vendor risk scores, and cash-flow forecasting
Engagement Timeline
Engineering delivery schedule.
AP workflow profiling, extraction schema definition across top 50 vendor invoice formats, NetSuite API connector setup
Layout-aware Claude extraction pipeline, PostgreSQL pg_trgm fuzzy matching logic, historical PO backtesting
3-way deterministic reconciliation rules engine, tolerance threshold calibration, NetSuite write-back integration
Slack interactive approval bot, Next.js finance dashboard, Exception triage queue
Parallel-run audit testing against manual AP team, security hardening, full production go-live
More Case Studies
Related AI projects
Want results like these for your business?
Book a 30-minute scoping call with a senior engineer. We'll scope your AI project, define the architecture, and give you a fixed-price proposal within 5 business days.