Schema CPA

Invoice Data Extraction: Header Fields and Where It Breaks

By Schema CPAPublished Updated

Invoice data extraction is pulling the vendor, invoice number, invoice date, due date, subtotal, tax, total and currency off an invoice into fields a spreadsheet can use. The vendor and total come off most invoices cleanly. Dates and invoice numbers break most often, so every extracted field needs a validation rule before the data reaches the books.

Which invoice header fields can be extracted reliably?

Invoice header fields are the values printed once per invoice, usually at the top or in a summary box: who issued it, its number, its dates and its totals. Fields that every vendor prints with a clear label, such as the total, extract most reliably. Fields that vendors name, place and format differently need more checking.

The header is worth separating from the line items. Line items are the rows of the item table, one per product or service, and they vary far more from vendor to vendor. This post covers the header. Item tables, and the check that the printed total equals the sum of the rows, are covered in the post on whether the invoice total matches its line items.

Accounting firms care about the header because it is what the books need first. The IRS page on what kind of records to keep lists invoices among the supporting documents for expenses and says those documents should show the payee, the amount and the date, along with a description that shows what was bought. Payee, amount and date are all header fields.

Some header fields are close to universal. Almost every vendor invoice names the vendor, shows a total and carries some kind of date. Others vary:

  • Invoice number may be labelled "Invoice #", "Inv No.", "Document number" or "Reference", and some vendors print an order number and a customer number nearby that look just as plausible.
  • Due date is sometimes printed as a date and sometimes only as terms, such as "Net 30", which means the date has to be worked out from the invoice date.
  • Tax may be one line, several lines for different rates, or absent because the item was not taxed.
  • Currency is rarely printed at all on a domestic invoice. A dollar sign is the only clue.

Eight header fields with sample values and checks

The table below shows one fictional invoice from an example vendor to an example client. All names and amounts are made up for illustration.

FieldSample value (example)Validation rule
VendorLakeside Paper Supply Co.Matches a known vendor for this client, or is flagged as new
Invoice numberINV-004821Kept as text; not already recorded for this vendor
Invoice date2026-03-04Not in the future; inside the period being worked
Due date2026-04-03On or after the invoice date; agrees with printed terms
Subtotal1,240.00Equals the sum of the line items when lines are captured
Tax99.20Zero or positive; present when the invoice shows a tax line
Total1,339.20Equals subtotal plus tax plus any freight or fees
CurrencyUSDOne of the currencies the client actually uses

In this example, the due date sits 30 days after the invoice date, which matches "Net 30" terms. A due date that came out earlier than the invoice date would fail its rule and go to a person.

Invoice number and date extraction: formats that trip parsers

Invoice number and date extraction fails more often than any other header field because both look like ordinary numbers to software. A parser is the step that turns the text it read into a typed value. It can drop an invoice number's leading zeros or swap a date's day and month, and the result still looks valid.

Take a date printed as 03/04/2026. In the United States that is usually read as March 4. A vendor in a country that writes the day first means April 3. Nothing on the page says which convention applies, so a parser has to guess from the vendor's address, the other dates on the invoice, or the client's settings. Excel has the same problem when text becomes a date: Microsoft's help page for the Excel DATEVALUE function warns that the computer's system date setting can change what the function returns.

Useful ways to settle an ambiguous date:

  • If either the day or the month is above 12, the order is no longer in doubt. A date of 03/14/2026 can only be March 14.
  • Compare it with the due date and terms. If the invoice says "Net 30" and the due date reads 05/03/2026, only one reading of the invoice date leaves a 30-day gap.
  • Record dates in an unambiguous form, such as 2026-03-04, once they are settled, so the next person or program does not have to guess again.

Invoice numbers fail in a different way. Many vendors pad numbers with leading zeros (004821) or add prefixes and suffixes (INV-004821, 4821-A). If the field is treated as a number, the zeros disappear, and INV-004821 and 4821 stop matching each other. Microsoft's page on keeping leading zeros and large numbers in Excel says Excel automatically removes leading zeros and only keeps 15 significant digits, and recommends setting the column to Text in Power Query when importing. Keep the invoice number as text everywhere, exactly as printed.

A last trap is the wrong number. An invoice often prints an invoice number, a purchase order number, a customer account number and a packing slip number in the same corner. Extraction that grabs the first number near the word "number" can record the customer account on every invoice from that vendor. That error shows up quickly when every invoice from one vendor has the same "invoice number".

Where do invoice extraction errors creep in?

Invoice extraction errors creep in at three stages: the file, the reading of the text, and the mapping of text to fields. On scans and phone photos, the file and the reading cause most problems. On PDFs created by the vendor's billing system, the text is already exact, so mapping causes nearly all of them.

The file. A crooked phone photo, a low-resolution fax or a page cut off at the edge loses information before any software looks at it. No later step can recover a total that is not in the image. The difference between a scan and a PDF that already contains its text is explained in what separates a scanned invoice from an emailed PDF invoice.

The reading. On an image, characters have to be recognised. This is the job of OCR (optical character recognition), and its typical misreads are look-alike characters such as 0 and O, 1 and l, or 5 and S, and a lost decimal point. How OCR reads the page before any fields are chosen is the subject of what invoice OCR does beyond text recognition.

The mapping. Mapping is deciding which piece of text is which field. Even with perfect text, a program has to decide that "1,339.20" next to "Amount due" is the total and that "1,240.00" next to "Subtotal" is not. Mapping fails when a vendor uses an unusual label, puts the total at the top of the page, prints a previous balance next to the current charges, or shows both a total before and after a credit. The difference between reading text and understanding a document is the subject of OCR vs intelligent document processing.

Knowing the stage tells you the fix. A file problem means asking the client or vendor for a better copy. A reading problem means checking the characters against the image. A mapping problem means the text is right and the field is wrong, so the fix is a correction to that vendor's layout or a person reviewing it.

Validation rules for extracted invoice data

Validation rules for extracted invoice data are checks that every field must pass before the invoice is accepted. They catch a wrong total, a missing tax amount or a future-dated invoice without anyone retyping the invoice. A failed rule sends that one invoice to a person, and the invoices that pass go straight through.

Good rules test what can be known from the invoice and the client's records, not what software thinks it saw. The most useful ones:

  1. Arithmetic. Subtotal plus tax plus freight and fees should equal the total, to the cent. This single rule catches most misread digits, because a wrong digit almost never leaves the sum intact.
  2. Dates in range. The invoice date should not be later than today and should fall inside the period the firm is working on. A 2025 invoice in a 2026 batch may be real, but it deserves a look.
  3. Date order. The due date should be on or after the invoice date.
  4. Required fields present. Vendor, invoice number, date and total should never be blank. A blank tax field is acceptable only when the invoice shows no tax.
  5. Known vendor. A vendor name that has never appeared for this client before is worth a glance, both for spelling variants of a known vendor and for invoices that do not belong to the client.
  6. Not already recorded. The vendor and invoice number pair should be new. The same pair twice usually means the same invoice was forwarded twice.
  7. Plausible amount. A total far above that vendor's usual range for this client is often a misplaced decimal point.

Rules should fail loudly and specifically. "Total does not equal subtotal plus tax by 9.00" tells a reviewer where to look. "Low confidence" does not.

Some rules need care. Rounding on invoices with several tax rates can leave the sum a cent off, so decide in advance whether a one-cent difference passes. A credit memo has a negative total and should be checked as a credit, not rejected as an impossible amount.

When invoice data extraction is not worth automating

Invoice data extraction is not worth automating when a client sends a handful of invoices a month from the same few vendors. At that volume, typing the eight header fields takes minutes, and setting up and checking an automated process can take longer than the typing it replaces. Automation pays when volume or vendor variety grows.

Hand entry stays reasonable in these cases:

  • Low, steady volume. A client with ten invoices a month from three vendors is quick to key, and the person keying it learns each layout.
  • One vendor dominates. If almost every invoice comes from one supplier, that supplier's export or statement may already carry the data in a file, which is better than reading invoices at all.
  • Mostly handwritten invoices. Handwritten totals and dates are the hardest input to read, so they need a person's review either way.

Automation starts to pay when invoices arrive from many vendors across many clients, when the same invoice arrives more than once through different channels, or when the firm spends real staff time each month retyping headers. The validation rules above still apply when entry is done by hand. People mistype too, and the arithmetic check catches a typing slip as well as a misread.

A useful test is to time one month of invoice entry for one typical client, including the time spent finding which invoices arrived twice. The hours calculator on the homepage estimates that cost across all clients from documents per client and minutes per document, and the post on invoice automation works through the same comparison with example numbers.

Extracting invoice data from a PDF with Schema CPA

Extracting invoice data from a PDF with Schema CPA starts with the client's upload link. Vendor invoices land in the client's file with every other document, each page is classified by document type, issuer and period, and the extracted data exports to Excel or CSV for the firm to review.

Invoices tend to reach a firm by several routes at once: a PDF attached to an email, a photo of a paper copy, a download from a supplier portal. Schema CPA puts all of them in one file per client. When a vendor's invoice turns up twice, for example once from the client and once forwarded by the client's bookkeeper, it is flagged as a duplicate rather than counted a second time.

The export is a spreadsheet file, Excel or CSV, so the validation rules above can run as formulas or filters before anything is posted. Schema CPA does not connect to accounting software today. The document categories on the homepage list receipts and vendor invoices alongside the other document types it reads.

All posts in Receipts and invoices