Skip to content
Parser BlogAccounts Payable10 min readAll posts

How to Extract Data from Purchase Orders: Header, Line Items, Revisions and the Checks Before Matching

To extract data from purchase orders, decide which fields you need, read each PO into a header and a table of line items, check the arithmetic and the revision number, and only then load it where invoices are matched. The steps are simple to list. What makes them hard is that the POs you need to extract are exactly the ones that never lived in your ERP.

In brief

  • To extract data from purchase orders, fix the fields you need first, read each PO into a header and a table of line items, validate the arithmetic and the revision, then load it where invoices are matched.
  • A purchase order has two parts to extract: header fields such as PO number, revision, vendor, ship-to, terms and currency, and line items with item number, description, quantity, unit of measure, unit price and amount.
  • Revisions are the trap: a change order replaces lines of the original PO, so the extraction must record the revision number and the latest revision must supersede the earlier one.
  • Arithmetic checks catch most bad reads: quantity times unit price equals the line amount, lines add up to the subtotal, and subtotal plus tax and freight equals the PO total.

Why purchase orders end up as PDFs

In a tidy world every purchase order is born in the ERP and accounts payable never has to read one. In practice a large share of POs arrive as documents. A subsidiary runs a different system and e-mails its POs as PDFs. A project team issues orders from a spreadsheet template. An acquired business keeps its old purchasing tool for a year. A supplier sends back an order confirmation that changes quantities or prices. A blanket order is signed once and released against in separate documents for months.

Each of those POs is the reference that a vendor invoice will be matched against. If the PO only exists as a PDF in a shared inbox, the invoice cannot be matched by the system: it drops into the exception queue, someone opens both documents side by side, and the match happens by eye. The three-way match exceptions that follow are often not price or quantity problems at all, but a PO the system never saw. Turning those POs into data is the step before matching, and the subject of this guide.

2

parts to extract from every PO: the header and the table of line items

3

arithmetic checks in the example below: line amounts, subtotal and total

5

steps in this guide, from field list to loaded data

What a purchase order contains

The header identifies the order and the commercial terms. It holds the PO number and, when the order has been changed, a revision or change order number. It names the buyer and the vendor, ideally with the vendor number from your vendor master, and gives the bill-to and ship-to addresses. It states the PO date, the requested delivery date, the payment terms (such as 2/10 Net 30), the shipping terms or Incoterms, and the currency.

The table lists what was ordered. Each line carries a line number, your item number or SKU, often the vendor's own part number, a description, the quantity, the unit of measure, the unit price and the extended amount. Some POs add a delivery date or a cost center per line, and service POs may have a single line with an amount and no quantity. Below the table sit the subtotal, tax, freight and the PO total.

Where purchase order extraction goes wrong

Revisions and change orders

A change order is not a new PO: it replaces some lines of the old one. If revision 2 cuts line 3 from 100 units to 60 and both revisions are loaded side by side, the system believes 160 units are on order and will happily match an invoice for 100. Picking up the wrong revision is the most expensive error in PO extraction because nothing looks wrong on the document itself.

Units of measure

The PO orders 4 cases of 10, the invoice bills 40 each, and both are right. A PO that is read without its unit of measure, or without the pack size, produces a quantity mismatch at matching time. Capture the unit as written and the conversion to your base unit as a separate value.

Tables that wrap and spill

Long descriptions wrap onto two or three lines, specifications sit under the item in smaller type, and large orders continue on a second or third page with the header repeated. Each wrapped line must stay with its item, and the lines on the last page must not be lost.

Illustrative
Illustrative share of purchase order extraction errors by cause, for a team reading PDF POs by hand. Numbers are examples, not measured results.

Step 1: decide the fields before reading a single PO

Start from what matching needs. A two-way or three-way match compares the invoice with the PO by PO number, vendor, line, quantity and unit price, so those fields are mandatory. Add the payment terms if you want to capture early payment discounts, the ship-to if receiving is done per site, and the cost center if the PO drives coding. Give every field a name, a type and, for numbers, a unit: unit_price is a decimal in the PO currency, not a string that may say "6.75/EA".

Model the lines as a list of records, not one block of text, and repeat the PO number and revision on each record when you flatten the data into a spreadsheet. Use the same field names as your invoice extraction, so that matching compares two fields with one name. The guide to designing extraction schemas covers typing fields, modelling tables and versioning the schema when a new field is needed.

Step 2: read each PO into those fields

There are three ways to fill the fields. Manual keying needs no setup and does not scale past a few dozen POs a week. Fixed zone templates read each field from the same position on the page: they work for one sender's layout and must be rebuilt for every other sender and every redesign. Model based extraction reads the PO by meaning rather than position and fills your schema whatever the layout, which matters when POs come from several subsidiaries or systems.

Read every page, and keep the source next to the result so a reviewer can see where each value came from. When POs arrive bundled with quotes, order confirmations and delivery notes in one file, split and classify the batch first so the PO template only ever sees purchase orders.

ExampleUpload one PO against a purchase order templatebash
curl -X POST https://api.parserai.co/documents/upload \  -H "Authorization: Bearer $PARSER_API_KEY" \  -F "file=@PO-4471820-rev2.pdf" \  -F "entity_group_id=$PO_TEMPLATE_ID"# 202 Accepted# {"documentId": "...", "extractedDocumentId": "..."}

Step 3: normalize what came back

Raw values need light cleaning before they can be compared. Write dates in ISO format. Convert amounts to numbers with a known currency. Map the vendor name to the vendor number in your vendor master, because "Example Industrial Supply" and "Example Ind. Supply LLC" must resolve to the same supplier. Map units of measure to your codes and record the pack size. Strip spaces from item numbers. None of this needs judgment, and all of it makes the later checks reliable.

Examplepo-extraction.json: one purchase order, revision 2, after normalization and checksjson
{  "po_number": "PO-4471820",  "revision": 2,  "po_date": "2026-11-03",  "buyer": "Facilities Purchasing",  "vendor": { "name": "Example Industrial Supply", "vendor_number": "V-20418" },  "bill_to": "100 Main St, Columbus, OH, US",  "ship_to": "Plant 3, 2200 Rail Way, Dayton, OH, US",  "payment_terms": "2/10 Net 30",  "shipping_terms": "FOB Destination",  "currency": "USD",  "requested_delivery_date": "2026-11-24",  "lines": [    {      "line": 1,      "item": "BRG-6205-2RS",      "vendor_part": "6205-2RS-C3",      "description": "Sealed deep groove ball bearing, 25 x 52 x 15 mm",      "quantity": 40,      "uom": "EA",      "unit_price": 6.75,      "amount": 270.00    },    {      "line": 2,      "item": "LUB-EP2-14",      "vendor_part": "EP2-14OZ",      "description": "EP2 lithium grease, 14 oz cartridge",      "quantity": 4,      "uom": "CS",      "pack_size": 10,      "unit_price": 48.00,      "amount": 192.00    }  ],  "subtotal": 462.00,  "tax": 0.00,  "freight": 25.00,  "total": 487.00,  "checks": [    { "rule": "qty_times_price_equals_amount", "lines": 2, "status": "pass" },    { "rule": "lines_equal_subtotal", "sum": 462.00, "subtotal": 462.00, "status": "pass" },    { "rule": "subtotal_tax_freight_equal_total", "status": "pass" },    { "rule": "revision_is_latest", "known": 1, "received": 2, "status": "pass" }  ]}

Line 2 was ordered in cases, and the extraction kept both the unit and the pack size, so an invoice that bills 40 cartridges each will match 4 cases of 10. The checks at the end record that the arithmetic holds and that this revision is newer than the one already on file.

Step 4: validate before the PO is used for matching

A purchase order checks itself more than most documents, because its numbers are tied together. Run these rules on every extraction:

  • Line arithmetic. Quantity times unit price equals the line amount, allowing for a cent of rounding. A misread digit in any of the three fails it.
  • Lines add up. The sum of line amounts equals the subtotal, and subtotal plus tax plus freight equals the total. A missed continuation page fails this rule at once.
  • Revision is current. A PO number already on file with a higher revision means this document is stale; a lower one on file means this document supersedes it.
  • Vendor is known. The vendor resolves to an active record in the vendor master.
  • Required fields are present. No PO is loaded without a number, a vendor and at least one line.

POs that pass are loaded. POs that fail go to a person with the rule, the values it compared and the page they came from. Before letting the rules decide alone, label a small set of real POs and measure accuracy field by field, weighting quantity, unit price and unit of measure most heavily.

The PO checks itself

Quantity times price, lines to subtotal, subtotal to total: if all three hold, the table was read completely and correctly. If one fails, you know which PO to look at before an invoice is matched against it.

Step 5: load the PO where invoices are matched

Validated POs go into the ERP or AP system through its import or API, or into a spreadsheet with one row per line that the matching process reads. From there the same data does more than matching. Open PO lines with receipts and no invoice are the basis of the GRNI accrual at month end. Invoices that turn out to have no PO at all follow the non-PO coding and approval route instead. And a PO extracted once, completely, is never read by eye again for each invoice that bills against it.

Checklist: extracting purchase order data

  • List the fields matching needs: PO number, revision, vendor, line, quantity, unit, unit price.
  • Model line items as a list of records with the PO number and revision on each.
  • Use the same field names as your invoice extraction.
  • Read every page, including continuation pages with a repeated header.
  • Keep the unit of measure and pack size as written, plus the base-unit conversion.
  • Map vendor names to vendor numbers from the vendor master.
  • Check line arithmetic, lines to subtotal, and subtotal plus tax and freight to total.
  • Let the highest revision supersede earlier ones, never load both.

Where Parser fits

Parser reads purchase orders against an extraction template you define: the header fields and a table of line items, named and typed the way your ERP and your invoice extraction expect. POs come in by upload, e-mail or the API, and the result goes out as JSON, Excel or CSV, or to your system by webhook. The invoice processing page shows the invoice side of the same workflow, the document your extracted POs will be matched against.

Frequently asked questions

FAQ
  • From the header: PO number, revision number, PO date, buyer, vendor name and vendor number, bill-to and ship-to addresses, payment terms, shipping terms, currency and requested delivery date. From the table: one record per line with line number, item or SKU, vendor part number, description, quantity, unit of measure, unit price, line amount and, when present, the delivery date and cost center. Then the subtotal, tax, freight and total.

  • Define the columns first, with the PO number and revision repeated on every row and one row per line item. Read each PO into that layout, by hand or with a document extraction tool that returns the fields as structured data, and check that each line amount equals quantity times unit price and that the lines add up to the PO subtotal before the sheet is used for matching.

  • Not every purchase order lives in the ERP. Subsidiaries on another system, project teams that issue POs from spreadsheets, acquired businesses and suppliers that send order confirmations all produce POs as PDFs. Until those POs are data, invoices against them cannot be matched automatically and end up in a manual exception queue.

  • Capture the revision or change order number as its own field, keep every revision, and treat the highest revision as the current version of the PO. Lines that a change order modifies or cancels should replace the original lines rather than be added to them, otherwise the open quantity on the PO is overstated and invoices match against lines that no longer exist.

More
The newest other posts

More from the blog.

Solutions
Where Parser fits

Related solutions.

  • Invoice processing

    Vendor, tax ID, line items, taxes and due date from invoices and bills.

    Fields vendor tax_id line_items total

    Invoice processing, see use case

Bring a real invoice.

An invoice parser for accounts payable: invoices and bills arrive by upload, e-mail or API, and the fields you define are extracted and checked against your validation rules before they reach your system.

30 minutes · no commitment