Shipments
The shipments endpoints of the TOVR REST API. Create a shipment, list and read your shipments, and change a shipment's status or visibility. Request fields, the shipment object, list rows, status transitions and errors.
| Endpoint | Scope | Idempotency-Key |
|---|---|---|
POST /api/v1/shipments | shipments:write | yes |
GET /api/v1/shipments | shipments:read | no |
GET /api/v1/shipments/{id} | shipments:read | no |
PATCH /api/v1/shipments/{id} | shipments:write | yes |
{id} is the shipment's shp_<uuid> id, or the bare uuid. A shipment belongs to the
organization of the token that created it. What a shipment is, and how it moves through TOVR, is
in Concepts › Domain model.
Create a shipment
POST /api/v1/shipments
POST only creates. To change a shipment, use PATCH.
curl -X POST https://tovr.eu/api/v1/shipments \
-H "Authorization: Bearer $TOVR_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"external_id": "SO-2026-0417",
"platform": "TOVR",
"identifiers": [{ "type": "CUSTOMER_REFERENCE", "value": "PO-88412" }],
"contacts": [
{ "name": "Elena Petrova", "email": "[email protected]", "phone": "+359 2 491 0000" }
],
"stops": [
{
"type": "PICKUP",
"sequence": 1,
"location": { "address_lines": ["bul. Botevgradsko shose 247"], "postal_code": "1839", "city": "Sofia", "country": "BG" }
},
{
"type": "DELIVERY",
"sequence": 2,
"location": { "address_lines": ["Frankfurter Ring 81"], "postal_code": "80807", "city": "München", "country": "DE" }
}
],
"route_segments": [
{ "transportation_mode": "TRUCK", "vehicle_type": "CURTAINSIDER", "distance_value": 1290, "distance_unit": "KM" }
],
"events": [
{ "type": "PICKUP", "planned_date_time": "2026-11-16T07:00:00Z", "planned_end_date_time": "2026-11-16T11:00:00Z", "date_times": [] },
{ "type": "DELIVERY", "planned_date_time": "2026-11-18T08:00:00Z", "planned_end_date_time": "2026-11-18T14:00:00Z", "date_times": [] }
],
"cargo": {
"source": "API",
"description": "Flat-pack furniture",
"totals": { "gross_weight_kg": 12000, "loading_metres": 13.6 },
"items": [
{ "description": "Flat-pack furniture", "measures": [{ "name": "pallets", "count": 33 }, { "name": "kg", "count": 12000 }] }
]
},
"costs": [{ "type": "FREIGHT_RATE", "amount": 1935, "currency": "EUR" }]
}'The freight rate is EUR 1,935 for 1,290 km, which is EUR 1.50 per km. The response is
201 Created with the shipment object, the same document
GET /shipments/{id} returns:
{
"object": "shipment",
"id": "shp_7c2e5a90-3b1d-4f6e-9a4c-8d2b1e0f5a37",
"created_at": "2026-11-06T09:14:22.418Z",
"updated_at": "2026-11-06T09:14:22.418Z",
"source": { "platform": "TOVR", "external_id": "SO-2026-0417" },
"identifiers": [{ "type": "CUSTOMER_REFERENCE", "value": "PO-88412" }],
"owner": { "id": "4d1f8b2a-6c3e-4a5b-9d7f-0e1c2b3a4d5e", "name": null },
"visibility": "PRIVATE",
"status": "INCOMING_ORDER",
"availability": { "state": "OPEN", "source": "INFERRED", "checked_at": null },
"expires_at": null,
"route": {
"total_distance_km": 1290,
"stops": [
{
"object": "stop",
"id": "stp_1a9e4c27-5d3b-4e80-b6f2-9c0d1e2f3a41",
"sequence": 1,
"type": "PICKUP",
"location": { "name": null, "address": "bul. Botevgradsko shose 247", "postal_code": "1839", "city": "Sofia", "country": "BG", "coordinates": null },
"schedule": { "planned_from": "2026-11-16T07:00:00.000Z", "planned_to": "2026-11-16T11:00:00.000Z", "estimated_at": null, "actual_at": null }
},
{
"object": "stop",
"id": "stp_8f3b6d12-0c4a-4b97-a1e5-2d7c9e8f0b63",
"sequence": 2,
"type": "DELIVERY",
"location": { "name": null, "address": "Frankfurter Ring 81", "postal_code": "80807", "city": "München", "country": "DE", "coordinates": null },
"schedule": { "planned_from": "2026-11-18T08:00:00.000Z", "planned_to": "2026-11-18T14:00:00.000Z", "estimated_at": null, "actual_at": null }
}
],
"segments": [
{
"object": "route_segment",
"id": "seg_2b7d0e94-6a1c-4f3e-8d52-7e9a0b1c2d58",
"from_stop_id": "stp_1a9e4c27-5d3b-4e80-b6f2-9c0d1e2f3a41",
"to_stop_id": "stp_8f3b6d12-0c4a-4b97-a1e5-2d7c9e8f0b63",
"transportation_mode": "TRUCK",
"vehicle_type": "CURTAINSIDER",
"distance_km": 1290,
"travel_time_hours": null,
"cargo_weight_kg": null,
"vehicle_weight_kg": null,
"load_factor": null
}
]
},
"tracking_events": [],
"cargo": {
"object": "cargo",
"description": "Flat-pack furniture",
"gross_weight_kg": 12000,
"volume_m3": null,
"loading_metres": 13.6,
"totals_are_stated": true,
"adr": false,
"adr_class": null,
"temperature": { "min_c": null, "max_c": null, "set_point_c": null, "stated": null },
"requires_exchange": null,
"confidence": null,
"provenance": { "contributing_sources": ["API"], "items_source": "API", "updated_at": "2026-11-06T09:14:22.418Z" },
"items": [
{
"object": "cargo_item",
"id": "cgi_5e0a3f71-8b2d-4c96-9e14-3f6a7b8c9d02",
"position": 1,
"description": "Flat-pack furniture",
"product_category": null,
"packaging": { "quantity": 33, "type": "PALLET", "label": "pallets" },
"gross_weight_kg": 12000,
"dimensions_m": { "length": null, "width": null, "height": null },
"adr_class": null,
"un_number": null,
"adr_packing_group": null,
"temperature": { "min_c": null, "max_c": null },
"stackable": null
}
]
},
"pricing": {
"rate": { "amount": "1935.00", "currency": "EUR", "is_estimated": null },
"costs": [{ "type": "FREIGHT_RATE", "amount": { "amount": "1935.00", "currency": "EUR" } }],
"redacted": false
},
"requirements": { "adr": null, "adr_class": null, "temperature_controlled": null, "pallet_exchange": null },
"metadata": {}
}Request body
| Field | Required | Type | Notes |
|---|---|---|---|
external_id | yes | string, 1+ chars | Your reference. Unique per platform across all organizations. |
platform | no | enum | Stored as TOVR when omitted. It also selects how cargo measures[] are read, and only an explicit TOVR gets the names in Cargo. See Domain model › Enumerations. |
stops | yes | array of stop | Ordered by sequence. |
route_segments | yes | array of segment | May be empty. |
contacts | rule | array of contact | At least one usable contact, or 422 contact_required. |
events | no | array of event | Planned and actual times per stop. |
cargo | no | cargo | What is moved. |
costs | no | array of cost | Money lines, including the freight rate. |
identifiers | no | array of {type, value} | Extra references. type is an identifier type such as CUSTOMER_REFERENCE, ORDER, PURCHASE_ORDER, WAYBILL, LICENSE_PLATE. |
attributes | no | array of {name, value?, values?} | Free-form. adr (or requires_adr), adr_class, temperature_controlled and pallet_exchange (or requires_exchange) become requirements; everything else becomes metadata. |
shipper_id | no | uuid | The uuid of one of your organization's shippers. Moving the shipment to confirmed needs one. |
visibility | no | private, public, platform | Checked against the publication rule. See the warning below. |
id | no | — | Refused with 422 validation_failed, param: "id". POST creates only. |
A created shipment is always private and incoming_order. POST checks visibility
against the publication rule, but stores neither visibility nor status, availability,
purchase_price, target_sell_price or currency from the body. To publish the shipment, send
PATCH with visibility after it is created. Read the response: it shows what was stored.
Stops
| Field | Required | Notes |
|---|---|---|
type | yes | PICKUP, DELIVERY, WAYPOINT or UNKNOWN |
sequence | for segments | Order of the stop. Stops without sequence are not joined by route segments. |
location | yes | name, address_lines[], postal_code, city, country (ISO 3166-1 alpha-2), state, time_zone. Each stop gets its own new location from these fields. A location.id in the body links the stop to that existing location instead, and the other location fields are then not stored. |
Route segments
Segment n joins the n-th and (n+1)-th stop in sequence order. A segment with no such
pair of stops is not stored. from_stop_id and to_stop_id in the body are ignored. Only these
fields are stored; travel_time_*, vehicle_weight_*, load_factor and emissions are not,
so the response shows null for them:
| Field | Notes |
|---|---|
transportation_mode | TRUCK, RAIL, OCEAN, AIR, INTERMODAL, UNKNOWN |
vehicle_type | For example CURTAINSIDER, MEGA, REEFER, BOX, TANKER |
distance_value, distance_unit | KM, M, MI, NM, FT, IN, CM. The response converts to distance_km. |
cargo_weight_value, cargo_weight_unit | KG or LB. The response converts to cargo_weight_kg. |
Events
The n-th event of a type attaches to the n-th stop of the same type: the first PICKUP event
to the first PICKUP stop. Its times become that stop's schedule. An event with no matching
stop appears in tracking_events.
| Field | Notes |
|---|---|
type | PICKUP, DELIVERY, DEPARTURE, ARRIVAL, IN_TRANSIT, CUSTOMS_CLEARANCE, UNKNOWN |
planned_date_time, planned_end_date_time | The planned window. schedule.planned_from and planned_to. |
estimate_date_time | schedule.estimated_at |
date_time | The actual time. schedule.actual_at. |
description | Free text |
date_times | Required array. Send [] when you have no per-source times. |
Contacts
| Field | Required | Notes |
|---|---|---|
name | yes | |
email | yes | The body schema requires it on every contact, so a contact with only a phone is refused with 422 validation_failed before the contact rule runs. |
phone, role, department, position, preferred_language, timezone | no |
Cargo
| Field | Required | Notes |
|---|---|---|
source | yes | Send API. |
description | no | |
totals | no | gross_weight_kg, volume_m3, loading_metres. A positive value in any of them (loading_metres up to 40) sets totals_are_stated: true. |
adr, adr_class | no | adr_class is an ADR class such as 3 or 2.1. |
temperature_min_c, temperature_max_c, temperature_set_point_c | no | °C |
requires_exchange | no | Pallet exchange |
items[] | no | description, product_category, measures[], length_m, width_m, height_m, volume_m3, stackable, adr_class, un_number, adr_packing_group (I, II, III), temperature_min_c, temperature_max_c |
un_number is four digits, optionally prefixed UN ("UN 1203"). Anything else is refused with
422 validation_failed, param: "cargo.items[<i>].un_number".
An item's quantity and weight are stated as measures[] of {name, count}. The name says
what the number is, and TOVR routes it by name, ignoring case. The names below apply when the body
states "platform": "TOVR" or cargo.vocabulary is "API". With platform omitted, no measure
is routed and the items have no quantity or weight; with another platform, that exchange's own
names apply.
name | Becomes |
|---|---|
pallet, pallets, box, boxes, carton, cartons, crate, crates, drum, drums, bag, bags, piece, pieces, pcs, roll, rolls, and the other handling units in singular and plural | packaging.quantity, with packaging.type (PALLET, BOX, …) |
kg, kgs, kilogram(s), t, ton(s), tonne(s), lb, lbs, pound(s) | The item's gross_weight_kg, converted |
ldm, loading_metres, loading_meters | The cargo's loading_metres |
m3, cbm, volume_m3 | The cargo's volume_m3 |
quantity, count, units and qty are not routed, because they do not say what was counted.
Costs
| Field | Notes |
|---|---|
type | FREIGHT_RATE, EXPORT_DEMURRAGE, EXPORT_DETENTION, IMPORT_DEMURRAGE, IMPORT_DETENTION, UNKNOWN. The FREIGHT_RATE line is the shipment's rate. |
amount, currency | currency is ISO 4217. A non-EUR amount is also stored in EUR, converted with TOVR's stored ECB rates. |
is_estimated | Whether the amount is an estimate |
Contact rules
| Rule | Applies to | Refusal |
|---|---|---|
At least one contact has a non-blank name and a non-blank email or phone | Every create | 422 contact_required, param: "contacts" |
| The organization profile states a contact email and a phone number | A create with visibility public or platform | 422 org_not_reachable, param: "visibility" |
The second rule does not apply to visibility: "private". Set the organization's contact details
in Settings → General.
The shipment object
POST /shipments, GET /shipments/{id} and PATCH /shipments/{id} return this object. Enum
values in it are upper case.
| Field | Type | Notes |
|---|---|---|
object | "shipment" | |
id | string | shp_<uuid> |
created_at, updated_at | RFC 3339 | null | |
source | {platform, external_id} | |
identifiers[] | {type, value} | |
owner | {id, name} | null | The owning organization's uuid. name is always null. |
visibility | string | PRIVATE, PUBLIC, PLATFORM |
status | string | See Status transitions |
availability | {state, source, checked_at} | state: OPEN, TAKEN, LAPSED, WITHDRAWN, UNKNOWN. source: STATED, INFERRED, COMMITTED. checked_at: when a source last confirmed it, or null. |
expires_at | RFC 3339 | null | Always null today. The list row's expires_at can carry a value for the same shipment. |
route.total_distance_km | number | null | Sum of the segments' distances |
route.stops[] | stop | object: "stop", id (stp_…), sequence, type, location {name, address, postal_code, city, country, coordinates {lat, lng} | null}, schedule {planned_from, planned_to, estimated_at, actual_at} |
route.segments[] | segment | object: "route_segment", id (seg_…), from_stop_id, to_stop_id, transportation_mode, vehicle_type, distance_km, travel_time_hours, cargo_weight_kg, vehicle_weight_kg, load_factor |
tracking_events[] | event | object: "tracking_event", id (evt_…), type, description, occurred_at, estimated_at. Events not tied to a stop. |
cargo | object | null | Resolved across sources. gross_weight_kg, volume_m3, loading_metres, totals_are_stated, adr, adr_class, temperature {min_c, max_c, set_point_c, stated}, requires_exchange, confidence, provenance {contributing_sources[], items_source, updated_at}, items[] |
cargo.items[] | cargo item | object: "cargo_item", id (cgi_…), position, description, product_category, packaging {quantity, type, label}, gross_weight_kg, dimensions_m {length, width, height}, adr_class, un_number, adr_packing_group, temperature {min_c, max_c}, stackable |
pricing | {rate, costs[], redacted} | rate: the FREIGHT_RATE line as money plus is_estimated. redacted is false on these endpoints, which return only your own shipments. |
requirements | object | adr, adr_class, temperature_controlled, pallet_exchange, each null when not stated |
metadata | object | Every other attribute, name → value or name → [values] |
Money is {"amount": "1935.00", "currency": "EUR"}: the amount is a string with two decimals.
List shipments
GET /api/v1/shipments
Returns your organization's shipments in descending order of the sort field (latest created_at, or latest planned pickup, first), then by id.
| Parameter | Default | Values |
|---|---|---|
limit | 25 | 1–100 |
cursor | — | next_cursor from the previous page. Valid only with the sort it was issued for. |
sort | created_at | created_at, pickup_at |
status | — | Comma list: incoming_order, confirmed, assigned, loaded, unloaded, closed, invoiced, cancelled |
availability | — | Comma list: open, taken, lapsed, withdrawn, unknown |
platform | — | Comma list of source platforms, for example TOVR,TIMOCOM |
The parameter list is strict: an unknown parameter or an unknown value is 422 validation_failed, not an empty page.
curl "https://tovr.eu/api/v1/shipments?status=incoming_order,confirmed&limit=1" \
-H "Authorization: Bearer $TOVR_TOKEN"{
"object": "list",
"data": [
{
"shipment_id": "7c2e5a90-3b1d-4f6e-9a4c-8d2b1e0f5a37",
"org_id": "4d1f8b2a-6c3e-4a5b-9d7f-0e1c2b3a4d5e",
"status": "incoming_order",
"availability": "open",
"platform": "TOVR",
"pickup_country": "BG",
"delivery_country": "DE",
"pickup_planned_at": "2026-11-16 07:00:00+00",
"delivery_planned_at": "2026-11-18 08:00:00+00",
"total_distance_km": 1290,
"freight_rate_eur": 1935,
"cargo_weight_kg": 12000,
"expires_at": null,
"created_at": "2026-11-06 09:14:22.418+00",
"updated_at": "2026-11-06 09:14:23.102+00"
}
],
"has_more": true,
"next_cursor": "eyJ2IjoxLCJzb3J0IjoiY3JlYXRlZF9hdCIs…"
}List row
A list row is a flat summary with its own field names. Read the full shipment with
GET /shipments/{id}.
| Field | Type | Notes |
|---|---|---|
shipment_id | uuid | Bare uuid, without the shp_ prefix |
org_id | uuid | null | |
status, availability, platform | string | Lower-case values, as in the filters (platform as stored) |
pickup_country, delivery_country | string | null | ISO 3166-1 alpha-2 |
pickup_planned_at, delivery_planned_at, expires_at, created_at, updated_at | timestamp string | PostgreSQL text form, for example 2026-11-16 07:00:00+00 |
total_distance_km, freight_rate_eur, cargo_weight_kg | number | null | freight_rate_eur is the freight rate converted to EUR |
has_more is true when another page exists. next_cursor is null on the last page.
Get a shipment
GET /api/v1/shipments/{id}
Returns the shipment object. A shipment that does not exist, or that is
not visible to your organization, is 404 not_found. An id that is neither shp_<uuid> nor a
uuid is 422 validation_failed.
Update a shipment
PATCH /api/v1/shipments/{id}
| Field | Values | Effect |
|---|---|---|
status | lower-case status | Moves the shipment through the status guard |
visibility | private, public, platform | Sets your organization's claim on who else can see the shipment. The response's visibility is the widest of this claim and any exchange listing of the same load, so it can be wider than what you sent. |
Send at least one field. Any other field is refused. A shipment your organization does not own is
404.
curl -X PATCH https://tovr.eu/api/v1/shipments/shp_7c2e5a90-3b1d-4f6e-9a4c-8d2b1e0f5a37 \
-H "Authorization: Bearer $TOVR_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{ "visibility": "public" }'The response is the updated shipment object.
Status transitions
| From | To | Also needs |
|---|---|---|
incoming_order | confirmed | A shipper, and a sell price or a freight rate |
incoming_order | cancelled | — |
confirmed | assigned | An accepted capacity link. PATCH cannot supply one, so this step is refused over the API. |
confirmed | cancelled | — |
assigned | loaded | An actual pickup time |
assigned | confirmed, cancelled | — |
loaded | unloaded | An actual delivery time |
unloaded | closed | No open blocking exception |
closed | invoiced | A recorded freight invoice |
Any other move, and a move to the current status, is refused. A refusal is
422 validation_failed, param: "status", and message names the missing requirement, for
example Cannot confirm shipment …: requires a shipper.
Errors
| Status | code | When |
|---|---|---|
401 | missing_credentials, invalid_token, expired_token | See Authentication |
403 | insufficient_scope | The token lacks shipments:read or shipments:write |
404 | not_found | No such shipment for your organization |
409 | duplicate_external_id | Your organization already has this platform + external_id |
409 | external_id_owned_by_another_org | Another organization has this platform + external_id |
409 | idempotency_key_reuse | The key was used for a different request |
422 | validation_failed | Schema error, an id in a create body, a bad UN number, an empty PATCH, a refused status transition, an unknown list parameter |
422 | contact_required, org_not_reachable | See Contact rules |
422 | invalid_cursor | The cursor was not issued for this sort |
402, 429 | quota_exceeded, rate_limited | See Rate limiting and quota |
Each code is described in Errors.
Errors
The TOVR REST API error catalog. The error envelope, the six error types, every error code with its HTTP status and type, what to do about each, and retry rules. Every error's doc_url links to an entry on this page.
Invoices
The invoices endpoints of the TOVR REST API. GET /v1/invoices and GET /v1/invoices/{invoice_id}, scope invoices:read. The invoice record object, list parameters, lookup by ERP number and errors.