AI & Workflow Automation
How to extract invoice data with AI and keep it accurate
AI can read invoices from PDFs and scans. Learn the review step, the checks and the tests that stop wrong numbers reaching your books.
AI can read a PDF or scanned invoice and pull out the supplier, date, invoice number, line items and totals. It saves typing. It also makes mistakes that look tidy, such as a total with one digit wrong, and a wrong number that reaches your books costs more than the typing it saved.
The safe way to use it is simple. Let the software read, let checks catch the obvious errors, and let a person approve what is left. This guide shows how, including a test you can run on your own invoices before you commit to any tool.
What gets extracted and where it goes
Most tools aim to fill the same set of fields from each document.
- Supplier name and address.
- Invoice number and invoice date.
- Due date and payment terms.
- Line items with description, quantity, rate and amount.
- Subtotal, tax amounts and grand total.
- Currency.
- Tax registration numbers.
The output goes somewhere your team already works. That may be accounting software, a spreadsheet, an approval workflow or a payment run. Decide the destination first, because it fixes which fields you need and in what format. An extractor that fills thirty fields is no help if your books use eight.
Template tools vs AI tools
The older approach is the template tool. You mark where each field sits for each supplier, and the software reads that position. It is predictable and works well for suppliers who always send the same layout. It breaks when a supplier changes the layout, and it needs setup for every new supplier.
AI tools read the page more like a person does. They look for a total near the bottom or a date near the top, whatever the layout. They handle new suppliers without setup. The cost is that they can guess. A template tool usually fails loudly with an empty field. An AI tool can fill the field with a plausible wrong value.
| Template tool | AI tool | |
|---|---|---|
| New supplier layout | Needs setup | Often works straight away |
| Layout change | Can break | Usually copes |
| Typical failure | Empty or missing field | Confident wrong value |
| Needs checks | Yes | Yes, more of them |
| Good fit | Few suppliers, fixed layouts | Many suppliers, mixed layouts |
Many businesses end up with a mix. A fixed template for the five suppliers that send most of the volume, and AI for the long tail.
Why a human review step still matters
An invoice is a payment instruction. If a field is wrong, you may pay the wrong amount, claim the wrong tax or pay the same bill twice. Scanned and photographed invoices are the hardest, because a crease, a stamp or a blurred digit can turn a 3 into an 8.
So build a review step into the process from day one. A good review screen does four things.
- It shows the original invoice next to the extracted fields.
- It highlights, on the invoice itself, where each value was read from. One click on a field should show the exact spot.
- It flags fields the software is unsure about or that failed a check, so the reviewer looks at those first.
- It records who approved the entry and when.
A reviewer who only sees a list of numbers will approve them all. A reviewer who can see the source spot will catch errors.
What stays a person's job: approving payment, handling disputes, deciding what to do with a flagged invoice, and checking any new supplier's bank details through a second channel. The extractor prepares the entry. A person decides.
Check totals, duplicates and missing fields automatically
Checks are cheap and catch many errors without a reviewer. Run them on every invoice.
- Arithmetic. The line amounts should add up to the subtotal. Subtotal plus tax should equal the total. If not, flag the invoice.
- Missing fields. Invoice number, date, supplier and total must all exist.
- Duplicates. Reject or flag a second invoice with the same supplier and invoice number. Also flag the same supplier, date and amount with a different number.
- Dates. An invoice date in the future, or years in the past, is probably a misread.
- Known suppliers. A supplier name that is close to a known one but not the same needs a look.
- Format. Dates, numbers and tax registration numbers should match the expected pattern.
Here is a simple example in code. It is a sketch to show the idea, not a finished product.
def check_invoice(inv, seen):
problems = []
lines_total = sum(line["amount"] for line in inv["lines"])
if round(lines_total, 2) != round(inv["subtotal"], 2):
problems.append("Line items do not add up to the subtotal")
if round(inv["subtotal"] + inv["tax"], 2) != round(inv["total"], 2):
problems.append("Subtotal plus tax does not equal the total")
for field in ("supplier", "invoice_no", "date", "total"):
if not inv.get(field):
problems.append("Missing field: " + field)
key = (inv.get("supplier"), inv.get("invoice_no"))
if key in seen:
problems.append("Possible duplicate")
seen.add(key)
return problems
Any invoice with a non-empty list goes to a person, with the problems shown.
Test on your own invoices before you commit
Do not judge a tool by its demo or by a percentage on its website. Judge it on your invoices, in your formats, from your suppliers.
- Pick a sample. Choose invoices from many suppliers. Include clean PDFs, scans, phone photos, long multi-page bills, and any odd ones your team dreads. Pick enough that the mix is realistic for you.
- Write the right answers first. Have a person enter the fields by hand for each sample. This is your answer key.
- Run the tool on the same invoices without touching the results.
- Count field-level errors. Compare each field to the answer key. Count a wrong value, a missing value and an extra value as errors. Count per field, not per invoice, because one invoice with one wrong total is a very different problem from one with ten wrong fields.
- Weight the fields. A wrong total matters more than a wrong address line. Mark which fields must never be wrong.
- Set your pass line before you look at the results. For example, "no errors allowed in total, date and invoice number after review, and any error in other fields must be caught by a check or the reviewer". The line is yours to choose, based on what a mistake costs you.
- Repeat after changes. Run the same set again when you change the tool, the settings or the prompt. Add new problem invoices to the set as they appear.
Keep the results in a table like this one. The rows below are placeholders to fill in, not results.
| Invoice | Supplier | Format | Field | Expected | Tool output | Error? |
|---|---|---|---|---|---|---|
| (your file name) | (supplier) | PDF, scan or photo | Total |
Keep the source PDF linked to every entry
Every entry in your books should open the original invoice in one click. Store the file with a stable ID, and save that ID with the extracted data. Keep the original untouched, and keep the extracted values as a separate record.
This helps in three ways. Your reviewer can check a figure quickly. An auditor or an accountant can trace a number. And if you later find a bug in the extraction, you can re-run old invoices instead of guessing which ones were affected.
Also record which version of the tool or model produced each entry, and who approved it.
GST and tax fields: what to confirm with your accountant
Invoices in India carry tax details, and the rules about what an invoice must show come from the tax authorities. In general terms, the fields to extract are the supplier's tax registration number, the invoice number and date, the taxable value, the tax amounts and rates, the place of supply, and the total. Which ones apply, how tax splits between central and state components, and what is claimable depend on the supplier, the goods or service, and your own registration.
This post does not state the rules. The official source is the GST portal (opens in a new tab), where the Act, rules, notifications and help pages sit. Before your extraction feeds any GST return or input credit claim, ask your accountant to confirm three things. They should confirm which fields you must capture, how to validate the supplier's registration number, and which invoices need extra handling. Then add those rules to your automatic checks.
Where to go from here
Start with a sample of your own invoices and the test above, and decide the pass line before you see any results. If you want a reading step with review screens and checks built around your accounting software, our AI automation service covers it.
