> ## Documentation Index
> Fetch the complete documentation index at: https://docs.eazecustoms.com/llms.txt
> Use this file to discover all available pages before exploring further.

# NCTS Departure

> Create a Departure Transit Declaration and import its goods file.

## What you can do

Create a Departure, upload a goods file, and read the house consignments and goods items created from that file.

Departure file import replaces the current goods details (`mode` is `replace_all`). It is allowed only before Customs has assigned an MRN, and only while the declaration can still be edited.

## Before you start

* `ncts` module and `X-Eaze-Client-Ref`.
* A Departure template ID, or exactly one default Departure template.
* `commercialReference`, your reference for this movement.
* A CSV or Excel file with purpose `ncts_items`. A typical header row is `Goods code, Description, Net weight, Package count, Supplementary unit, Invoice amount, Package type, Shipping marks`. Use the columns your template expects.

Offices, countries, and declaration type can come from the template. Send them on the request only when you need to override the template.

## Steps

```mermaid theme={null}
flowchart TD
  client["Select the client"] --> templates["List Departure templates"]
  templates --> create["Create the Transit Declaration"]
  create --> upload["Upload and complete the goods file"]
  upload --> importReq["Import Departure Details"]
  importReq --> operation["Poll the Operation"]
  operation --> houses["Read house consignments and goods items"]
  houses --> watch["Read status and release notifications"]
```

**1. Create the Departure**

Call [Create Transit Declaration](https://docs.eazecustoms.com/api-reference/ncts/create-transit-declaration.md). Omit `movementType`, or set it to `DEPARTURE`. Do not send Arrival fields.

The response includes the public ID and the generated LRN. `mrn` stays null until Customs registers the movement.

**2. Upload the goods file**

Follow [File Uploads](https://docs.eazecustoms.com/implementation/file-uploads.md) with `purpose: ncts_items`. NCTS files are parsed when you complete the upload. More than 999 items in one house consignment is rejected at that step.

**3. Import the details**

Call [Import Departure Details](https://docs.eazecustoms.com/api-reference/ncts/import-departure-details.md).

```json theme={null}
{ "uploadId": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa", "mode": "replace_all" }
```

Optional `packageType` and `shippingMarks` apply when the file does not supply them. The response is HTTP 202 with `operationId` and `status: queued`.

**4. Read the imported details**

Poll [Get Operation](https://docs.eazecustoms.com/api-reference/operations/get-operation.md) until the status is terminal. Then call [List House Consignments](https://docs.eazecustoms.com/api-reference/ncts/list-house-consignments.md), [Get House Consignment](https://docs.eazecustoms.com/api-reference/ncts/get-house-consignment.md), and [List Goods Items](https://docs.eazecustoms.com/api-reference/ncts/list-goods-items.md).

**5. Watch the business status**

Read the Transit Declaration for status changes. Subscribe to `ncts.departure.released` if you want a notification when Customs releases the departure. Then read the declaration and [List Transit Documents](https://docs.eazecustoms.com/api-reference/documents/list-transit-documents.md) again. The transit accompanying document is not guaranteed to exist at the moment of release.

## Working example

```bash theme={null}
curl --request POST 'https://staging.api.eazecustoms.com/public/v1/ncts/transit-declarations' \
  --header 'Authorization: Bearer EZ_11111111-1111-4111-8111-111111111111_exampleSecretValueNotReal' \
  --header 'X-Eaze-Client-Ref: ACME-AMS' \
  --header 'Idempotency-Key: 6f1c0b3e-8a21-4c5d-9e10-1a2b3c4d5e6f' \
  --header 'Content-Type: application/json' \
  --data '{
    "commercialReference": "TR-2026-0188",
    "clientReference": "PO-44821",
    "templateId": "abababab-abab-4aba-8aba-abababababab",
    "declarationType": "T1",
    "additionalDeclarationType": "A",
    "countryOfDispatch": "NL",
    "countryOfDestination": "DE",
    "departureOffice": "NL000432",
    "destinationOffice": "DE003305"
  }'
```

```json theme={null}
{
  "id": "44444444-4444-4444-8444-444444444444",
  "commercialReference": "TR-2026-0188",
  "clientReference": "PO-44821",
  "lrn": "26NL00000000001881",
  "mrn": null,
  "movementType": "DEPARTURE",
  "declarationType": "T1",
  "status": "NEW",
  "validation": { "status": "PENDING", "readyForSubmission": false },
  "counts": { "houseConsignments": 0, "goodsItems": 0 }
}
```

Create returns this header. Get Transit Declaration adds `businessData`, `customsOutcome`, and `finalDocumentStatuses`. See [NCTS Overview](https://docs.eazecustoms.com/implementation/ncts-overview.md).

A successful import Operation uses `type: ncts.details.import`. Read house consignments with the Transit Declaration ID:

```bash theme={null}
curl 'https://staging.api.eazecustoms.com/public/v1/ncts/transit-declarations/44444444-4444-4444-8444-444444444444/house-consignments' \
  --header 'Authorization: Bearer EZ_11111111-1111-4111-8111-111111111111_exampleSecretValueNotReal' \
  --header 'X-Eaze-Client-Ref: ACME-AMS'
```

## Statuses and errors

Import is accepted only when the declaration is a Departure, is still editable, is not archived, has no MRN, has no active departure submission, and its status is `NEW`, `READY_TO_DECLARE`, `BLOCKED`, or `INVALID`.

An invalid goods file finishes as `requires_review` with `error.code: import_file_invalid` and `retryable: false`. Existing house consignments and goods items are left as they were.

| Situation | What to do |
| - | - |
| HTTP 409, upload already reserved | The message is "Upload is already reserved for another import operation". Complete a new upload and use a new idempotency key. |
| Another import is `queued` or `running` | Wait for that Operation to finish. |
| `requires_review` | Correct the file. The same upload cannot be imported again. |
| Reimport after an MRN exists | The API rejects it. Departure details can no longer be replaced. |

A replay of the exact same idempotency key and body returns the original response. A changed body with the same key returns HTTP 409.

Departure status values are listed on [Statuses](https://docs.eazecustoms.com/implementation/statuses.md).

Next: [NCTS Arrival](https://docs.eazecustoms.com/implementation/ncts-arrival.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.