Extract Commercial Invoice Extractor Data — Automate Operations

Supply chain operations process thousands of shipping documents daily. Manual data entry causes delays and inventory errors.

120
Fields Extracted
300s
Max Processing

What This Template Does

AI-powered extraction using gemini-2.5-flash. Part of 113 production-ready templates.

Capabilities

  • Logistics Extraction
  • Commercial Invoice Processing
  • Customs Valuation
  • Trade
  • Commercial Invoice

Output Schema

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Commercial Invoice Extraction Schema",
  "description": "JSON Schema for Commercial Invoice document extraction output",
  "type": "object",
  "required": [
    "document_type",
    "invoice_number",
    "invoice_date"
  ],
  "properties": {
    "document_type": {
      "type": "string",
      "const": "commercial_invoice",
      "description": "Document type identifier"
    },
    "invoice_number": {
      "type": "string",
 
...

Quick Start

$ pip install doclayer
$ doclayer process document.pdf --agent logistics.commercial-invoice

See It In Action

Real extraction example showing input document and structured output.

Input Document
COMMERCIAL INVOICE

MASCHINENBAU SCHMIDT GMBH
Industriestrasse 125
D-70565 Stuttgart
Germany

VAT: DE123456789
EORI: DE123456789012345
Tel: +49 711 123 4567
Email: export@schmidt-maschinen.de

Invoice No: MS-2024-INV-00892
Invoice Date: March 28, 2024

SOLD TO / BUYER:                              SHIP TO:
AMERICAN MANUFACTURING SOLUTIONS INC.         Same as Buyer
2500 Industrial Parkway
Detroit, MI 48201
United States
EIN: 38-4567890
Contact: Robert Johnson
Tel: +1 313 555 8900
Email: rjohnson
Extracted Data
{
  "document_type": "commercial_invoice",
  "invoice_number": "MS-2024-INV-00892",
  "invoice_date": "2024-03-28",
  "seller": {
    "name": "MASCHINENBAU SCHMIDT GMBH",
    "address": {
      "street": "Industriestrasse 125",
      "city": "Stuttgart",
      "state_province": null,
      "postal_code": "D-70565",
      "country": "Germany",
      "country_code": "DE"
    },
    "tax_id": "DE123456789",
    "eori_number": "DE123456789012345",
    "contact": null,
    "phone": "+49 711 123 4567",
    "email": "export@schmidt-maschinen.de"
  },
  "buyer": {
    "name": "AMERICAN MANUFACTURING SOLUTIONS INC.",
    "address": {
      "street": "2500 Industrial Parkway",
      "city": "Detroit",
      "state_province": "MI",
      "postal_code": "48201",
      "country": "United States",
      "country_code": "US"
    },
    "tax_id": "38-4567890",
    "eori_number": null,
    "contact": "Robert Johnson",
    "phone": "+1 313 555 8900",
    "email": "rjohnson@amsmfg.com"
  },
  "ship_to": {
    "name": "AMERICAN MANUFACTURING SOLUTIONS INC.",
    "address": "2500 Industrial Parkway, Detroit, MI 48201, United States",
    "country_code": "US"
  },
  "references": {
    "purchase_order": "AMS-PO-2024-0156",
    "sales_order": "MS-SO-2024-0789",
    "contract_number": null,
    "lc_number": null,
    "proforma_invoice": "MS-PI-2024-0654",
    "customer_reference": null
  },
  "shipping_info": {
    "ship_date": "2024-03-30",
    "ship_via": "Ocean Freight (FCL)",
    "vessel_flight": "HAMBURG SUD EXPRESS V.025W",
    "port_of_loading": "Hamburg, Germany",
    "port_of_discharge": "Detroit, MI (via New York)",
    "final_destination": "Detroit, MI",
    "country_of_origin": "Germany",
    "country_of_export": "Germany"
  },
  "terms": {
    "incoterms": "FOB",
    "incoterms_place": "Hamburg",
    "payment_terms": "Net 60 Days",
    "payment_method": "Wire Transfer",
    "currency": "EUR"
  },
  "line_items": [
    {
      "line_number": 1,
      "item_number": "SM-CNC-500",
      "description": "CNC Milling Machine Model SM-500X 5-Axis Vertical Made in Germany",
      "hs_code": "8459.61.0040",
      "country_of_origin": "Germany",
      "quantity": 2,
      "unit_of_measure": "PCS",
      "unit_price": 45000,
      "total_price": 90000,
      "net_weight": null,
      "net_weight_unit": "KG",
      "gross_weight": null,
      "gross_weight_unit": "KG"
    },
    {
      "line_number": 2,
      "item_number": "SM-CTRL-200",
      "description": "Control Panel Assembly Siemens SINUMERIK 840D Made in Germany",
      "hs_code": "8537.10.9070",
      "country_of_origin": "Germany",
      "quantity": 2,
      "unit_of_measure": "PCS",
      "unit_price": 8500,
      "total_price": 17000,
      "net_weight": null,
      "net_weight_unit": "KG",
      "gross_weight": null,
      "gross_weight_unit": "KG"
    },
    {
      "line_number": 3,
      "item_number": "SM-TOOL-KIT",
      "description": "Precision Tool Set HSS & Carbide Made in Germany",
      "hs_code": "8207.70.0045",
      "country_of_origin": "Germany",
      "quantity": 4,
      "unit_of_measure": "SET",
      "unit_price": 2250,
      "total_price": 9000,
      "net_weight": null,
      "net_weight_unit": "KG",
      "gross_weight": null,
      "gross_weight_unit": "KG"
    },
    {
      "line_number": 4,
      "item_number": "SM-SPARE-01",
      "description": "Spare Parts Package Spindle bearings, belts Made in Germany",
      "hs_code": "8466.93.9885",
      "country_of_origin": "Germany",
      "quantity": 2,
      "unit_of_measure": "PKG",
      "unit_price": 3500,
      "total_price": 7000,
      "net_weight": null,
      "net_weight_unit": "KG",
      "gross_weight": null,
      "gross_weight_unit": "KG"
    }
  ],
  "totals": {
    "subtotal": 123000,
    "discount": 6150,
    "discount_reason": "5% Volume Discount",
    "freight_charges": 2450,
    "insurance": 0,
    "other_charges": 0,
    "other_charges_description": null,
    "total_invoice_value": 119300,
    "currency": "EUR"
  },
  "weight_summary": {
    "total_packages": 8,
    "package_type": "Wooden Crates",
    "total_net_weight": 4250,
    "total_gross_weight": 4890,
    "weight_unit": "KG",
    "total_volume": 28.5,
    "volume_unit": "CBM"
  },
  "customs_info": {
    "export_license_required": false,
    "export_license_number": null,
    "eccn": "EAR99",
    "schedule_b": null,
    "aes_itn": "X20240328123456",
    "reason_for_export": "SALE",
    "ultimate_consignee": null
  },
  "declarations": {
    "country_of_origin_statement": "We hereby certify that the goods described above are of German origin and the invoice value shown represents the true and correct value of the goods.",
    "value_declaration": "The invoice value shown represents the true and correct value of the goods.",
    "authorized_signature": true,
    "signature_name": "Hans Mueller",
    "signature_title": "Export Manager",
    "signature_date": "2024-03-28"
  },
  "banking_info": {
    "bank_name": "Deutsche Bank AG",
    "bank_address": "Theodor-Heuss-Allee 70, 60486 Frankfurt, Germany",
    "account_number": "1234567890",
    "swift_code": "DEUTDEDB",
    "iban": "DE89370400440532013000",
    "routing_number": null
  },
  "marks_numbers": {
    "shipping_marks": "AMS DETROIT PO# AMS-PO-2024-0156 CRATE 1/8 TO 8/8 MADE IN GERMANY FRAGILE - HANDLE WITH CARE",
    "case_numbers": "1/8 TO 8/8"
  },
  "validation": {
    "invoice_complete": true,
    "hs_codes_present": true,
    "values_consistent": true,
    "origin_declared": true,
    "signature_present": true
  }
}

Commercial invoice for industrial machinery sold from Stuttgart, Germany to Detroit, Michigan. Contains VAT registration, EORI numbers, itemized product lines with unit prices, taxes, and total invoice value for customs valuation and payment.

Frequently Asked Questions

What documents can Commercial Invoice Extractor process?

The Commercial Invoice Extractor template processes logistics documents including various formats and layouts. See the instructions for specific document types supported.

How accurate is the Commercial Invoice Extractor extraction?

The Commercial Invoice Extractor template uses Gemini 2.5 Flash for high-accuracy extraction. Results include confidence scores for each field.

Can I customize the Commercial Invoice Extractor template?

Yes, you can modify the extraction schema, add custom fields, or adjust the instructions to match your specific requirements.

Start Extracting Data Today

Process your first document in under 5 minutes. No credit card required.