How to extract invoice line items
Dynamite Docs, 2026-08-30
Separate invoice fields from line-item fields
An invoice has two levels of data. Vendor, invoice number, invoice date, purchase order, subtotal, tax, and total belong to the invoice. Description, SKU, quantity, unit price, tax rate, and line amount repeat for each item.
Store the repeating fields as rows and attach the invoice-level fields to every row or to a linked invoice record. Flattening everything into one wide row makes invoices with ten items hard to use.
Choose the columns you actually need
Start with description and line amount. Add quantity, unit, SKU, unit price, discount, tax rate, or tax amount only if they appear in the source or matter downstream. Empty columns create review work without adding value.
- Invoice number and vendor for traceability
- Description or item name
- Quantity and unit of measure
- Unit price, discount, tax, and line amount
- Source page for review
Watch for descriptions that wrap onto a second line
Long descriptions often continue below the main row. The continuation may have no quantity or amount, so a basic extractor treats it as a separate item. Join it to the previous row only when the surrounding columns are blank and the reading order supports that choice.
Do not merge rows simply because one field is empty. Service invoices and milestone bills often contain legitimate rows without quantities.
Handle discounts, tax, and subtotal rows deliberately
A discount can appear as a negative item, a percentage inside a row, or an invoice-level adjustment. Preserve the form shown on the invoice. Exclude subtotal and grand-total lines from the item table, but retain them as invoice-level values for reconciliation.
For tax-inclusive invoices, do not invent a separate tax amount unless the source provides it or a reviewer approves a calculation rule.
Run the line-item math
Where the invoice provides enough detail, compare quantity multiplied by unit price, less discount, plus line tax, with the printed line amount. Then compare the sum of extracted line amounts with the printed subtotal. A mismatch should create a review task, not an automatic correction.
Review one supplier, then scale to the rest
In Dynamite Docs, upload a representative invoice and inspect the inferred item table. Correct any wrapped descriptions or misplaced totals in Data Studio. Saved corrections help with repeat layouts, while schema inference handles new suppliers without a box-drawing template.
After the sample reconciles, run the remaining invoices as a batch and export one row per item to Excel, CSV, Google Sheets, or your own system through the API.
Related workflow: Invoice data extraction software for review-ready rows.
Try it yourself. Upload a PDF, scan, or image and let Dynamite Docs infer the schema.