Upload documents to HMRC
Uploads supporting documents for a CDS declaration to HMRC, for example when customs holds the goods and asks for them, and waits for HMRC to check each file.
@lainstack/hmrc/upload-cds-documents · Customs · Available on Lainstack Cloud
How to use it
Section titled “How to use it”Use Upload documents to HMRC to send supporting documents for a customs declaration, by its MRN. The usual case is a declaration that Send CDS declaration left on Held by customs because HMRC asked for documents, such as a licence or a certificate of origin.
HMRC gives each file its own upload address, checks the file, then says whether it took it. The block uploads every file and waits for that answer. It leaves on:
- Uploaded: HMRC took every file.
- Refused: HMRC refused a file (for example its type or a failed virus check), refused the upload, or a file did not reach HMRC. Files says which file and why. The summary names the files to upload again on their own, so the ones HMRC took are not sent twice, and any that may have reached HMRC, to check with HMRC first.
- Timed out: HMRC had not checked every file within Give up after.
Good to know:
- Up to 11 files per step, each up to 10 MB and 18 MB together. Larger sets go over more than one step.
- HMRC takes PDF, JPEG, PNG and plain text files. It checks each file’s type from its content, not its name, and refuses any other.
- Document type is optional free text, such as “Licence”, given to every file.
- Use the same HMRC connection that sent the declaration.
- Once the files are uploaded, an HMRC outage keeps the block waiting until Give up after. A refusal no later check fixes fails the step; resuming the run goes back to checking, without uploading again.
- Uploading does not release the goods by itself: a case worker at HMRC reviews the documents. Follow the declaration with Get CDS declaration status.
- HMRC’s test environment checks and stores the files, but does not link them to a hold there. A test hold clears without them.
Settings
Section titled “Settings”| Setting | Key | Type | Details |
|---|---|---|---|
| HMRC connection (required) | credentialId |
Connection | The connection that sent the declaration. A draft run holds the upload on every connection. At most 160 characters. |
| MRN (required) | mrn |
Text | The Movement Reference Number of the declaration the documents are for. |
| Files (required) | files |
Value | Up to 11 files of up to 10 MB each, 18 MB together. |
| Document type | documentType |
Text | Optional. What the documents are, as HMRC’s case worker reads it. |
| Give up after (minutes) | timeoutMinutes |
Number | Take the Timed out path when HMRC has not checked every file 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 |
| MRN | mrn |
Text |
| Environment | environment |
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 |
| Files | files |
List |
| Exit | Port | Notes |
|---|---|---|
| Uploaded | out |
|
| Refused | refused |
Failure exit. |
| Timed out | timedOut |