Build on top of DeclareHQ
Integrate UK customs workflows directly into your ERP, WMS, or accounting system. All AI features available via REST.
# Classify a product description into a UK commodity code
curl -X POST https://declarehq.com/api/ai/commodity-classify \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"description": "men plain cotton t-shirts, basic crew neck", "countryOfOrigin": "VN"}'
# Response
# {
# "suggestions": [
# { "code": "6109100010", "description": "T-shirts of cotton",
# "confidence": 0.95, "dutyExpression": "12.00%", "validated": true }
# ]
# }Bearer-token auth using API keys generated in Settings → API.
Each key is org-scoped — all requests are restricted to the originating org's data.
Standard endpoints: 1,000 req/min per org
AI endpoints: 100 req/min per org
Public endpoints: 10 req/hour per IP
Headers: X-RateLimit-*
Subscribe to events: declaration submitted, HMRC accepted, cleared, tax assessed, rejection received.
Signed with HMAC-SHA256 (header: X-DeclareHQ-Signature).
Endpoint reference
Base URL: https://declarehq.com
Declarations
/api/declarationsBearerList declarations for your organisation
/api/declarationsBearerCreate a new declaration
/api/cds/submitBearerSubmit a declaration to HMRC CDS
AI
/api/ai/commodity-classifyBearerAI commodity-code classifier — plain English → 10-digit code
/api/ai/extract-documentBearerExtract structured data from an invoice or BoL PDF
/api/ai/analyse-declarationBearerAI anomaly detection on a draft declaration
/api/ai/explain-rejectionBearerPlain-English explanation of HMRC DMSREJ errors
Shipments
/api/shipmentsBearerList shipments
/api/shipmentsBearerCreate a shipment
Clients
/api/clientsBearerList clients
Bulk import
/api/import/clients/previewBearerAI-mapped CSV preview for client import
/api/import/clients/commitBearerCommit a CSV client import
Export
/api/export/declarationsBearerDownload all declarations as CSV
Webhooks
/api/cds/webhookOAuthInbound webhook from HMRC CDS (signed)
Coming soon
- OpenAPI 3.1 spec — auto-generated, downloadable
- TypeScript SDK —
npm install @declarehq/sdk - Zapier + Make connectors — no-code automation
- Pre-built integrations for Xero, QuickBooks, NetSuite, SAP
Need API access for your team? Get started with a free trial.