
CDS Error Codes: What CDS12158 and Other Rejections Mean
BorderAudit
Post-clearance customs audit, automated
BorderAudit reads your HMRC declaration data and checks every entry for errors and overpaid duty.
CDS error codes are the references HMRC's Customs Declaration Service returns when a declaration fails validation. Every code starts with CDS and a family prefix that tells you which kind of rule failed: CDS10 for missing or malformed data, CDS12 for two data elements that disagree, CDS40 for a value that does not exist or does not apply, and CDS50, CDS70 and CDS71 for authorisations, licences and checks made outside the declaration. The most searched code, CDS12158, means a party on a Northern Ireland declaration has an XI EORI but no NI movement statement in DE 2/2.
Below: what the common codes mean in HMRC's own words, what to check for each family, and why a declaration that clears can still be wrong.
To look up a code from a rejection, paste the message into the free CDS error decoder: it picks out every code and shows HMRC's description and what to check. Every one of the 181 codes HMRC publishes has its own page in our CDS error code glossary.
What does CDS error code CDS12158 mean?
CDS12158 means a relevant party on a Northern Ireland declaration has been entered with an XI EORI number, but the declaration carries none of the NI movement additional-information statements HMRC lists: NIIMP, NIDOM or NIEXP. HMRC describes it as "Missing Element - A non-GB EORI requires entry of NI Movement AI Codes in DE 2/2".
What to check:
- Whether the party's EORI should be an XI number at all, or whether a GB EORI was intended.
- Whether the movement is genuinely a Northern Ireland movement.
- Whether one of the NI movement statements (NIIMP, NIDOM or NIEXP) has been entered in DE 2/2, the additional information element.
HMRC's error list names the missing statements but does not say which one applies to a given movement. That depends on the movement itself, so confirm it against HMRC's guidance on additional information codes before you resubmit. HMRC's full explanation and the related codes are on the CDS12158 page of the glossary.
What do the other common CDS error codes mean?
Most rejections come from a small set of codes. Each entry below gives HMRC's own description from its published error-code list, followed by the data elements worth checking first. Where HMRC states a cause, we repeat it. Where it does not, we say what to look at rather than guess at a fix.
CDS12005: Party ID unknown or invalid
HMRC's description: "Authorisation Error: Party ID unknown or invalid". An EORI or VAT number on the declaration is not recognised, or the number is not permitted in the data element where it was entered. Check each EORI and VAT number against the party it belongs to, and check that each sits in the data element meant for that party.
CDS10020: Data element contains an invalid value
HMRC's description: "Domain error: data element contains invalid value". A code on the declaration is not recognised, is not permitted on that type of declaration (HMRC's example is an export-only document code on an import declaration), or is valid but entered at the wrong level, header instead of item or the reverse. Check the code list for the element, the declaration type and the level.
CDS12077: A second data element is required because the first is present
HMRC's description: "Relation Error: A valid value must be supplied in Data Element 2 as Data Element 1 is present". Completing one element with a particular value requires another value, in the same element or a different one. HMRC's examples include an incomplete address where a party name has been given. Check every element that depends on the one you completed.
CDS40013: Invalid value against a tariff measure
HMRC's description: "Data element contains invalid value", where the value relates to a tariff measure or condition. HMRC's examples are an incorrect preference code in DE 4/17, and measurement-unit errors in DE 6/2 or DE 4/4. Check the preference code against the measure and your origin evidence, and the units against the commodity code's measures. Our guide to preference codes in CDS covers DE 4/17 in detail.
CDS12056: The combination of elements is not allowed
HMRC's description: "Relation error: the combination of elements is not allowed". Two values cannot be used together, or one requires another that is missing. HMRC's examples include a document code with an incompatible document status, and an additional procedure code that needs a second code alongside it. Check document code and status pairs, and your procedure codes; see CPC codes for UK imports.
CDS40011: Missing data element value
HMRC's description: "Missing data element value". A value the commodity code requires has not been completed, such as a supplementary unit. HMRC's own advice is to check the Measures column for the commodity code on the UK Trade Tariff.
CDS12068: A document identifier is required
HMRC's description: "This combination of elements mandates the declaration of a Document Identifier". A document code entered in DE 2/3 needs its reference. Check that every document code in DE 2/3 carries its identifier.
CDS12070: The value in one data element requires another
HMRC's description: "Relation error: The value supplied in Data Element 1 mandates the completion of Data Element 2". A value you entered requires another field, or makes another field or code invalid. Check the element that depends on the value you entered.
Full glossary entries: CDS12005, CDS10020, CDS12077, CDS40013, CDS12056, CDS40011, CDS12068 and CDS12070.
What should you check for each family of CDS error codes?
The prefix tells you where to look before you read the detail. Obligation codes point at missing or incomplete data. Relation codes point at two elements that disagree. Domain and value codes point at a code that does not exist or does not apply. Authorisation and licence codes point at something held outside the declaration.
- CDS10 (obligation and format): a required data element is missing, incomplete or in the wrong format. Check the element named in the error is completed in full.
- CDS11 and CDS12 (relations): two elements, or a value and a rule, disagree. Read both elements together; the fault is often in the one you did not change.
- CDS13 and CDS14 (credibility checks): a value has failed a plausibility check. Check quantities, weights and values against the commercial documents.
- CDS20 (related movements): a movement the declaration refers to was not found or does not match. Check the reference to the earlier movement.
- CDS40 (domain and value): a code is not recognised, does not apply to the commodity, or conflicts with a tariff measure. Check the code list and the commodity code's measures on the Trade Tariff.
- CDS50 (external validation): a check outside CDS has not been satisfied, such as a release response from another system or the format of a consignment reference. Check the external reference or status the code names.
- CDS70, CDS71, CDS73 and CDS77 (licences and documents): a licence or document is invalid, already used, short of quantity, or missing a required detail. Check the licence against the goods, the destination and the remaining balance.
- CDS19 and CDS49 (other): general codes. Read HMRC's explanation for the specific code before changing anything.
The glossary lists every code in each family, with HMRC's description and explanation.
Why does a declaration that clears still need checking?
An error code is the visible failure: CDS stopped the declaration and told you why. The errors that cost money are the ones that pass validation. A valid but wrong commodity code, a missed preference or an unclaimed relief clears without complaint, and the overpayment sits in your declaration record until someone reads it back.
That is the gap post-clearance audit closes. 32% of the declarations we've audited contain errors, and 17% of declarations contain overpayments. BorderAudit reads your CDS declaration data line by line after clearance, flags the errors validation never caught, and builds the evidence for any correction while it is still inside HMRC's three-year window. You can request your CDS data from HMRC and see what an audit finds on the importers page.
Code descriptions are quoted from HMRC's Customs Declaration Service error codes, licensed under the Open Government Licence v3.0.
Frequently Asked Questions
- What is CDS error code CDS12158?
- CDS12158 is a Customs Declaration Service rejection for Northern Ireland declarations. A relevant party has been entered with an XI EORI number, but the declaration has none of the NI movement statements HMRC lists (NIIMP, NIDOM or NIEXP) in DE 2/2. Check the party's EORI and whether the right statement is present.
- Where can I find the full list of CDS error codes?
- HMRC publishes the list on GOV.UK as "Customs Declaration Service error codes", a spreadsheet giving each code, a short description and a longer explanation. BorderAudit's CDS error code glossary gives all 181 codes a page each, with HMRC's text and what to check, and the free decoder picks the codes out of a pasted rejection message.
- What is the difference between a CDS10 and a CDS12 error?
- A CDS10 error means a single data element is missing, incomplete or badly formatted, so the fix starts with that element. A CDS12 error means two elements, or a value and a rule, disagree with each other. With a CDS12 code, read both elements together, because the fault is often in the one you did not change.
- Does fixing a CDS rejection mean the declaration is correct?
- No. Validation only checks that the data is complete and consistent with CDS rules. A wrong commodity code, a missed preference or an unclaimed relief can pass validation and still mean you paid too much duty. Post-clearance audit reads the cleared declaration back to find those errors while they can still be corrected.
About the Author
BorderAudit
BorderAudit is a post-clearance customs audit platform for UK importers. It reads the declarations made in your name from your HMRC data and checks every line for classification, valuation, origin and relief errors.