Update CDS declaration
Tells HMRC a pre-lodged declaration’s goods have arrived, amends a declaration after a reviewer changes it, or cancels it, then waits for HMRC’s answer.
@lainstack/hmrc/update-cds-declaration · Customs · Available on Lainstack Cloud
How to use it
Section titled “How to use it”Use Update CDS declaration after a declaration has been sent to HMRC, to finish what is left. Choose the Action:
- Goods have arrived sends HMRC an arrival notification for a pre-lodged declaration (one sent before arrival, type IMD or IMF), by its MRN. Without it the declaration is never accepted or cleared.
- Amend the declaration opens the declaration for review. Set MRN and Declaration record from the output of Send CDS declaration (or of an earlier amendment). A reviewer changes the fields that were wrong and sends the amendment. HMRC receives only the changed values, with the Reason.
- Cancel the declaration asks HMRC to cancel (invalidate) the declaration with this MRN, with the Reason. HMRC only cancels a declaration whose goods have not been cleared.
The block then waits for HMRC’s answer to its own message and leaves on:
- Done: HMRC registered the arrival, accepted the amendment, or cancelled the declaration.
- Refused: HMRC rejected the message (each error is explained), denied the request, reported a general error, or refused it outright. An amendment a reviewer rejects also leaves here, not sent.
- Timed out: HMRC did not answer, or did not cancel the declaration, within Give up after.
Good to know:
- Use the same HMRC connection that sent the declaration. HMRC only answers the trader who submitted it.
- On Done, an amendment’s output carries the declaration as amended in Declaration record, for a later amendment to start from. Other exits carry none.
- Once HMRC has taken the message, an HMRC outage keeps the block waiting until Give up after. A refusal no later check fixes (for example a revoked authorisation) fails the step; resuming the run goes back to checking, without sending again.
- Follow the declaration afterwards with Get CDS declaration status.
- A sandbox connection sends to HMRC’s test environment, where HMRC decides as it would live.
Settings
Section titled “Settings”| Setting | Key | Type | Details |
|---|---|---|---|
| HMRC connection (required) | credentialId |
Connection | The connection that sent the declaration. A draft run holds the message on every connection. At most 160 characters. |
| Action (required) | action |
One of Goods have arrived (arrival notification), Amend the declaration, Cancel the declaration |
|
| MRN (required) | mrn |
Text | The Movement Reference Number HMRC issued for the declaration. |
| Declaration record | declarationRecord |
Value | The Declaration record of Send CDS declaration, or of an earlier amendment, for the same MRN. A reviewer changes its fields. |
| Reason | reason |
Text | Why, in words HMRC reads. Up to 512 characters. |
| Give up after (minutes) | timeoutMinutes |
Number | Take the Timed out path when HMRC has not answered by then. Defaults to 60; up to 20160 (14 days, as long as HMRC keeps notifications). From 1 to 20,160. Default 60. |
Outputs
Section titled “Outputs”| Output | Path | Type |
|---|---|---|
| Outcome | outcome |
Choice |
| Summary | summary |
Text |
| Action | action |
Choice |
| MRN | mrn |
Text |
| Reference | reference |
Text |
| Environment | environment |
Text |
| Conversation ID | conversationId |
Text |
| Submitted At | submittedAt |
Text |
| Checked At | checkedAt |
Text |
| Next Check At | nextCheckAt |
Text |
| HMRC Problem | hmrcProblem |
Text |
| Refusal > Code | refusal.code |
Text |
| Refusal > Message | refusal.message |
Text |
| Refusal > Errors | refusal.errors |
List |
| Refusal > Explanation | refusal.explanation |
Text |
| Denial | denial |
Text |
| Errors | errors |
List |
| Notifications | notifications |
List |
| Unreadable Notifications | unreadableNotifications |
List |
| Declaration XML | document |
Value |
| Declaration record | documentRecord |
Value |
| Exit | Port | Notes |
|---|---|---|
| Done | out |
|
| Refused | refused |
Failure exit. |
| Timed out | timedOut |