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
GVMS
/api/gvms/movementsBearerList GVMS goods-movement records (requires GVMS Hub)
/api/gvms/movementsBearerCreate a GMR draft
EMCS
/api/emcs/movementsBearerList excise movements (requires EMCS Hub)
/api/emcs/movementsBearerCreate a DRAFT e-AD
/api/emcs/movements/{id}/reviewBearerAI risk scoring of an excise movement
/api/emcs/movements/{id}/submitBearerSubmit e-AD (mock ARC assigned)
TSS
/api/tss/declarationsBearerList TSS (NI Protocol) declarations (requires TSS Hub)
/api/tss/declarationsBearerCreate a DRAFT TSS declaration
/api/tss/declarations/{id}/reviewBearerAI categorisation review (UKIMS, at-risk, UK-origin checks)
/api/tss/declarations/{id}/submitBearerSubmit to TSS (mock MRN assigned)
CBAM
/api/cbam/importsBearerList CBAM-relevant imports (requires CBAM Hub)
/api/cbam/importsBearerLog import — AI estimates embedded emissions if not supplied
/api/cbam/reportsBearerGenerate (or refresh) a DRAFT quarterly report
/api/cbam/reports/{id}/reviewBearerAI compliance review of a report
/api/cbam/reports/{id}/submitBearerLock + submit a CBAM report
/api/cbam/reports/{id}/export.xmlBearerDownload report as EU-CBAM-style XML
ICS2
/api/ics2/filingsBearerList ENS pre-arrival filings (requires ICS2 Hub)
/api/ics2/filingsBearerCreate a DRAFT ENS filing
/api/ics2/filings/{id}/reviewBearerAI risk scoring of an ENS filing
/api/ics2/filings/{id}/submitBearerSubmit ENS to ICS2 (mock MRN assigned)
Tax
/api/tax/periodsBearerList VAT obligations / periods (requires Tax Hub)
/api/tax/returnsBearerGenerate or refresh DRAFT — auto-reconciles import VAT from Customs Hub
/api/tax/returns/{id}/reviewBearerAI compliance review of a VAT return
/api/tax/returns/{id}/submitBearerLock + submit a VAT return (mock HMRC ID assigned)
/api/tax/returns/{id}/export.xmlBearerDownload VAT return as XML
Audit
/api/auditBearerCross-Hub forensic audit log with filters + cursor pagination
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/webhooks/endpointsBearerList your webhook endpoints
/api/webhooks/endpointsBearerCreate endpoint — signing secret returned ONCE, store it on receipt
/api/webhooks/endpoints/{id}BearerUpdate url / subscribed events / pause-or-resume
/api/webhooks/endpoints/{id}BearerRemove an endpoint + its delivery log
/api/webhooks/endpoints/{id}/deliveriesBearerInspect delivery attempts
/api/webhooks/endpoints/{id}/testBearerFire a webhook.ping event to verify your receiver
/api/webhooks/endpoints/{id}/deliveries/{deliveryId}/resendBearerRe-fire a past delivery with the same payload (useful for replays)
/api/cds/webhookOAuthInbound webhook from HMRC CDS (signed)
OpenAPI 3.1 spec — live
Import directly into Postman, Insomnia, or your favourite OpenAPI generator.
GET /api/openapi.jsonDownload specTypeScript SDK — live
Fully typed, retries on transient errors, idempotency keys, works in Node and the browser. MIT licensed.
npm install @declarehq/sdk
# Usage
import { DeclareHQ } from "@declarehq/sdk";
const dq = new DeclareHQ({ apiKey: process.env.DECLAREHQ_API_KEY! });
// Classify a product description into a UK commodity code
const [top] = await dq.ai.classifyCommodity({
description: "men plain cotton t-shirts",
countryOfOrigin: "VN",
});
console.log(top.code); // "6109100010"npm install @declarehq/sdkREADMEComing soon
- Python SDK —
pip install declarehq - 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.