- 1. Receive document
- 2. Extract fields
- 3. Validate evidence
- 4. Review exceptions
- 5. Export approved record
The business scenario
Consider a distributor receiving supplier invoices through a shared inbox and an upload portal. Staff retype supplier details, compare totals with purchase orders and chase missing information. The proposed system concentrates on document intake and review; payment authorization stays in the accounting team's existing process.
A practical first release
The initial scope covers PDF and image invoices, one organization and one accounting export format. Users can inspect a queue, open the original document beside extracted fields, correct values and approve a record. Roles distinguish uploaders, reviewers and administrators. Credit notes, multiple entities and payment initiation remain outside the first release.
How the workflow would operate
An upload receives a document ID and content fingerprint. A background worker checks file type and size, extracts text and proposes structured fields. Deterministic checks compare line totals, currency, supplier references and required fields. Duplicate candidates and uncertain values enter a review queue. Approved records receive an export status and an immutable record of who reviewed them.
Architecture and integrations
The Next.js workspace would call a Python API backed by PostgreSQL. Original documents would be stored separately with scoped access. A queue separates uploads from longer OCR and extraction jobs. An accounting adapter would validate approved output before export, use a stable record identifier to avoid duplicate exports, and expose retryable failures to operators.
The difficult cases
A scanned invoice may be legible to a person but produce unreliable extraction. The interface should highlight the source area for each field and permit correction. A high model-confidence score does not establish that an invoice is genuine or payable. Supplier bank-detail changes, conflicting totals and missing purchase orders require explicit human review.
Evaluation plan
Use a held-out set of synthetic and permission-cleared invoices covering scans, different layouts, duplicates and malformed files. Measure exact field accuracy, correction effort, exception precision, export failures and processing time. Require every approved export to have a traceable review history and ensure reprocessing cannot create duplicate records. These are proposed acceptance checks, not measured results.
Delivery and next steps
A proposed delivery package includes the intake portal, review workspace, extraction pipeline, accounting adapter, role matrix, test fixtures and operating guide. Begin with a shadow run alongside the existing process before permitting exports. Any business improvement would need to be measured against the team's baseline after implementation.