Create shipments and optionally a tour. When a property definition with an external validator applies to shipments or loads, the request is limited to 40 shipments and behaves per row unless a tour is requested: each shipment is validated and created independently, rejected rows are reported in the response's failed list with their zero-based request index, and all other rows are created (partial success). With a tour creation strategy the request stays one all-or-nothing booking. Without an external validator the request is unchanged: all-or-nothing, no row limit. Set matchShipperAddresses to true to match each stop against the assigned shipper's saved address book. Saved-address references sent on a stop (shipperAddressId, shipperAddressContactId, shipperAddressLoadingPoint) are always checked against the assigned shipper: with matchShipperAddresses true a reference that does not belong to that shipper is rejected with 400, otherwise it is removed and the shipment is created without it. A shipperId that does not exist in the tenant, or a team or user of another shipper, rejects the whole request with 422 and the violation codes of the assignment. The request or its shipments may name the assignment with shipperLookup instead of ids: the shipper, shipper team or shipper user that holds a property value (see the shipperLookup field for the rules and outcomes). The shipments store the resolved ids; a lookup that names no active holder, or more than one, rejects the whole request with 422, and one that cannot be answered right now with 503. Auto-Routing: a request without a tourCreationStrategy may set autoRoute, a policy by which each shipment joins the best-fitting existing tour of its day instead of being created without a tour; each shipment may override the policy or turn it off with its own autoRoute, and the response's routing lists per shipment the tour it joined or why none. A request with autoRoute is always all-or-nothing, also when an external validator applies, and auto-routes at most 3 shipments (a shipment with autoRoute: false does not count; more is a 400). The ranking runs before anything is created: a shipment left without a tour under onNoMatch: reject rejects the whole request with 422. The shipments join their tours after they are created; when concurrent bookings keep that from settling in time, the shipments exist and the answer is 409. A request with an Idempotency-Key header is all-or-nothing too, also when an external validator applies.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
400bad request
401unauthorized
403The role of the API key does not allow this action. The key needs a role with the matching permission, for example full access.
409internalCode AutoRouteConflict: auto-routing did not settle, because concurrent bookings kept changing the candidate tours within the request's time, the ranking could not read every tour of the day or did not finish within the request's time, or a shipment's commit failed or could not start within the request's time, or the shipments could not be read back once routing had finished. The body's routing lists every shipment. When its entries carry a shipmentId, the shipments were created: each routed entry joined its tour, each unrouted entry exists without one and names why (conflict, or the reason a fresh ranking gave). Without shipmentId nothing was created and the request can be sent again. warnings carries the leg-plan warnings a commit met, if any. A request sent again with the same Idempotency-Key gets this answer too while routing has not settled, and completes the routing once when the first request no longer holds it.
422the shipper assignment cannot be used: an unknown shipper, a team or user of another shipper, or a shipperLookup that names no active holder or more than one (see the violation codes); or, under autoRoute with onNoMatch: reject, a shipment found no tour to join (internalCode AutoRouteNoMatch, AutoRouteNearMiss or AutoRouteAmbiguous, nothing was created; the body's routing names the outcome of every shipment by its index); or the Idempotency-Key was already used by this API key for another request (internalCode IdempotencyKeyReused, nothing was created)
503the shipper assignment could not be verified right now; nothing was created, retry later
