Submit a UK import customs declaration to HMRC CDS via the Customs Declarations API and retrieve the decision notification

domain: developer.service.hmrc.gov.uk · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Register your software application on the HMRC Developer Hub, subscribe to the Customs Declarations API, and complete the production credentials process through the Software Developer Hub Support team.
  2. Implement the OAuth 2.0 authorisation code flow to obtain a user-scoped access token; note that tokens expire after 4 hours and must be refreshed using the refresh token.
  3. Build the WCO-DMS-compliant XML declaration payload using the CDS Data Dictionary field mappings; key fields include declarant EORI, procedure codes, commodity code (10-digit UK tariff), customs value, and tax lines.
  4. POST the declaration XML to the Customs Declarations API submit endpoint; parse the synchronous HTTP 202 response and extract the Conversation ID for subsequent notification matching.
  5. Poll the Pull Notifications API or configure a callback endpoint to receive asynchronous CDS decision notifications (accept, reject, query) keyed by Conversation ID.
  6. For rejected declarations, parse the FunctionCode and PointerToDocumentSection elements in the error notification to identify and correct the specific field before resubmission.

Known gotchas

Related routes

Create a Shippo customs declaration object and attach it to an international shipment to generate compliant customs paperwork
goshippo.com · 5 steps · unrated
Submit the Final Declaration to HMRC via the Making Tax Digital for Income Tax API to complete a customer's Self Assessment tax year
developer.service.hmrc.gov.uk · 6 steps · unrated
Submit a VAT return to HMRC via the Making Tax Digital API
tax.service.gov.uk · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans