> ## 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.

# Shipments

> Create a Shipment, choose its services, and read its progress.

## What you can do

A Shipment is the business file for one consignment. It can include Customs clearance, RTO handling, or both.

You create the Shipment, then import a manifest when clearance needs declaration lines. The Public API does not submit the Shipment to Customs and does not update or delete a Shipment.

## Before you start

1. Authenticate. See [Authentication & Clients](https://docs.eazecustoms.com/implementation/authentication.md).
2. Choose `clientRef` from [List Clients](https://docs.eazecustoms.com/api-reference/auth/list-clients.md).
3. For RTO, call [List RTO Configurations](https://docs.eazecustoms.com/api-reference/rto/list-rto-configurations.md) and keep `rtoConfigurationId`.

Send `X-Eaze-Client-Ref` on every Shipment request.

## Shipment type and services

`shipmentType` is the direction:

| Value | Meaning | Required module for clearance |
| - | - | - |
| `IMPORT` | Goods coming in | `import` |
| `EXPORT` | Goods going out | `export` |

`enabledServices` is the processing you turn on. Send at least one value. Do not repeat a value.

| Combination | `enabledServices` | Required modules | Additional fields |
| - | - | - | - |
| Import clearance | `["clearance"]` | `import` | None beyond the required Shipment fields |
| Export clearance | `["clearance"]` | `export` | None beyond the required Shipment fields |
| Import and RTO | `["rto"]` | `rto` | `rtoConfigurationId`, `rtoProcessType`, `packageCount`, `totalWeight` |
| Export and RTO | `["rto"]` | `rto` | Same RTO fields |
| Import clearance and RTO | `["clearance", "rto"]` | `import` and `rto` | Same RTO fields |
| Export clearance and RTO | `["clearance", "rto"]` | `export` and `rto` | Same RTO fields |

`rtoProcessType` is one of `IMPORT_HANDLING`, `EXPORT_HANDLING`, `DIRECT_PICKUP`, `DIRECT_DELIVERY`, or `FORWARDER_TRANSFER`. The API does not force a process type to match `shipmentType`. Use the process your RTO configuration expects.

`packageCount` is a positive whole number. `totalWeight` is a positive number. Both are required when `rto` is enabled. You may omit them for a clearance-only Shipment.

Set `hasUld` to true only for an RTO Shipment that uses unit load devices. When it is true, `uldCount` is a positive whole number. Do not send `uldCount` when `hasUld` is omitted or false.

## Steps

```mermaid theme={null}
flowchart TD
  client["Select clientRef"] --> create["Create Shipment"]
  create --> choice{"Clearance enabled?"}
  choice -->|Yes| templates["Choose templates and import the manifest"]
  choice -->|No| rto["Read RTO movements"]
  templates --> declarations["Read Declarations and documents"]
```

**1. Create the Shipment**

Call [Create Shipment](https://docs.eazecustoms.com/api-reference/shipments/create-shipment.md). `shipmentNumber` is your own number, up to 100 characters. It is not the public Shipment ID.

The response `id` is the public Shipment ID. Use it in later paths. `clientReference` is optional and is your own reference, separate from `clientRef`.

**2. Read it back**

Call [Get Shipment](https://docs.eazecustoms.com/api-reference/shipments/get-shipment.md) or [List Shipments](https://docs.eazecustoms.com/api-reference/shipments/list-shipments.md). Get Shipment returns `businessData` for the stored cargo and schedule. List Shipments returns the summary fields and accepts `shipmentType` and `service` (`clearance` or `rto`).

**3. Continue the workflow**

Clearance continues in [Manifest & Declaration Templates](https://docs.eazecustoms.com/implementation/templates.md) and [Manifest Import](https://docs.eazecustoms.com/implementation/manifest-import.md). RTO continues in [RTO Integration](https://docs.eazecustoms.com/implementation/rto.md).

A response includes a service only when the credential can see that module. A credential without `rto` does not receive the RTO status of a Shipment that also has clearance.

Create Shipment and Get Shipment include `businessData`. List Shipments returns the summary fields. `businessData.rto` is included when the Shipment has RTO enabled and the credential includes the `rto` module. The configuration object contains the public configuration id.

## Working example

Import clearance only:

```bash theme={null}
curl --request POST 'https://staging.api.eazecustoms.com/public/v1/shipments' \
  --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 '{
    "shipmentNumber": "SHP-2026-0142",
    "shipmentType": "IMPORT",
    "enabledServices": ["clearance"],
    "clientReference": "PO-44821"
  }'
```

```json theme={null}
{
  "id": "22222222-2222-4222-8222-222222222222",
  "shipmentNumber": "SHP-2026-0142",
  "clientReference": "PO-44821",
  "shipmentType": "IMPORT",
  "enabledServices": ["clearance"],
  "businessStatus": { "clearance": "created" },
  "progress": {
    "clearance": {
      "totalDeclarationsCount": 0,
      "declarationNew": 0,
      "declarationInClearance": 0,
      "declarationException": 0,
      "declarationCompleted": 0
    }
  },
  "timestamps": {
    "createdAt": "2026-11-17T09:00:00.000Z",
    "updatedAt": "2026-11-17T09:00:00.000Z",
    "clearanceCompletedAt": null,
    "rtoStartedAt": null,
    "rtoCompletedAt": null
  },
  "businessData": {
    "remarks": null,
    "cargo": {
      "totalWeight": null,
      "weightUnit": "KG",
      "packageCount": null,
      "hasUld": false,
      "uldCount": null,
      "totalPrice": null,
      "currency": "EUR"
    },
    "schedule": {
      "arrivalAt": null,
      "departureAt": null,
      "flightNumber": null,
      "originAirport": null,
      "destinationAirport": null
    }
  }
}
```

Import clearance and RTO:

```json theme={null}
{
  "shipmentNumber": "SHP-2026-0142",
  "shipmentType": "IMPORT",
  "enabledServices": ["clearance", "rto"],
  "clientReference": "PO-44821",
  "rtoConfigurationId": "99999999-9999-4999-8999-999999999999",
  "rtoProcessType": "IMPORT_HANDLING",
  "packageCount": 4,
  "totalWeight": 42.5
}
```

A later Get Shipment for that combination includes the stored cargo, schedule, and RTO balances:

```json theme={null}
{
  "id": "22222222-2222-4222-8222-222222222222",
  "shipmentNumber": "SHP-2026-0142",
  "clientReference": "PO-44821",
  "shipmentType": "IMPORT",
  "enabledServices": ["clearance", "rto"],
  "businessStatus": { "clearance": "inCustoms", "rto": "IN_PROGRESS" },
  "progress": {
    "clearance": {
      "totalDeclarationsCount": 1,
      "declarationNew": 0,
      "declarationInClearance": 100,
      "declarationException": 0,
      "declarationCompleted": 0
    }
  },
  "timestamps": {
    "createdAt": "2026-11-17T09:00:00.000Z",
    "updatedAt": "2026-11-17T12:00:00.000Z",
    "clearanceCompletedAt": null,
    "rtoStartedAt": "2026-11-17T10:00:00.000Z",
    "rtoCompletedAt": null
  },
  "businessData": {
    "remarks": null,
    "cargo": {
      "totalWeight": "42.50",
      "weightUnit": "KG",
      "packageCount": 4,
      "hasUld": false,
      "uldCount": null,
      "totalPrice": null,
      "currency": "EUR"
    },
    "schedule": {
      "arrivalAt": "2026-11-17T08:30:00.000Z",
      "departureAt": null,
      "flightNumber": "EC101",
      "originAirport": "LHR",
      "destinationAirport": "AMS"
    },
    "rto": {
      "processType": "IMPORT_HANDLING",
      "configuration": { "id": "99999999-9999-4999-8999-999999999999" },
      "statusUpdatedAt": "2026-11-17T12:00:00.000Z",
      "durationDays": null,
      "expiryAlertLevel": "WARNING",
      "accountTotals": {
        "inbound": { "packages": 4, "weightKg": "12.50" },
        "stock": { "packages": 2, "weightKg": "6.25" },
        "inTransit": { "packages": 1, "weightKg": "3.00" },
        "outbound": { "packages": 1, "weightKg": "3.25" }
      }
    }
  }
}
```

`durationDays` stays null while the RTO process is still active. `accountTotals` uses decimal strings for weight. RTO only uses `"enabledServices": ["rto"]` and the same RTO fields. Export uses `"shipmentType": "EXPORT"` and the `export` module when clearance is enabled.

## Statuses and errors

Clearance status is `created`, `inCustoms`, or `completed`. One completed Declaration does not complete the Shipment. `declarationNew`, `declarationInClearance`, `declarationException`, and `declarationCompleted` are percentages from 0 to 100. `totalDeclarationsCount` is the number of Declarations.

RTO status is separate. See [Statuses](https://docs.eazecustoms.com/implementation/statuses.md).

| Situation | What to do |
| - | - |
| HTTP 403 | The credential is missing `import`, `export`, or `rto` for the combination you sent. |
| HTTP 400 on RTO fields | Add the configuration, process type, package count, and weight. |
| HTTP 409 on the idempotency key | You reused a key with a different body. See [Idempotency](https://docs.eazecustoms.com/implementation/idempotency.md). |

Next: [Import & Export](https://docs.eazecustoms.com/implementation/import-and-export.md).


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