Invoice Intake with Exception Review
Extract invoice fields, validate them against a purchase order and send only exceptions to a finance reviewer.
The problem
Finance staff manually key invoice data and compare it with purchase orders. Errors and duplicates slip through.
Incoming invoice files are stored, text is extracted, and a model returns structured fields. Deterministic checks compare totals, vendor and PO references. Anything that fails a check goes to a human queue.
Automate extraction, not approval
The safe boundary is clear: the workflow extracts and validates; a person approves payment. This keeps the efficiency gain while preserving financial controls.
Deterministic checks beat model confidence
Do not ask the model whether an invoice is valid. Check that line items sum to the subtotal, that tax matches the stated rate, that the PO exists, and that the invoice number has not been seen. These checks are testable and auditable.
Tools and access
Tools
Credentials
- • AI provider API key
- • Storage credentials
- • Accounting system API (optional)
Requirements
- Sample invoices with permission to process
- A purchase order list
- Finance approval for the validation rules
Build steps
Follow in order and test each step before connecting the next one.
- 1
Store the original file immutably
Save the invoice with a content hash and timestamp. Extraction can be re-run; the source must not change.
- 2
Extract with a schema
Request vendor, invoice number, date, currency, line items, subtotal, tax and total. Require null for missing values.
- 3
Run validation rules in code
Reconcile totals, check the PO, normalise the vendor and test for duplicates. Record each rule's result.
- 4
Route exceptions
Create a review task with the original file, extracted fields and failed checks. Do not write to the ledger automatically.
- 5
Audit a sample
Each week, compare ten processed invoices against the source. Track extraction error rate by vendor.
Test it before trusting it
Test input
An invoice PDF with a subtotal, tax, total, invoice number, date and a PO reference that does not exist in the sample PO list.
Expected output
Extracted fields plus validation results: totals reconcile, PO reference not found, duplicate check clear, status needs_review.
Troubleshooting
Tax and total do not reconcile
Treat reconciliation failure as an exception, not a model error. Send it to review with the extracted values.
Multi-page invoices lose line items
Extract page by page and merge with an explicit page count check.
Duplicate invoices pass
Normalise vendor name and invoice number, then check against the last 12 months before creating a record.
Maintenance
Re-test quarterly with new invoice layouts. Log every exception reason. Never auto-approve a payment; this workflow only prepares data for review.