---
site_search: "GET /ask?q={query} (read-only search over extend.ai and docs.extend.ai; returns links and quoted passages, not generated answers)"
title: "Best API for extracting data from customs clearance invoices (2026)"
description: "How to choose an API for extracting HS codes, declared values, origin, duties, and line items from customs invoices, comparing Extend, Azure, Google, Veryfi, and Mindee on schemas, packets, evidence, and price."
author: "Kushal Byatnal"
category: "Blog Post"
published: 2026-11-20
updated: 2026-11-20
canonical: https://www.extend.ai/resources/best-customs-clearance-invoice-extraction-api
---

# Best API for extracting data from customs clearance invoices (2026)

> Search this site and the docs: [`/ask?q=…`](/ask?q=webhook+retries) returns matching pages from extend.ai and docs.extend.ai, with quoted passages.

A customs clearance invoice records what crossed a border, who shipped and received it, and what duties and taxes were charged. Brokers, freight forwarders, and importers re-key these fields into customs, ERP, and audit systems. At Nuvocargo, a cross-border freight platform, one missing document, incorrect HTS code, or mismatched consignee could hold a truck at the US-Mexico border for weeks. A customs invoice extraction API reads each document, scanned or digital, and returns those fields as structured data. This guide lists the fields that matter, compares five APIs, and shows how to start from a ready-made schema.

## The short answer

**Extend is the best fit for brokers, forwarders, and importers whose customs documents vary by broker and country, and who need the fields they file, such as HS codes and declared values, with evidence for each value.**

- **Your fields, not a fixed invoice model.** You define the schema, so HS codes, declared values, origin, and each duty line are fields like any other. [Extract](https://docs.extend.ai/extraction/overview) returns them as JSON.
- **Every value is traceable.** With `citationsEnabled: true`, each field comes back with an [OCR confidence score and a citation](https://docs.extend.ai/extraction/response-format) to its place on the page.
- **Packets become documents.** The [Split API](https://docs.extend.ai/splitting/overview) separates a shipment packet into its invoice, packing list, and bill of lading before extraction.
- **A schema to start from.** The [customs clearance invoice template](https://www.extend.ai/templates/customs-clearance-invoice) runs Parse then Extract with a 13-field schema.

[Nuvocargo](https://www.extend.ai/resources/nuvocargo-case-study) uses Extend's classification and extraction APIs to pull consignee, SKU, invoice number, HTS codes, quantities, unit values, and currency from invoices, pedimentos, packing lists, and customs forms, reaching 97–99% accuracy across classification, extraction, and shipment attribution.

Other options fit teams with different starting points:

- **[Azure AI Document Intelligence](https://learn.microsoft.com/en-us/azure/ai-services/document-intelligence/prebuilt/invoice)** for teams on Azure that want a pre-built invoice model across 27 languages, with custom models for customs fields.
- **[Google Document AI](https://cloud.google.com/document-ai/docs/processors-list)** for teams on Google Cloud that want the Invoice Parser plus a Custom Extractor for customs fields.
- **[Veryfi](https://www.veryfi.com/ocr-api-platform/freight-customs-documents-automation/)** for freight teams that also process bills of lading and freight invoices.
- **[Mindee](https://www.mindee.com/product/invoice-ocr-api)** for teams that want a pre-built invoice API plus a custom data extractor, with a free trial.

## Fields in a customs clearance invoice

| Field | Where it appears | Notes |
| --- | --- | --- |
| Invoice and customs declaration numbers | Header | The declaration number links the invoice to the filed entry |
| Shipper, consignee, and customs agent | Header or parties block | Agent address is often separate from the agent name |
| Origin and destination countries | Header or per line | Drives duty rates and trade agreement eligibility |
| Goods: description and quantity | Line-item table | Quantity may be units, weight, or volume |
| HS code | Line-item table | Often 6 to 10 digits |
| Declared value and currency | Line-item table and totals | Declared value per line and in total |
| Customs charges | Charges table | Each import duty, VAT, processing, or inspection fee, with its amount |
| Total customs charges and payment status | Totals block | Whether duties are paid, pending, or deferred |

## Start from the template, then add tariff fields

The [customs clearance invoice template](https://www.extend.ai/templates/customs-clearance-invoice) targets the broker's clearance bill: the document that lists the goods cleared, the duties charged, the customs agent, and whether the charges are paid. It returns goods with description and quantity, invoice date and number, shipper, consignee, origin and destination countries, payment status, customs charges, customs agent name and address, total customs charges, and customs declaration number.

Because the schema is yours, tariff fields are a small edit. Add three properties to the goods line items:

```json
"goods": {
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "description": { "type": ["string", "null"] },
      "quantity": { "type": ["number", "null"] },
      "hs_code": { "type": ["string", "null"], "description": "Harmonized System code for this line, as printed" },
      "declared_value": { "type": ["number", "null"], "description": "Declared customs value for this line" },
      "currency": { "type": ["string", "null"], "description": "ISO 4217 currency code of the declared value" }
    }
  }
}
```

Commercial invoices, where HS codes and declared values usually originate, use the same approach with a schema for their own fields.

![A sample customs clearance invoice with the declaration number, origin country, and goods description highlighted as template fields, and the HS code, declared value, and currency outlined as fields added to the line-item schema, mapped to JSON output](https://www.extend.ai/images/blog/best-customs-clearance-invoice-extraction-api/customs-invoice-to-json.webp)

*Template fields, plus hs_code, declared_value, and currency added to the goods line items. With citations enabled, each field path also gets an OCR confidence and a citation. Fictional companies and values.*

## Customs clearance invoice extraction APIs compared

Extend publishes this guide and makes Extend, one of the tools compared. Every claim below comes from the vendor's public documentation or pricing page, checked in November 2026.

| | Extend | Azure AI Document Intelligence | Google Document AI | Veryfi | Mindee |
| --- | --- | --- | --- | --- | --- |
| Best for | Variable customs documents with fields you define | Teams on Azure wanting a pre-built invoice model | Teams on Google Cloud combining pre-built and custom extraction | Freight teams also processing bills of lading | A pre-built invoice API with a custom extractor |
| Approach | Parse and Extract with your schema; customs template included | Prebuilt invoice model, plus custom extraction models | Invoice Parser, plus Custom Extractor | Freight and customs document OCR with line items | Pre-built invoice model, plus a custom data extractor |
| Customs-specific fields | Any field you define, such as HS code, origin, and duties | Custom model for fields outside the invoice model | Custom Extractor for fields outside the Invoice Parser | Line-item cargo detail for customs declarations | Custom extractor for fields outside the invoice model |
| Multi-document packets | Split returns page ranges and a file per document | Custom classification models | Custom classifier and custom splitter | PDF split into document page ranges | Splitter for multi-page files |
| Evidence per value | OCR confidence and citation with `citationsEnabled: true` | Confidence scores with bounding boxes | Confidence per entity | Optional confidence details and bounding boxes | Confidence score and position per field |
| Price | About 1.2¢ (Light) to 5¢ (Performance) per page for Extract, parsing included | See pricing | 3¢ per page (Custom Extractor) | 16¢ per invoice on Starter ($500 monthly minimum) | See pricing |

## Extend

**Best for:** brokers, forwarders, and importers whose customs documents vary by country and broker.

- **Schema:** any field you define, starting from the [customs clearance invoice template](https://www.extend.ai/templates/customs-clearance-invoice), which parses with agentic OCR before extraction.
- **Inputs:** 35 file types, including PDFs, scans, images, spreadsheets, and email files.
- **Split:** [page ranges for each sub-document](https://docs.extend.ai/splitting/response-format) in a shipment packet.
- **Evidence:** [OCR confidence and citations](https://docs.extend.ai/extraction/response-format) per field when `citationsEnabled` is on.
- **Volume:** [batch processing](https://docs.extend.ai/general/batch-processing) and asynchronous runs.

![A scanned packet split into a commercial invoice, packing list, bill of lading, and customs clearance bill with page ranges, each sent to its own extraction schema, with the customs clearance bill sent to the customs invoice template](https://www.extend.ai/images/blog/best-customs-clearance-invoice-extraction-api/shipment-packet-split.webp)

*Split a shipment packet into its documents first, then extract each one with the schema that fits it. Page ranges are illustrative.*

## Azure AI Document Intelligence

**Best for:** teams on Azure that want a pre-built invoice model.

The [Azure invoice model](https://learn.microsoft.com/en-us/azure/ai-services/document-intelligence/prebuilt/invoice) extracts key fields and line items from invoices, utility bills, sales orders, and purchase orders, including phone photos and scans, in 27 languages, with confidence scores and bounding boxes. Custom extraction models cover fields the invoice model doesn't return, and custom classification models sort mixed files.

## Google Document AI

**Best for:** teams on Google Cloud that want a pre-built invoice parser plus custom extraction for customs fields.

[Google Document AI](https://cloud.google.com/document-ai/docs/processors-list) offers an Invoice Parser, a Form Parser for key-value pairs and tables, a Custom Extractor that uses generative AI or trained models, and custom classifier and splitter processors, with a confidence score per extracted entity.

## Veryfi

**Best for:** freight and logistics teams that process bills of lading, freight invoices, and customs forms together.

[Veryfi's freight and customs OCR](https://www.veryfi.com/ocr-api-platform/freight-customs-documents-automation/) extracts line-item detail such as cargo descriptions, SKUs, quantities, and weights for freight auditing and customs declarations. Its [document API](https://docs.veryfi.com/api/receipts-invoices/process-a-document/) can return confidence details and bounding boxes, and a [split endpoint](https://docs.veryfi.com/api/split/split-a-pdf-into-document-page-ranges/) breaks a PDF into document page ranges.

## Mindee

**Best for:** teams that want a pre-built invoice API and will add a custom extractor for customs fields.

[Mindee's invoice API](https://www.mindee.com/product/invoice-ocr-api) extracts supplier, totals, taxes, and line items, and every field carries a confidence score and its position on the page. Mindee lists customs clearance among its use cases and offers a custom data extractor and a splitter for fields and files its invoice model doesn't cover, with a 14-day free trial.

## How to choose

1. **List the fields you file.** If you need HS codes, origin, and duty lines, pick a tool where you define the schema, or plan for a custom model.
2. **Check your packets.** If invoices arrive bundled with packing lists and bills of lading, you need splitting or classification before extraction.
3. **Plan the review step.** Customs errors are costly, so prefer per-field confidence and evidence that let a reviewer check values against the page.
4. **Test on your own documents.** Run every candidate on 50 to 100 documents from your real brokers and countries, including scans, and score HS codes and declared values separately.

## FAQ

### What is the best API for extracting data from customs clearance invoices?

Extend is the best fit for brokers, forwarders, and importers whose customs documents vary by broker and country and who need fields they define, such as HS codes and declared values, with evidence for each value. Extend Extract returns the schema you define as JSON, with an OCR confidence score and a citation per value when citations are enabled, Split separates shipment packets into individual documents, and the customs clearance invoice template gives you a 13-field schema to start from. Nuvocargo uses Extend's classification and extraction APIs on invoices, pedimentos, packing lists, and customs forms. Azure's invoice model and Google's Invoice Parser fit teams that want a pre-built model on their cloud, with custom models for customs fields, and Veryfi fits freight teams that also process bills of lading.

### Can an API extract HS codes from a customs invoice?

Yes, if HS codes are in the schema. HS codes usually sit in the line-item table next to the description, quantity, and value. In Extend you add an `hs_code` property to the goods line items, and with citations enabled each extracted code comes back with a citation so a reviewer can check it against the page. Pre-built invoice models without a tariff field need a custom model to return HS codes.

### How do you split a shipment packet into separate customs documents?

Split before extraction. Extend's Split API returns page ranges and a file for each sub-document, so a packet holding a commercial invoice, packing list, bill of lading, and customs clearance bill becomes separate files, each sent to the schema that fits it. Google offers a custom splitter processor, Azure offers custom classification models, and Veryfi offers PDF splitting into document page ranges.

### How should customs invoices be reviewed before filing?

Route on evidence. Send any field below a confidence threshold, such as an unreadable HS code or declared value, to a reviewer with the citation that shows where the value came from, and auto-approve the rest. Check that line values add up to the invoice total and that the consignee matches the shipment before filing.

### What does the customs clearance invoice template extract?

Extend's customs clearance invoice template targets the broker's clearance bill. It parses the file with agentic OCR, then extracts 13 fields: goods with description and quantity, invoice date and number, shipper, consignee, origin and destination countries, payment status, customs charges, customs agent name and address, total customs charges, and customs declaration number. Commercial invoices use the same approach with a schema for their own fields.

## Sources

Checked in November 2026:

- Extend: [Customs clearance invoice template](https://www.extend.ai/templates/customs-clearance-invoice), [Nuvocargo case study](https://www.extend.ai/resources/nuvocargo-case-study), [Extraction overview](https://docs.extend.ai/extraction/overview), [Extraction response format](https://docs.extend.ai/extraction/response-format), [Splitting overview](https://docs.extend.ai/splitting/overview), [Batch processing](https://docs.extend.ai/general/batch-processing), [How credits work](https://docs.extend.ai/general/how-credits-work)
- Microsoft: [Document Intelligence invoice model](https://learn.microsoft.com/en-us/azure/ai-services/document-intelligence/prebuilt/invoice), [Pricing](https://azure.microsoft.com/en-us/pricing/details/ai-document-intelligence/)
- Google Cloud: [Document AI processors](https://cloud.google.com/document-ai/docs/processors-list), [Custom extractor](https://cloud.google.com/document-ai/docs/custom-extractor-overview), [Pricing](https://cloud.google.com/document-ai/pricing)
- Veryfi: [Freight and customs documents](https://www.veryfi.com/ocr-api-platform/freight-customs-documents-automation/), [Process a document](https://docs.veryfi.com/api/receipts-invoices/process-a-document/), [Split a PDF](https://docs.veryfi.com/api/split/split-a-pdf-into-document-page-ranges/), [Pricing](https://www.veryfi.com/pricing/)
- Mindee: [Invoice OCR API](https://www.mindee.com/product/invoice-ocr-api), [Pricing](https://www.mindee.com/pricing)

## More guides

- [Nuvocargo case study](https://www.extend.ai/resources/nuvocargo-case-study)
- [Best cargo manifest extraction tools for logistics](https://www.extend.ai/resources/best-cargo-manifest-tools-logistics)
- [How to parse scanned PDFs](https://www.extend.ai/resources/how-to-parse-scanned-pdfs)
- [Extend for logistics](https://www.extend.ai/logistics)

[Get an API key](https://dashboard.extend.ai/) to run the customs clearance invoice template on your own documents.

## Related reading

- [Best Enterprise Document Processing Solutions for Supply Chain Management (February 2026)](https://www.extend.ai/resources/enterprise-document-processing-supply-chain)
- [Multilingual Document Processing for Supply Chains (September 2026)](https://www.extend.ai/resources/multilingual-freight-document-processing-tools)
- [How Nuvocargo hit 99% Document Accuracy for US-Mexico Cross-Border Freight](https://www.extend.ai/resources/nuvocargo-case-study)
- [Best OCR Tools for Bills of Lading (BOLs): Extend vs LlamaParse vs Reducto and More (October 2026)](https://www.extend.ai/resources/best-bills-lading-ocr-tools)
- [6 Best Cargo Manifest Extraction Tools for Logistics (September 2026)](https://www.extend.ai/resources/best-cargo-manifest-tools-logistics)
