ICS2 & EU Customs Pre-Flight Validator API
Catches border-hold triggers before Entry Summary Declaration (ENS) filing across air, maritime, road, rail, postal, and express shipments. Validates EU27/XI EORI numbers, 6-digit HS / 8-digit CN codes, EU Commission unacceptable vague goods descriptions, and €150 IOSS intrinsic-value & excise rules—backed by SHA-256 signed audit receipts.
Core REST Endpoints
Base path: https://api.contextapi.dev/customs (or /api/customs via local portal proxy).
| Method | Path | Cost | Capabilities |
|---|---|---|---|
| POST | /v1/customs/ics2/preflight | 1 credit | Validates ICS2 Release 3 ENS manifests: EU27/XI EORI, 6-digit HS / 8-digit CN, EU stop-words, and IOSS €150 rules with a SHA-256 ics2_* receipt. |
| POST | /v1/customs/ics2/preflight/batch | Pay-Per-Success | Concurrently pre-flight validate up to 50 inbound EU consignments in a single call with Rule 2 Smart-Split quota metering. |
| POST | /v1/customs/ioss/evaluate | 1 credit | Evaluates the €150.00 intrinsic-value threshold (excluding separately stated freight/insurance), excise exclusions (Ch. 22, 24, 27), and IM number format. |
| GET | /v1/customs/eori/validate & /v1/customs/hs/validate | 1 credit | Validates EU27 + XI EORI syntax (enforcing GR for Greece EORI) and 6-digit HS / 8-digit CN / 10-digit TARIC codes. |
| POST | /v1/customs/description/lint & /description/rewrite | 1 credit (5 LLM) | Flags EU Commission ICS2 unacceptable vague terms (parts, clothing, samples, FAK, STC) and rewrites them into compliant plain language. |
| GET | /v1/customs/audit/{receipt_id} & /v1/customs/audit | 1 credit | Retrieve tenant-isolated SHA-256 ics2_* pre-flight audit receipts and tier retention metadata. |
Quickstart & Hosted MCP Integration
Gate 3PL/OMS manifests pre-flight or register https://api.contextapi.dev/customs/mcp in your AI agent.
Quickstart — Pre-Flight Validate CN → DE Air Consignment
curl -X POST "https://api.contextapi.dev/customs/v1/customs/ics2/preflight" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"transport_mode": "air",
"is_b2c": false,
"shipper": {"name": "Shenzhen Acoustics Co Ltd", "country_code": "CN", "street_address": "88 Innovation Blvd", "city": "Shenzhen", "postal_code": "518000"},
"consignee": {"name": "Hamburg Sound GmbH", "country_code": "DE", "eori": "DE123456789012345", "street_address": "Speicherstadt 14", "city": "Hamburg", "postal_code": "20457"},
"items": [{"description": "Bluetooth wireless over-ear headphones, ABS plastic", "hs_code": "8518.30.00", "quantity": 20, "gross_mass_kg": 8.5, "intrinsic_value": 1200.0, "currency": "EUR"}]
}'→ {"status": "READY_FOR_FILING", "risk_score": 0, "audit_receipt": {"receipt_id": "ics2_..."}}Hosted Streamable HTTP MCP (4 Tools + Resource)
Register in .cursor/mcp.json (or use npx -y mcp-remote for Claude Desktop):
{
"mcpServers": {
"contextapi-customs": {
"url": "https://api.contextapi.dev/customs/mcp",
"headers": { "X-API-Key": "${CONTEXTAPI_API_KEY}" }
}
}
}- validate_eu_ics2_preflightTool
Runs deterministic EU ICS2 ENS pre-flight checks before filing to prevent costly customs rejections and delays.
- evaluate_eu_ioss_thresholdTool
Checks the €150 IOSS consignment threshold and VAT treatment so cross-border e-commerce shipments route correctly.
- validate_eu_eori_and_hsTool
Validates EU EORI numbers and HS6/CN8 tariff codes before dispatch to catch identifier errors early.
- rewrite_ics2_goods_descriptionTool
Flags vague EU ICS2 stop-words and suggests compliant plain-language goods descriptions for customs clearance.
- contextcustoms://vault/statusResource
Exposes live audit vault receipt counts and service readiness for agent pre-flight health checks.