TOVRReference

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.

EndpointScopeIdempotency-Key
POST /api/v1/shipmentsshipments:writeyes
GET /api/v1/shipmentsshipments:readno
GET /api/v1/shipments/{id}shipments:readno
PATCH /api/v1/shipments/{id}shipments:writeyes

{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

FieldRequiredTypeNotes
external_idyesstring, 1+ charsYour reference. Unique per platform across all organizations.
platformnoenumStored 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.
stopsyesarray of stopOrdered by sequence.
route_segmentsyesarray of segmentMay be empty.
contactsrulearray of contactAt least one usable contact, or 422 contact_required.
eventsnoarray of eventPlanned and actual times per stop.
cargonocargoWhat is moved.
costsnoarray of costMoney lines, including the freight rate.
identifiersnoarray of {type, value}Extra references. type is an identifier type such as CUSTOMER_REFERENCE, ORDER, PURCHASE_ORDER, WAYBILL, LICENSE_PLATE.
attributesnoarray 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_idnouuidThe uuid of one of your organization's shippers. Moving the shipment to confirmed needs one.
visibilitynoprivate, public, platformChecked against the publication rule. See the warning below.
idno—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

FieldRequiredNotes
typeyesPICKUP, DELIVERY, WAYPOINT or UNKNOWN
sequencefor segmentsOrder of the stop. Stops without sequence are not joined by route segments.
locationyesname, 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:

FieldNotes
transportation_modeTRUCK, RAIL, OCEAN, AIR, INTERMODAL, UNKNOWN
vehicle_typeFor example CURTAINSIDER, MEGA, REEFER, BOX, TANKER
distance_value, distance_unitKM, M, MI, NM, FT, IN, CM. The response converts to distance_km.
cargo_weight_value, cargo_weight_unitKG 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.

FieldNotes
typePICKUP, DELIVERY, DEPARTURE, ARRIVAL, IN_TRANSIT, CUSTOMS_CLEARANCE, UNKNOWN
planned_date_time, planned_end_date_timeThe planned window. schedule.planned_from and planned_to.
estimate_date_timeschedule.estimated_at
date_timeThe actual time. schedule.actual_at.
descriptionFree text
date_timesRequired array. Send [] when you have no per-source times.

Contacts

FieldRequiredNotes
nameyes
emailyesThe 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, timezoneno

Cargo

FieldRequiredNotes
sourceyesSend API.
descriptionno
totalsnogross_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_classnoadr_class is an ADR class such as 3 or 2.1.
temperature_min_c, temperature_max_c, temperature_set_point_cno°C
requires_exchangenoPallet exchange
items[]nodescription, 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.

nameBecomes
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 pluralpackaging.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_metersThe cargo's loading_metres
m3, cbm, volume_m3The cargo's volume_m3

quantity, count, units and qty are not routed, because they do not say what was counted.

Costs

FieldNotes
typeFREIGHT_RATE, EXPORT_DEMURRAGE, EXPORT_DETENTION, IMPORT_DEMURRAGE, IMPORT_DETENTION, UNKNOWN. The FREIGHT_RATE line is the shipment's rate.
amount, currencycurrency is ISO 4217. A non-EUR amount is also stored in EUR, converted with TOVR's stored ECB rates.
is_estimatedWhether the amount is an estimate

Contact rules

RuleApplies toRefusal
At least one contact has a non-blank name and a non-blank email or phoneEvery create422 contact_required, param: "contacts"
The organization profile states a contact email and a phone numberA create with visibility public or platform422 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.

FieldTypeNotes
object"shipment"
idstringshp_<uuid>
created_at, updated_atRFC 3339 | null
source{platform, external_id}
identifiers[]{type, value}
owner{id, name} | nullThe owning organization's uuid. name is always null.
visibilitystringPRIVATE, PUBLIC, PLATFORM
statusstringSee 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_atRFC 3339 | nullAlways null today. The list row's expires_at can carry a value for the same shipment.
route.total_distance_kmnumber | nullSum of the segments' distances
route.stops[]stopobject: "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[]segmentobject: "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[]eventobject: "tracking_event", id (evt_…), type, description, occurred_at, estimated_at. Events not tied to a stop.
cargoobject | nullResolved 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 itemobject: "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.
requirementsobjectadr, adr_class, temperature_controlled, pallet_exchange, each null when not stated
metadataobjectEvery 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.

ParameterDefaultValues
limit251–100
cursor—next_cursor from the previous page. Valid only with the sort it was issued for.
sortcreated_atcreated_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}.

FieldTypeNotes
shipment_iduuidBare uuid, without the shp_ prefix
org_iduuid | null
status, availability, platformstringLower-case values, as in the filters (platform as stored)
pickup_country, delivery_countrystring | nullISO 3166-1 alpha-2
pickup_planned_at, delivery_planned_at, expires_at, created_at, updated_attimestamp stringPostgreSQL text form, for example 2026-11-16 07:00:00+00
total_distance_km, freight_rate_eur, cargo_weight_kgnumber | nullfreight_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}

FieldValuesEffect
statuslower-case statusMoves the shipment through the status guard
visibilityprivate, public, platformSets 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

FromToAlso needs
incoming_orderconfirmedA shipper, and a sell price or a freight rate
incoming_ordercancelled—
confirmedassignedAn accepted capacity link. PATCH cannot supply one, so this step is refused over the API.
confirmedcancelled—
assignedloadedAn actual pickup time
assignedconfirmed, cancelled—
loadedunloadedAn actual delivery time
unloadedclosedNo open blocking exception
closedinvoicedA 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

StatuscodeWhen
401missing_credentials, invalid_token, expired_tokenSee Authentication
403insufficient_scopeThe token lacks shipments:read or shipments:write
404not_foundNo such shipment for your organization
409duplicate_external_idYour organization already has this platform + external_id
409external_id_owned_by_another_orgAnother organization has this platform + external_id
409idempotency_key_reuseThe key was used for a different request
422validation_failedSchema error, an id in a create body, a bad UN number, an empty PATCH, a refused status transition, an unknown list parameter
422contact_required, org_not_reachableSee Contact rules
422invalid_cursorThe cursor was not issued for this sort
402, 429quota_exceeded, rate_limitedSee Rate limiting and quota

Each code is described in Errors.

On this page