---
title: "Updates a shipment details"
method: PATCH
path: "/shipments/v4/{shipmentId}"
tags: ["Shipments"]
---

# Updates a shipment details

`PATCH /shipments/v4/{shipmentId}`

Updates details of a shipment identified by the `shipmentId`.
This is a partial update, meaning that only the provided fields will be updated,
except when updating segments, the whole segments will be replaced fully.

Changing the status of the shipment affects the statuses of the segments. The following
status changes are allowed:
* `pending` → `ongoing`
  * changes the status of the first segment to `ongoing`
* `pending` → `cancelled`
  * changes the status of all segments to `cancelled`
* `ongoing` → `cancelled`
  * cancels the current `ongoing` segment and all the succeeding segments
* `ongoing` → `completed`
  * completes the current `ongoing` segment and cancels all the succeeding segments

***Note***:
`segments` and `autoStart` can be updated via this API call only if the shipment is in
`pending` state.

## Request body

- object — Body for updating 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[] — 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
  - `status` 'pending' | 'ongoing' | 'completed' | 'cancelled' — Status of the shipment
  - `subShipment` boolean — Flag telling if shipment is a subShipment.

## Response `204`

Successful (no content)

The shipment information was updated

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