---
title: "Creates a shipment"
method: POST
path: "/shipments/v4"
tags: ["Shipments"]
---

# Creates a shipment

`POST /shipments/v4`

Creates a new shipment. A shipment consists of segments each representing a part of the
logistics journey. A segment spans from a location to another and each segment may be
assigned a different tracking device.

The segments of the shipment must form a continuous chain of locations, that is the origin of a
segment must match the destination of a previous segment.

## Request body

- union
  - object — Body for creating a shipment
    - `autoStart` boolean — A boolean parameter defining whether the shipment starts upon exiting the first origin location.
    - `description` string — Description of the shipment
    - `name` string — Name of the shipment
    - `providedEta` string, date-time — ETA for the shipment
    - `providedEtd` string, date-time — ETD for the shipment
    - `ruleIds` string[] — Array of `ruleId`s to associate with the shipment
    - `segments` object[], required — Array of objects each defining the origin and destination of the segment
      - `description` string — Description of the segment
      - `destination` string, required — Destination location of this segment
      - `name` string — Name of the segment
      - `origin` string, required — Origin location of this segment
      - `providedEta` string, date-time — ETA for the segment
      - `providedEtd` string, date-time — ETD for the segment
      - `trackingId` string — ID of the tracking device that produces data for this segment
      - `transportMode` 'car' | 'truck' | 'sea' | 'air' | 'undefined', required — Transport mode of the segment
    - `subShipment` boolean — Flag telling if shipment is a subShipment.
  - object — Create shipment from an existing shipment plan
    - `shipmentDeparture` string, date-time — ETD of the shipment instance. Used to calculate the ETDs and ETAs of all the segments based on the segment durations defined in the plan.
    - `shipmentPlanId` string, required — Shipment plan ID

## Response `201`

Created.

The shipment has been successfully created.

- object
  - `shipmentId` string, required — Shipment ID

## Other responses

- `400` — Bad request The request object is in an incorrect format or has values that are invalid or out of range. If available, further error details are provided in the response body.
- `401` — Unauthorized The request did not provide correct authentication details
- `403` — Forbidden The account does not have the correct privileges
- `404` — Not Found The specified resource was not found

---

[API](https://skmtc.net/here/apis/tracking.md) · [All operations](https://skmtc.net/here/apis/tracking/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/here/tracking/versions/efa162f7023c/schema)
