AI Invoice and Document Processing: Control Before Automation
Turn documents into reviewable evidence, not blind accounting actions
Source contracts, validation gates, human authority and verified destination read-back
Original DOCS-7 workflow with explicit acceptance criteria
AI invoice processing, document automation, OCR validation, accounting workflow, supplier matching, human review and verified ERP read-back

$ process document --contract DOCS-7
> receive: file / hash / tenant / receipt
> extract: typed fields / evidence / uncertainty
> validate: match / arithmetic / policy
> review: authority / exceptions / expiry
> commit: idempotent draft / read-back / recoveryAI can extract fields from invoices, purchase orders, delivery notes and other business documents. That ability does not turn a document into an approved payable, a correct accounting record, or a safe supplier action. A scan can be incomplete, a vendor can be unfamiliar, a total can be ambiguous, and the accounting system can reject or partially accept a write.
This guide answers the narrow implementation question: how to design a controlled AI-assisted invoice and document workflow. The broader commercial context belongs to the AI specialist in Armenia page. For an implementation scope, see AI automation; public delivery evidence belongs in the case-studies hub.
1. Start with a process and evidence boundary
The unsafe shortcut is PDF -> model -> accounting entry. It hides the real work: document receipt, duplicate control, supplier identity, tax and approval policy, exceptions, and confirmation from the system of record. Begin with one bounded workflow, such as preparing a review packet for received invoices. Do not begin by promising autonomous posting or payment.
Each intake needs a durable identity: tenant or legal entity, source channel, receipt time, source file hash, document version, retention policy, and the process state. Keep the original file separate from derived text and extracted fields. A later OCR retry or a corrected document must create a new version instead of silently changing the evidence behind a proposed action.
Useful discovery questions are operational rather than model-centric:
- Which document types and languages are actually in scope?
- Which source is authoritative for supplier, purchase order, delivery receipt, tax code and cost centre?
- Which decisions are deterministic, which require an authorised reviewer, and which should stop the workflow?
- What is the safe fallback when the source, integration or model is unavailable?
The workflow should carry only permitted data. Attachments may include banking information, addresses, employee names or line-item detail. Define who may view the original, which fields may reach an extraction service, how long derivatives survive, and how a reviewer can locate the source evidence. A complete-looking JSON object is not proof that the evidence was permitted, current or correct.
2. Design DOCS-7 as a controlled workflow
DOCS-7 is a reference sequence for producing a reviewable document record. It is deliberately provider-neutral: email, a supplier portal, a scanner and an API require different adapters, but the control contract can remain stable.
- Receive the source file with a receipt, hash, tenant and channel identity.
- Classify document type and language, while retaining an
unknownstate. - Extract typed candidate fields with source spans and explicit uncertainty.
- Match only against approved supplier, PO, goods-receipt or contract references.
- Validate required fields, arithmetic, duplicate keys, policy and current master-data version.
- Review exceptions and any consequential posting or payment decision with an authorised owner.
- Commit and read back an idempotent draft or approved record, then verify the destination state and recovery owner.
The model belongs at step three. It can propose a document type, invoice number, dates, totals, currencies, supplier candidates and confidence explanations. It must not decide that a supplier is valid, invent a missing tax code, approve a payment, or treat a visual checkmark as a confirmed ERP write. Deterministic services and people own those decisions.
{
"documentId": "doc-2026-08-11-014",
"tenantId": "entity-07",
"sourceHash": "sha256:...",
"documentVersion": 1,
"proposal": {
"invoiceNumber": { "value": "INV-4821", "evidence": ["page:1:region:12"], "uncertain": false },
"total": { "value": "125000", "currency": "AMD", "evidence": ["page:1:region:37"], "uncertain": false },
"supplierCandidate": { "value": "supplier-ref-unknown", "uncertain": true }
},
"state": "review_required"
}This example is an extraction proposal, not an accounting document. The receiving system should reject missing evidence, invalid types, unsupported currencies, stale mappings and any attempt to skip the policy gate.
3. Make integrations explicit contracts
Most document projects fail at boundaries, not at text recognition. The source adapter must distinguish a delivered file from a usable document. The document store must preserve a stable reference without exposing it broadly. The master-data adapter must return a versioned supplier or PO candidate, not a fuzzy fact. The accounting adapter must support an idempotency key and an authoritative read-back.
Treat each boundary as a small contract:
| Boundary | Required evidence | Stop condition |
|---|---|---|
| Intake | receipt, hash, tenant, source access state | unreadable, malicious or ambiguous source |
| Extraction | schema, field spans, language, uncertainty | missing critical field or unsupported document type |
| Matching | master-data version, match basis, ambiguity state | multiple plausible suppliers or no eligible reference |
| Policy | rule version, threshold, reviewer role | out-of-policy amount, tax, entity or deadline |
| Destination | idempotency key, target ID, read-back | timeout, partial write or conflicting current state |
Match rules are especially important. A model may recognise a supplier name differently from the master-data spelling. That is a candidate for a deterministic lookup or review, not a license to create a new vendor. Likewise, total arithmetic can be checked deterministically only after the document type, currency and rounding convention are known. Record the rules and versions that produced each validation outcome.
Keep integration permissions narrow. A first pilot can create a review task or an accounting draft in a sandbox rather than posting journals. If a destination write times out, store reconcile_required and query the authoritative system before retrying. Blindly replaying a write can duplicate a payable.
4. Define checks before a live pilot
An accuracy percentage alone is not an acceptance criterion. It collapses harmless formatting differences and consequential errors into one number. Build an acceptance set from representative documents: clean digital PDFs, scans, multi-page invoices, credit notes, mixed languages, duplicate deliveries, missing POs, changed vendor details and documents that must be rejected.
Assess the workflow in layers:
- Field contract: types, required fields, evidence spans, currency and arithmetic.
- Match contract: correct entity boundary, candidate status, duplicate detection and current master data.
- Policy contract: rule version, thresholds, approver authority and expiry.
- Integration contract: idempotent destination request, read-back, reconciliation and audit trail.
- Operational contract: timeout, retry, dead-letter, pause switch, retention and named recovery owner.
Acceptance criteria should be observable. For example: every committed draft has a source hash; every critical extracted field has an allowed evidence reference; a duplicate source produces no second destination record; unknown supplier or tax treatment reaches a reviewer; an ambiguous write never retries without reconciliation; and a reviewer can see the proposal, evidence, policy version and decision rationale.
require(document.hash && document.tenantId && document.version && source.receipt);
require(proposal.schemaValid && proposal.criticalEvidence && match.currentMasterData);
commit = policy.permits && reviewer.authorized && destination.readBack && recovery.owner;The test set should include failures deliberately. A blurred invoice must not become a plausible total. A tenant mismatch must fail closed. An old PO must not be accepted just because its number appears in a page image. A destination timeout must exercise the reconciliation path. These cases are more informative than a polished demo.
5. Operate, improve and measure the narrow workflow
Run the first release as a controlled pilot: one entity, limited document types, review-first state, a named process owner and a reversible destination action. Establish a baseline for the manual process before interpreting a new workflow. It may be useful to observe preparation time, exception categories, correction causes, duplicate blocks, review age and reconciliation backlog; those are operating signals, not universal ROI promises.
Review corrections by cause. A recurring missing PO may be a procurement process issue, not an extraction problem. A supplier match conflict may show stale master data. A reviewer who constantly overrides a rule may have discovered a policy gap. Change one contract at a time, version it, replay the acceptance set, then expand scope only when the new behaviour is understood.
The right outcome is not "AI handles invoices alone." It is a traceable process in which a document becomes a bounded proposal, policy and people retain authority, and the system of record confirms what happened. To discuss a controlled document-automation pilot, prepare a project brief.
require(document.hash && document.tenantId && document.version && source.receipt);
require(proposal.schemaValid && proposal.criticalEvidence && match.currentMasterData);
commit = policy.permits && reviewer.authorized && destination.readBack && recovery.owner;