Ex Extract API

Document types

Pass document_type to select the extraction schema. Use auto to let the pipeline detect the type, or combined for multi-page PDFs.

Supported types

document_typeDescriptionKey fields
invoice Carrier or supplier invoice invoice_number, invoice_date, due_date, total_amount, currency, vat_amount, supplier_name, customer_name, shipment_reference
cmr CMR consignment note cmr_number, consignor, consignee, carrier, place_of_loading, place_of_delivery, goods_description, gross_weight, packages_count
pod Proof of delivery delivery_date, recipient_name, signature_present, reference_number, notes
delivery_note Delivery note / packing list delivery_note_number, shipper, recipient, delivery_date, line_items
customs Customs declaration declaration_type, declaration_number, hs_codes, total_value, currency, country_of_origin
bill_of_lading Bill of lading bl_number, vessel_name, port_of_loading, port_of_discharge, shipper, consignee, container_numbers
rail_waybill Rail waybill waybill_number, wagon_number, departure_station, destination_station, cargo_description
combined Multi-document PDF Per-page classification + aggregated fields
auto Auto-detect (default) Pipeline selects best matching schema

Digital vs scanned PDFs

  • Digital PDFs — text layer extracted locally via Poppler on our servers. Fast (~100–500 ms). No third-party AI.
  • Scanned PDFs — when OCR is enabled, PDF content may be sent to Mistral AI over TLS. Slower (~2–5 s cold; cached instant for repeats on your account).
  • Structured / vision stages — optional Mistral or OpenAI passes for complex fields. See Data processing.

Language support

Optimised for freight documents in:

  • English (EN)
  • German (DE)
  • Estonian (ET)
  • Lithuanian (LT)
  • Latvian (LV)
  • Russian (RU)

Language hints are detected automatically from document text.

Confidence scores

Each field includes a confidence score. Tune sensitivity with options[confidence_threshold] (default 0.7). Low-confidence fields may appear in warnings.

Business rules

After extraction, a business rules engine validates cross-field consistency (e.g. VAT calculation, date ordering). Violations appear in business_rule_violations with severity levels.