Export flow - API integration
How to use The Trade Hub API in an export flow - classification, export control and best practices.
This guide describes how to integrate The Trade Hub API into your export flow. Exports add a critical step compared to imports: dual-use export control. For the complete business guide (procedures, documents, exit endorsement), see the import/export guide.
Overview
The Trade Hub API assists at two key steps in the export flow:
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ 1. Classify │───>│ 2. Export │───>│ 3. Use │
│ the product │ │ control │ │ the results │
│ (ClassifyAI) │ │ (Export Ctrl) │ │ (your system)│
└─────────────────┘ └──────────────────┘ └─────────────────┘Step 1 - Classify the product
As with imports, determine the HS code for your goods:
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": "CNC machine tool for precision machining, 5 axes, Siemens numerical control"
}'For exports, classification also determines export controls (dual-use, military equipment).
Step 2 - Check export control
If your product may be subject to export controls (EU Regulation 2021/821), use the Export Control API:
curl -N -X POST https://api.thetradehub.eu/v1/export-control/chat \
-H "X-API-Key: th_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"content": "CNC machine tool 5 axes, positioning accuracy 2 microns, numerical control",
"locale": "en"
}'The SSE stream returns real-time events:
| Event | Description |
|---|---|
step | Classification pipeline progress |
retrieval | Documents retrieved from the regulatory database |
clarification | Questions if specifications are insufficient |
classification | Final result (controlled/not controlled, ECN, thresholds) |
done | End of stream |
See the Export Control API reference for the complete structure.
Alternative: asynchronous mode (jobs)
For integrations without streaming, use the async pattern:
curl -X POST https://api.thetradehub.eu/v1/export-control/jobs \
-H "X-API-Key: th_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"content": "CNC machine tool 5 axes, positioning accuracy 2 microns",
"locale": "en"
}'Then poll the status with GET /v1/export-control/jobs/{id}.
Complementary business guides
- Import/export guide - Complete flow (customs procedures, documents)
- DELTA I/E - Export declaration on the DELTA I/E system
- Customs fundamentals - Customs procedures, origin, customs value
Next steps
- See the import flow for import operations
- Explore the integration patterns for production best practices
- Browse the document codes for required documents
Last updated