Import flow - API integration
How to use The Trade Hub API in an import flow - classification, history and best practices.
This guide describes how to integrate The Trade Hub API into your import flow. For the complete business guide (origin, customs value, TARIC measures, documents, declaration), see the import/export guide.
Overview
The Trade Hub API assists at two key steps in the import flow:
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ 1. Classify │───>│ 2. Check │───>│ 3. Use │
│ the product │ │ history │ │ the results │
│ (API) │ │ (API) │ │ (your system)│
└─────────────────┘ └──────────────────┘ └─────────────────┘Step 1 - Classify the product
The first step is to determine the HS code for your goods using the ClassifyAI API.
curl -X POST https://api.thetradehub.eu/v1/classify/jobs \
-H "X-API-Key: th_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"content": "Electric bicycle with 250W motor, lithium-ion 36V battery, aluminium frame",
"locale": "en"
}'Key points for accurate classification:
- Describe the nature of the product (not the brand or model)
- Mention the constituent materials
- Specify the main function
- Indicate the technical specifications (power, size, weight)
The result contains the HS code, confidence, GRI justification and cited legal sources. See the Classification API reference for the complete structure.
Step 2 - Use the results
The classification result gives you the information needed to prepare your declaration:
| Information obtained | Usage |
|---|---|
hs_code | Tariff code for the declaration |
confidence | Assess classification reliability |
gri_justification | Compliance documentation |
validated | true if the code has been verified in the TARIC nomenclature |
Step 3 - Batch classification
For imports with multiple articles, use the batch endpoint:
curl -X POST https://api.thetradehub.eu/v1/classify/batch \
-H "X-API-Key: th_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"items": [
{"id": "ART-001", "content": "Electric bicycle 250W lithium battery"},
{"id": "ART-002", "content": "Polycarbonate cycling helmet with visor"},
{"id": "ART-003", "content": "Manual aluminium bicycle pump"}
],
"locale": "en"
}'Step 4 - History and traceability
Retrieve your past classifications via the history API:
curl "https://api.thetradehub.eu/v1/classify/history?from=2026-01-01&status=completed&hs=87" \
-H "X-API-Key: th_live_your_api_key"Export to CSV for audits:
curl "https://api.thetradehub.eu/v1/classify/history/export?from=2026-01-01" \
-H "X-API-Key: th_live_your_api_key" \
-o classifications.csvComplementary business guides
The Trade Hub API covers classification. For the other steps of the import flow, see:
- Import/export guide - Complete flow in 10 chapters (EORI, origin, value, duties, Incoterms, documents)
- Customs fundamentals - Nomenclature, GIR, customs value, origin, BTI/RTC, procedures
- DELTA I/E - Import declaration on the DELTA I/E system
Next steps
- See the export flow which includes export control
- Explore the integration patterns for production best practices
Last updated