2026-11-22

Invoice and contract AI: extraction before approval

Scope an invoice and contract AI pilot for a Kazakhstan team: source-linked fields, KZT checks, duplicates and a reusable human-review worksheet.

Invoice and contract AI: extraction before approval cover illustration

An invoice has been read without a typo: ten units at KZT 12,500, another two at KZT 7,500, and a total of KZT 148,000. Every field is populated and the currency is known. Yet the lines add up to KZT 140,000. If an assistant copies the printed total into a payment draft without a separate check, accurate extraction will preserve an error in the source.

For invoice data extraction, human review needs three distinct records: what the document says, which checks passed, and what an authorized employee decided. A first pilot can end with a source-linked table and an exception list. It does not need permission to pay an invoice, post an accounting document or accept contract terms.

This guide concerns incoming payment requests and selected contract clauses for a company in Kazakhstan. It is not an electronic tax-invoice submission guide, a tax calculation or a legal opinion. Every document, identifier and amount below is synthetic, not a customer implementation or a current price list.

Choose the document before choosing the reader

One mailbox folder may contain a payment request, an acceptance document, a quotation, a contract and an attachment announcing new bank details. An identical amount does not make these documents interchangeable. An invoice produces fields and line items; a contract produces a clause with its context, not an instruction to “approve the contract.”

Start with one document class, one incoming channel and a named reviewer. If the supplier already provides permitted structured data through an accessible interface, consider using that first. Reading a PDF again may be unnecessary. For scans, separately test image quality, language, tables, signatures and attached pages.

Microsoft Document Intelligence documents the extraction of invoice fields and line items into structured data. Its v4.0 documentation names API version 2024-11-30 and the prebuilt-invoice model. That establishes the tool's purpose, not support for every Kazakhstan document layout, Kazakh text or a particular accounting configuration. Those properties require checks against permitted samples.

A field passport keeps the source beside the value

Retain the document, page and original passage alongside each extracted value. A summary saying “due in ten days” can lose both “working” and the event that starts the clock. A normalized number is useful for arithmetic; it must not replace the original spelling.

On a phone, scroll the table horizontally.

Field Evidence to retain Check before use
Supplier and invoice number Name, original number, date and page Match approved master data; never invent a missing business identification number
Quantity, price and currency Each line and its unit Pieces are not packs; an absent currency does not mean KZT
Total and adjustments Printed total; tax, discount and freight separately when present Recalculate under agreed rules; do not label an unexplained difference as tax
Bank details Source passage and comparison with the approved record Verify a change separately through the company's established channel
Contract term Verbatim clause, page, revision and related amendments Identify the triggering event, missing evidence and decision owner

DEMO-SUP-A in the teaching set is a fictional master-data key, not a real Kazakhstan business identification number, or BIN. A correctly formatted identifier does not establish the counterparty's identity or entitlement to payment. Mark an absent value unknown rather than filling it with a plausible guess.

A balance scale shows the mismatch between invoice line sum and printed total
Retain both values and the reason for stopping. Conceptual illustration.

The KZT 8,000 difference needs an explanation

In teaching invoice DEMO-009, the first line is 10 × 12,500 = KZT 125,000. The second is 2 × 7,500 = KZT 15,000. Their sum is KZT 140,000, while the page says KZT 148,000. This example contains no additional tax, freight, discount or other adjustment. The difference is KZT 8,000.

A useful extraction retains both totals and marks an amount mismatch. It does not repair the original document or invent a fee to make the arithmetic balance. The employee checks the pages, attachments and amount basis, then requests a correction or confirms a documented adjustment. Until the discrepancy is explained, the packet is not ready for ordinary payment approval.

Use conventional code with decimal arithmetic and an agreed rounding rule for monetary checks. The agent can interpret an ambiguous document and explain an exception. Asking it to “recalculate carefully” is not a substitute for an inspectable formula.

OpenAI's Structured Outputs documentation explicitly separates schema adherence from business-rule validation. An application must also handle refusals, incomplete responses and errors. A JSON object containing the number 148000 can follow the schema while failing reconciliation.

Three exceptions that confidence cannot resolve

A letter in a number. An OCR-shaped variant contains 14O000, with a letter O. Do not silently replace it with zero. Keep the raw string and ask the reviewer to inspect the image. Automatic correction needs a separately tested rule and a retained change trail.

A new file for an old invoice. The supplier resends the same invoice, but the new scan has a different file hash. Compare its business identity: approved supplier, invoice number and date, then amount and content. This is a duplicate candidate, not a reason to delete a file automatically. Number normalization must preserve meaningful prefixes and distinguish corrected revisions.

A deadline without its trigger. The synthetic contract says “within ten working days after signed acceptance.” Neither the acceptance date nor an agreed working-day calendar is supplied. Extract the complete clause and leave the calculated due date empty. The invoice date is not the acceptance date. A lawyer or process owner must establish the applicable clause, revision and amendments.

AWS guidance recommends considering extraction confidence together with the sensitivity of the use case and escalating uncertain results for further scrutiny. It does not give our documents a universal safe percentage. High reading confidence cannot eliminate a duplicate, explain a disputed amount or confirm delivery.

An employee reviews a contract term beside a calendar with a missing trigger
Extracting the clause does not replace a human decision. Conceptual illustration.

Ten teaching cases before connecting the mailbox

Download the English field-and-exception passport. It includes a blank worksheet, a completed example, synthetic source text and instructions for a local check. The program makes no network calls and uses no model: it receives fields prepared in advance.

The ten cases cover a clean packet, an amount mismatch, the letter O in a number, a missing supplier, a rescan, an absent currency, another currency, an unresolved contract deadline, changed bank details and an unchecked source. The local run on 22 November 2026 produced all ten expected routes. This is a check of teaching rules, not an OCR or AI accuracy measurement, or an integration-security test.

Even READY_FOR_HUMAN_REVIEW means only that a person may review the packet. The set contains no payment, contract-signing or ERP-write code. A document's existence and correct arithmetic do not by themselves establish delivery, an obligation or a signatory's authority.

Turn the worksheet into a bounded pilot

Select permitted, redacted samples: an ordinary document, a poor scan, a multipage invoice, a repeat, a correction and incomplete details. An employee should label the expected fields, evidence and exceptions before the trial. Keep the original accessible to the reviewer; a translation must not replace the source RU, KK or EN text.

Measure critical-field correctness, missed exceptions, false stops and human review time separately. An average “document accuracy” score can conceal a rare error in the amount or recipient. Agree acceptance thresholds and error consequences before testing. Ten teaching checks do not justify a production-quality promise.

A universal agent can reuse a working environment, file tools and existing components. A new process still needs field configuration, an approved data path, permissions and employee training: how to open the source, correct an extraction and return a packet for rework. This guide does not claim a ready-made connector for every ERP or a production deployment on an AX/Windows test stand.

For reading accounting-system data, use the separate read-only 1C pilot passport. Extracting an incoming invoice and authorizing a write to accounting are different tasks.

Describe one document class and workflow for a pilot discussion: where the file arrives, which fields matter, what the employee does after review and which actions are prohibited. Do not attach confidential contracts to the initial enquiry. The visible form has been checked in English; its shared HTML language attribute is en. Scope, connection work and pricing are agreed separately.