Skip to content

Search CDS declarations

Searches HMRC for the trader’s CDS declarations from the last 180 days by type, status, dates and goods location, each with its current status.

@lainstack/hmrc/search-cds-declarations · Customs · Available on Lainstack Cloud

Use Search CDS declarations to list the trader’s customs declarations from HMRC’s Customs Declarations Information API, each with its current status. It only reads. Use it on a Schedule to reconcile what HMRC holds with your own records, for example every declaration not cleared yet.

Choose which Declarations (imports, exports, CO declarations or all) and which Status (not cleared yet, cleared, rejected or any). From and To narrow the dates; without either, HMRC searches the last 30 days. Goods location narrows to one HMRC goods location code.

Good to know:

  • Each declaration carries its MRN, LRN, DUCR, declaration type, status (received, accepted, released, rejected or invalidated), dates and HMRC’s ROE and ICS codes.
  • HMRC answers a page at a time. Pages to read limits how many pages one step reads; Truncated says whether more matched.
  • The block leaves on Searched, even when nothing matches, or on HMRC unavailable (a timeout, network failure, rate limit or HMRC outage), after which a later search may succeed.
  • HMRC searches only the declarations the trader on the HMRC connection submitted, from the last 180 days.
  • A refused authorisation fails the step and asks you to reconnect. Dates HMRC cannot read, or any other refusal, fail the step with HMRC’s message.
  • A sandbox connection searches HMRC’s test environment.
Setting Key Type Details
HMRC connection (required) credentialId Connection The trader’s HMRC Customs Declarations connection. HMRC searches only the declarations this trader submitted. At most 160 characters.
Declarations category One of Imports, Exports, CO declarations, All Default IM.
Status status One of Not cleared yet, Cleared, Rejected, Any Default uncleared.
From dateFrom Text Optional. The first day, as YYYY-MM-DD. Without From or To, HMRC searches the last 30 days.
To dateTo Text Optional. The last day, as YYYY-MM-DD. Without it, up to today.
Goods location goodsLocationCode Text Optional. Only declarations at this HMRC goods location code.
Pages to read maxPages Number HMRC answers a page at a time. Defaults to 5, up to 20. From 1 to 20. Default 5.
Output Path Type
Outcome outcome Choice
Summary summary Text
Environment environment Text
Checked At checkedAt Text
HMRC Problem hmrcProblem Text
Total Results totalResults Number
Truncated truncated Yes or no
Declarations declarations List
Exit Port Notes
Searched out
HMRC unavailable unavailable

Last updated: