Vector Dynamic

Autonomous AP & 3-Way Match Pipeline

LedgerFlow: Autonomous invoice extraction and three-way purchase order matching.

Extracts multi-page vendor PDFs with deterministic math checks, reconciles lines against purchase orders and receipts, and posts clean vouchers to the ERP.

System Architecture Schematic

LedgerFlow autonomous accounts payable and 3-way match pipeline schematic showing multi-format PDF invoice extraction, deterministic math verification, PO/GRN matching, and ERP sync.

The Business Pain Point & Operational Requirements

Why off-the-shelf software breaks under this workflow.

Finance and operations teams processing hundreds or thousands of monthly vendor invoices spend 15+ hours a week keying PDF line items into QuickBooks, Xero, NetSuite, or their ERP, hunting down warehouse receiving slips in email threads, and fixing SKU unit-of-measure mismatches by hand.

According to Ardent Partners Accounts Payable benchmarks, manual processing costs $12 to $30 per invoice, takes an average of 10.9 days to approve, and exposes the business to duplicate billings, unnoticed supplier price creep, and missed early-payment discounts.

What the operation required

  • 01Ingest multi-page PDFs, scanned delivery tickets, and international invoices automatically from shared AP inboxes, supplier portals, and mobile uploads.
  • 02Verify every extracted line item against deterministic mathematical rules (`Qty × Unit Price + Tax - Discount == Total`) before any data touches the general ledger.
  • 03Automatically reconcile invoices against open Purchase Orders (PO) and warehouse Goods Received Notes (GRN), routing only genuine price or quantity variances to human reviewers.
  • 04Post approved, GL-coded vouchers idempotently into the accounting ledger with the source PDF permanently attached.

In-Depth Features & Functional Modules

What the system does in production

01

Multi-channel document intake & layout-aware extraction

Monitors dedicated AP email inboxes, EDI feeds, and mobile warehouse uploads—extracting complex multi-page tables, tax breakdowns, freight charges, and vendor metadata regardless of template layout.

02

Deterministic math, tax & fuzzy duplicate guard

Cross-checks line-item arithmetic in code and screens every incoming bill against historical invoices using SHA-256 file hashes plus fuzzy matching on `(Vendor Tax ID + Invoice Number + Amount + ±5-day window)`.

03

Automated 3-Way Match (PO ↔ GRN ↔ Invoice)

Links vendor line descriptions to internal master SKUs, converts packaging units (such as cases of 24 to individual units), and verifies that billed quantities and prices fall within contract tolerance thresholds.

04

Side-by-side exception workbench & ERP sync

Auto-posts clean invoices straight through to QuickBooks, Xero, NetSuite, or Okebase, while presenting flagged variances in a split-screen UI that highlights the exact bounding box on the source PDF.

Technical Architecture

Four-stage production pipeline

STAGE 01

Document Ingestion & Pre-Processing

IMAP/Webhook listeners ingest PDFs and scans, deskew pages, and compute cryptographic hashes for instant duplicate rejection.

STAGE 02

Vision-LLM Extraction & Math Verifier

Layout-aware multimodal extraction outputs strict JSON schemas validated by a deterministic Python arithmetic and tax-rate engine.

STAGE 03

3-Way Match & GL Coding Engine

Matches invoice lines against ERP Purchase Orders and warehouse GRNs using hybrid vector + fuzzy SKU resolution and historical GL account mapping.

STAGE 04

Exception Workbench & Ledger Connector

Routes out-of-tolerance bills to human approvers and writes approved vouchers idempotently to the ERP/accounting API.

Engineering Complexity & Stack

Hard technical problems solved under the hood

01

Zero tolerance for hallucinated numbers in financial ledgers

Never trusted raw model output for accounting totals: every invoice must pass a deterministic cross-footing equation (`sum(line_items) + tax + shipping - discount == header_total`); any 1-cent discrepancy triggers targeted re-OCR and highlights the exact cell.

02

Cross-unit SKU reconciliation across messy vendor catalogs

Built a self-improving vendor alias and unit-of-measure conversion table so when a supplier bills "2 Pallets (48 ct)" against a PO written for "96 Units", the 3-way match engine reconciles the math automatically.

03

Catching subtle double-billing across channels

Combined exact document hashing with fuzzy composite keys to block duplicate payment when a vendor emails a PDF invoice and later mails or uploads a re-scanned copy of the same bill.

Python / FastAPIMultimodal Document VisionPostgreSQLNext.js Exception WorkbenchQuickBooks / Xero / ERP APIsRedis

Architectural Takeaways

Principles we carry into every custom deployment

Principle 01

In financial document automation, AI should do the reading, but deterministic code must do the math and enforce tolerance gates.

Principle 02

Designing the 12% exception review screen with bounding-box PDF highlights is what wins daily trust from controllers and bookkeepers.

Dealing with a similar operational bottleneck?

We architect, customize, and deploy systems like this tailored to your workflow and contract structure—or start with a free 2–4 page written systems review.