Commercial Invoice Parser

Extract seller, buyer, incoterms, HS codes, and line items from commercial invoices into JSON, CSV, Excel, or XML.

Drag & drop your document here

Supports PDF, JPG, PNG, WEBP

A commercial invoice is the document that moves goods across a border — customs officers use it to assess duty, brokers use it to classify shipments, and freight forwarders use it to clear cargo. Docyield reads one from a PDF or a photo and returns the trade data in structured form: seller and buyer, country of origin and destination, incoterms, currency, the line items with their HS codes, and the freight, insurance, subtotal, and total. Export it as JSON, CSV, Excel, or XML.

This is a different animal from a domestic sales invoice. The fields that matter here are the ones customs cares about — the harmonized tariff code on each line, the agreed incoterm that decides who pays freight and bears risk, the origin that drives preferential duty, and the CIF build-up of goods plus freight plus insurance. Docyield is tuned to those export-and-import specifics, reading the document in context so a tariff code is captured against the right line and an incoterm is never confused with a payment term.

Inputs
PDF, JPG, PNG, WEBP
Outputs
JSON · CSV · Excel · XML
Price
Free · no signup

What a commercial invoice parser extracts

The job is to turn a trade document into the structured record a customs filing or a logistics system expects. That means the parties to the trade — the seller or exporter and the buyer, importer, or consignee — together with the movement of the goods: where they originate, where they are bound, and on what delivery terms. It also means the financial build-up: the value of the goods, the freight and insurance added to reach a landed figure, and the grand total declared.

Each line of goods carries its own detail, and the HS code is the part that sets a commercial invoice apart. Docyield captures the description, the Harmonized System or tariff code, the quantity, the unit price, and the line amount for every item, so the classification used to assess duty travels with the goods it describes rather than being divorced from it in a separate lookup.

HS codes, incoterms, and customs clearance

Harmonized System codes are the language of customs. They determine the duty rate, the controls, and the paperwork a shipment attracts, and getting them onto a clean line-by-line table is half the battle in preparing a declaration. By extracting the HS code alongside each item's description and value, Docyield produces exactly the structure a broker or a customs platform needs to classify and value the consignment.

Incoterms carry just as much weight. Whether a shipment moves FOB, CIF, EXW, or DAP changes who arranges carriage, who insures it, and where risk passes — and it shapes how the declared value is built up. Capturing the incoterm as its own field, separate from the freight and insurance figures, means a downstream system can apply the right valuation logic instead of inferring it from prose. Origin and destination round out the picture, since origin can unlock preferential duty under a trade agreement.

Who uses commercial invoice extraction

  • Customs brokers and freight forwarders preparing import and export declarations.
  • Importers and exporters keeping a clean record of shipment values and classifications.
  • Logistics and supply-chain teams reconciling shipping documents against orders.
  • Trade-compliance teams auditing HS codes, origins, and declared values.
  • Finance teams capturing landed cost — goods, freight, and insurance — for costing.
  • Developers building customs, freight, or trade-management software that ingests invoices.

Why structured trade data beats manual keying

Re-keying a commercial invoice into a customs system is slow, and in cross-border trade the cost of an error is not just a typo — a wrong value or a mis-keyed tariff code can mean a held shipment, a reassessed duty bill, or a compliance penalty. Pulling the data straight from the source removes the transcription step where those mistakes are born.

Consistency matters even more across many shipments. When every invoice yields the same fields — the same place for the incoterm, the same place for origin, the same line-level HS code — a broker or a platform can process a stream of consignments without re-learning each exporter's layout. The fixed schema means the data is comparable shipment to shipment, which is what makes bulk customs and logistics work feasible.

Accuracy, validation, and review

Customs work demands honesty about accuracy, because the stakes are real. Docyield reads clean commercial invoices reliably, but it does not promise flawless results on every document, and it never invents data: where an HS code, an incoterm, or a charge is genuinely absent, the field is returned empty rather than guessed. A blank that prompts a check is far safer than a fabricated tariff code on a declaration.

Built-in arithmetic gives you a quick safety net — the line amounts should sum to the subtotal, and the subtotal plus freight plus insurance should tie to the declared total. When those do not reconcile, that is your cue to review the document. Faint scans, multi-page goods tables, and unusual layouts are the cases most worth a second look, and a quick comparison against the original keeps the rare mistake from flowing into a filing.

Output formats, API, and batch

Each parse exports as JSON, CSV, Excel, or XML from the same result. JSON suits feeding a customs or freight platform; CSV and Excel suit reconciling values and classifications in a spreadsheet; XML fits the EDI-style imports many trade systems still use. The free tool reads one invoice at a time, which fits an occasional shipment.

For brokers and importers handling steady volume, the Docyield API and batch dashboard run the same extraction at scale, with webhook delivery and your own validation rules — so you can enforce, say, that every line has an HS code before a record is accepted. The schema is identical between the free page and the API, so prototyping here carries straight into production.

What the commercial invoice parser extracts

Each commercial invoice is returned against a fixed schema. Fields not present on the document come back empty rather than guessed.

Invoice number
The commercial invoice number.
Invoice date
The date the invoice was issued.
Seller
The seller or exporter of the goods.
Buyer
The buyer, importer, or consignee receiving the goods.
Country of origin
Where the goods were produced or originate from.
Country of destination
The final destination country of the goods.
Incoterms
The terms of delivery, such as FOB, CIF, or EXW.
Currency
The ISO currency code or symbol used.
Items
Each line of goods, with description, HS / tariff code, quantity, unit price, and line amount.
Subtotal
The sum of the line items.
Freight
Freight or shipping charges added to the value.
Insurance
Insurance charges added to the value.
Total
The total declared invoice value.

How to extract data from a commercial invoice

  1. 1Upload the commercial invoice — drop a PDF, PNG, JPG, or WEBP onto the box above, or click to choose a file.
  2. 2Wait a few seconds while Docyield reads the document and pulls out the parties, terms, and line items.
  3. 3Check the HS codes, incoterm, and that line amounts reconcile to the subtotal and total against the original.
  4. 4Choose your output tab — JSON, CSV, Excel, or XML.
  5. 5Download the file or copy the data into your customs, freight, or trade-management system.

Frequently asked questions

Processing documents at scale?

Batch upload, an extraction API, and webhooks for 100+ documents a month.

View the API

Related tools