Reading invoices with AI: fields, differences and review before posting
Reading a total is not enough to post an invoice. Retain each field's origin and decide which differences require review.
Test XML, PDF and posting routes
Ten synthetic cases to compare origins, review differences and separate extraction, tax checks and approval. Observed results are blank.
Define the data your process needs
A service company may record project expenses; a factory may link invoices to orders and receipts. One PDF can need different rules. Define required fields, format, source and destination. A read invoice is not yet authorized for posting or payment, and extraction does not replace tax or accounting review.
Microsoft Document Intelligence documents extracted invoice values and line items. Google Document AI shows structured entities, normalized values and confidence in its response. These are reviewable model outputs, rather than guarantees that your identity, arithmetic or authorization is correct.
Do you need XML reading, PDF extraction or scan review?
For a Mexican CFDI, identify the XML before requesting image-reading work. Mexico’s SAT distinguishes XML recovery from the printed representation and describes metadata such as fiscal identifier, tax IDs, total and status. That distinction helps choose the document route. It does not establish that your extractor checked current status or validated the invoice.
| What you receive | Work to compare | Checks still required |
|---|---|---|
| CFDI XML and its PDF | Structured reading and comparison of both sources | Identity, version, required status and approval under your process |
| Text PDF only | Field extraction and obtaining XML where applicable | Origin and differences; PDF does not replace tax verification |
| Photo or scan | OCR and review against original passage | Quality, currency, missing items and ambiguous reading |
| Foreign invoice or non-CFDI document | Rules for that document type | Do not impose inapplicable Mexican fields or conclusions |
Microsoft Document Intelligence describes extracting structured fields from images, scans and digital PDFs. Compare document, page, format and review limits as well as price. Scanning many invoices does not establish tax validation, goods receipt or approval of your payable; define those steps separately with their owners.
Fictional example: the same invoice arrives as XML and PDF
Test X-801 has XML showing 1,180 MXN and PDF extraction showing 1,160: a difference of 20. Both files refer to the same invoice; open one case with both origins and leave the difference pending. The owner reviews files, identity and items before deciding; do not overwrite a source just because another arrived first or scored highly. These values are synthetic and do not establish a CFDI’s validity.
If XML is missing, show which fields were read and which checks remain incomplete. If your policy requires a tax-status lookup, retain the authorized result and date separately; do not label OCR text “SAT validated”. If posting succeeded but its response was lost, check the destination reference before repeating. The XML, PDF and posting worksheet contains these checks with blank observed results.
Fictional example: a 1,180 total with a missing component
Rehearsal invoice F-801 shows a 1,000 MXN subtotal, 160 tax and an additional 20 charge, totaling 1,180. Initial extraction returns subtotal and tax but misses the charge. The recovered components total 1,160, leaving a difference of 20. This synthetic calculation neither defines tax treatment of the charge nor represents customer savings.
The case remains pending even if the extracted total has high confidence. The reviewer locates the charge, confirms its classification under the business rule and records the correction. Keep the initial extraction and decision. If currency is shown only as “$,” do not automatically assume MXN: verify authorized context or request review.
| Field or relationship | Check | If unclear |
|---|---|---|
| Supplier and identifier | Matches an authorized entity | Review before creating another supplier |
| Currency and amounts | Components and total follow agreed rules | Do not guess currency or component |
| Document and origin | File, pages and version remain locatable | Stop if evidence is missing |
| Order and receipt | Relationship and quantity when required | Hold for purchasing owner |
Test difficult documents and the destination step
Include text PDFs, blurry scans, multiple pages and documents that are not invoices. Use authorized anonymized material; review access and handling scope before sending real documents to a provider. Keep extractor version and rehearsal rules. Results may vary by format, language and configuration.
| Case | Expected result | Evidence |
|---|---|---|
| F-801 misses the 20 charge | Pending difference; inconsistent total not posted | Document and proposed fields |
| Currency appears only as $ | Review without unauthorized automatic inference | Passage and decision |
| Supplier absent from catalog | Pending before creating an entity | Identity and checked catalog |
| Same document arrives by email and folder | One business case with both origins | Key and references |
| Posting fails before confirmation | Queryable pending or unknown state | Request and response |
| Retry an applied posting | Same payable without duplication | Destination reference |
Confidence helps prioritize rather than decide alone
Agree which fields can be accepted under testable rules and which always need review. High confidence can accompany an incorrect reading; use it within criteria validated on your documents rather than as universal authorization. Separate reading errors, arithmetic differences and missing approval because they need different responses.
The review queue should show doubtful field, original passage, proposal and owner. A human correction retains actor and change. Reprocessing the same file must not overwrite that decision without a rule. If the original changes, retain a new version and compare again rather than replacing earlier evidence.
Accept a complete flow for one document type
Start with bounded invoice formats and one destination. Verify extraction, review and posting before expanding suppliers or formats. Connect the pilot with AI ROI, change auditing and webhooks and retries when destination confirmation is deferred.
The downloadable worksheet proposes ten cases with observed results empty. Bring anonymized invoices in different formats, approval rules and the destination reference field to a free consultation for AI for business. We can review a useful extraction rehearsal and where it must pause for review.
Frequently asked questions
Extracting data and authorizing payment are separate tasks. Define approval permission, criteria and owner independently. This rehearsal covers review and posting under your process; it does not assume automatic payment authorization.
Agree a document and destination key including issuer and relevant references. A filename is insufficient, and invoice numbers may repeat across suppliers. Test different intake channels and keep a review path for uncertain matches.
It establishes only the arithmetic check performed. Identity, currency, components, authorization and tax or accounting review need their own criteria. A correct sum does not constitute complete document acceptance.
Do not assume so. A contact phone and invoice total can have different consequences. Set field-specific criteria and test representative formats. Retain errors and pending cases to review the rule.
Extracting PDF text or fields does not establish that check. Identify the XML and agree with the tax-process owner which lookup and evidence are required. Retain the authorized dated result; high extraction confidence is not evidence of validation.
Sources
- Invoice data extractionMicrosoft
- Handle processing responseGoogle Cloud
- Consulta y recuperación de comprobantesSAT México
Last updated:
