Free download: the field map we use as a starting point (CSV), with 21 fields and the check for each one. Open it in Excel or Google Sheets and delete what you do not need.
A commercial invoice and a packing list describe the same shipment from two angles: the invoice says what was sold and for how much, the packing list says what is physically in each carton or pallet. When a team types both into a broker system, a TMS or a spreadsheet, errors are not limited to typos. They can also be mismatches: a quantity that differs between the two documents, a missing country of origin on one line, freight charges buried in the unit price, or a gross weight that does not match the bill of lading.
This guide covers which fields to extract, the rules that catch those mismatches automatically, and where a person must still look. It builds on our general article on why OCR alone is not enough for invoices; here the focus is cross-border shipping documents.
Why these two documents need their own approach
Accounts-payable invoices are mostly about a total and a supplier. Shipping documents carry more fields per line and the fields have to agree across documents. In the United States, the contents of a commercial invoice for customs are set out in 19 CFR 141.86. Among other things it asks for the port of entry, the parties and the time and place of the sale, a detailed description of the goods with marks and numbers, quantities, the purchase price of each item in the currency of the sale, itemized charges such as freight, insurance, commissions and packing, and the country of origin. It also requires the invoice to be in English or come with an accurate English translation, and to show in adequate detail what each individual package contains, which is the job a packing list usually does.
Other countries have their own rules, and brokers often have house requirements on top. The point for data extraction is the same everywhere: the output is only useful if each required field is present and the documents agree with each other.
The fields to capture
Start from the decision the data feeds (a customs entry, a freight quote, a landed-cost sheet, a three-way match) and capture only what that decision needs. A typical set looks like this:
| Document | Header fields | Line fields |
|---|---|---|
| Commercial invoice | Invoice number and date, seller, buyer or consignee, port of entry, Incoterms, currency, freight, insurance and packing charges, invoice total | Description, quantity and unit, unit price, line total, country of origin, HS code if shown, marks and numbers |
| Packing list | Reference to the invoice, total packages, total gross and net weight, total volume | Package number or range, contents and quantity per package, weight per package, dimensions |
| Bill of lading or air waybill | Shipper, consignee, notify party, ports, vessel or flight, package count, gross weight | Usually none, or container numbers |
Keep the original wording of each description as well as any cleaned-up version. A broker classifying the goods needs to see exactly what the seller wrote.
The checks that catch most errors
Extraction software can read these fields quickly. What makes the output trustworthy is a set of rules that run on every document. These are the ones we start with:
- Arithmetic on the invoice. Quantity times unit price equals the line total (with a small rounding tolerance), lines add up to the subtotal, and subtotal plus charges minus discounts equals the invoice total.
- Quantities across documents. For each item, the quantity summed over all packages on the packing list equals the quantity on the invoice line.
- Count and weight against the transport document. Total packages and gross weight on the packing list match the bill of lading or air waybill, within an agreed tolerance for weight. Net weight is never higher than gross weight.
- Required fields present. Every line has a country of origin, a unit of measure and a currency; descriptions are specific (a line that just says "parts" or "samples" is flagged).
- Charges itemized. Freight, insurance and packing appear as separate amounts and are consistent with the Incoterms rule (for example, a CIF invoice that shows no insurance gets a flag).
- Duplicates. The same seller and invoice number has not been processed before.
- Language. Documents not in English are flagged for translation instead of being keyed as they are.
Where a person still has to look
Some decisions should not be automated, and a good workflow makes them visible instead of hiding them:
- Classification. If an HS code is printed on the invoice, capture it, but treat it as the seller's suggestion. Tariff classification is the importer's and broker's responsibility, so the workflow sends it for review and never "corrects" it on its own.
- Valuation questions. Assists, royalties, related-party prices or a price that looks far off the usual range are noted for the broker, not resolved by software.
- Bad scans and handwriting. Stamps over figures, faxed copies and handwritten corrections usually fall below the confidence threshold and should be keyed or confirmed by hand.
This guide explains a data workflow. It is not legal or customs advice; for requirements that apply to a specific shipment, check with a licensed customs broker.
How to run a fair pilot
Before you commit to any tool or service, test it on your own documents:
- Pick 20 real shipments with all three documents, including a few difficult ones (multi-page invoices, mixed currencies, poor scans).
- Agree the field list and output format in advance, using the CSV above as a starting point.
- Have one of your people key the same 20 sets as the reference.
- Compare field by field: how many fields were correct, how many were flagged for review, and how many wrong values got through without a flag. The last number matters most.
- Agree how files are transferred, who can access them and when they are deleted.
Our document data extraction team runs exactly this kind of pilot with a free 20-document test, and our DocuMind AP demo shows the same pattern (values highlighted on the page, checks in code and a review queue) on test invoices issued from our own brands to a test customer. Our sister brand eFiling Ready applies the same checking approach to CPSC certificate data for importers.
Frequently asked questions
What is the difference between a commercial invoice and a packing list?
The commercial invoice records the sale: what was sold, quantities, prices, charges, currency and country of origin. The packing list records the physical shipment: which package holds which goods, plus weights and dimensions. Customs and carriers use both, and the quantities and marks on the two should agree.
Which fields does US Customs require on a commercial invoice?
19 CFR 141.86 lists them. Among others: port of entry, the parties and the time and place of sale, a detailed description with marks and numbers, quantities, the purchase price of each item in the currency of sale, itemized charges such as freight and insurance, and the country of origin. The invoice must be in English or have an accurate translation and must show what each package contains.
Can AI extract HS codes automatically?
It can read an HS code that is printed on a document. Choosing the correct classification is a legal responsibility of the importer and broker, so a careful workflow captures printed codes for review and does not assign or change them by itself.
How accurate is automated extraction on shipping documents?
It depends heavily on scan quality and layout variety, so any single accuracy figure is meaningless without your documents. Measure it in a pilot: count correct fields, flagged fields and, most importantly, wrong values that were not flagged.
What file types can be processed?
Digital PDFs, scanned PDFs and photos or images of documents. Digital PDFs give the most reliable results; scans and photos depend on resolution and on stamps or handwriting over the figures.