API surface. Facilities, routes, stops, legs and route runs are managed over GraphQL Interface (operations consoles and driver apps). Integrators use REST forA carrier moves parcels between hubs on scheduled line-haul. A 3PL strings its own trucks together with subcontracted carrier legs. A fleet runs delivery routes through dozens of addresses a day. These are the same structure at different scales: ordered stops, joined by legs, run on a schedule. This chapter models all three with one set of objects.POST /v1/journeys/planandGET /v1/shipments/{id}/journey.
Plans and executions are separate so that the timetable is edited in one place, and what actually happened is recorded in another. The same split appears elsewhere in the spec: pickup schedules and pickups, rate sheets and rates.
The diagram below shows how the plan objects (left) relate to the execution objects (right).
1. Facility
typeishub,sort_center,depot,gateway,warehouse,fulfillment_center,cross_dock,airport,seaport,rail_terminal,access_point,customs_bonded, orpartner.operating_hoursis aRecurrence(chapter 01 §13). Here,timesholdsHH:MM-HH:MMranges.capabilitiesissort,customs_clearance,export_screening,dangerous_goods,cold_chain,returns_processing,pickup_point.functionsdeclares what the facility is for, with a spec per function. A facility may have several functions: a sort hub with a small returns area, or a fulfillment center that also cross-docks.
facilities (GraphQL Interface query) finds candidate facilities. Fulfillment allocation (chapter 29 §4) and journey planning (§4) use functions to decide where goods can be stored, sorted or handed over.
- GraphQL:
facilities,facility,createFacility,updateFacility,deleteFacility. Delete is refused while a route references the facility.
2. Route
Legs are derived, then edited
There is exactly one leg between each pair of consecutive stops. When stops are added, removed or reordered, the implementer recomputes the leg list. A leg whosefrom_stop → to_stop pair survives the change keeps its ID and attributes. New pairs get a new leg with defaults (mode: road, operator: self). Clients edit leg attributes, and never create or delete legs directly.
This example inserts a new stop stp_4 between stp_2 and stp_3. The stp_1 to stp_2 pair survives, so leg_a keeps its ID and attributes. The stp_2 to stp_3 pair no longer exists, so leg_b is gone, and the two new pairs get new legs with defaults.
Endpoints
active route apply to runs generated after the change. Existing future runs are regenerated only with updateRoute (GraphQL Interface mutation) and apply_to_existing_runs: true. Runs already in progress are never modified.
3. Route run
statusisplanned,dispatched,in_progress,completed, orcancelled.stops[].statusispending,arrived,departed,completed,skipped, orfailed(with areasontaken from the trackingstatus_detailvocabulary).legs[].statusispending,in_transit,arrived, orcancelled.routeisnullfor ad-hoc runs, which are created directly with their own stops (typical in fleet mode).
Endpoints
tracking_events to the affected shipments’ trackers (chapter 07), with source: "implementer" and carrier_metadata: { run, stop, leg }. For example, arrive at an import facility produces in_transit / arrived_at_destination_country, complete with delivered produces delivered, and fail with recipient_unavailable produces exception / recipient_unavailable. Carrier, 3PL and fleet implementers therefore get tracking from operations without a separate integration, and clients see the same tracker API as in Universal mode.
This sequence shows a driver completing or failing a last-mile stop, and the tracking events and webhooks that follow.
4. Journey
A journey is a shipment’s path through the network. It is planned at rating or purchase time and updated as runs execute.segments[].typeisfirst_mile(collection to the first network facility),middle_mile(facility to facility: line-haul road, air, ocean or rail, including customs gateways), orlast_mile(final facility to the consignee, or to an access point). A single carrier that covers origin to destination end to end produces oneend_to_endsegment.linehaulroutes (§2) servemiddle_milesegments.statusisplanned,on_track,at_risk(a predicted miss of a downstream cutoff),delayed,rerouted, orcompleted.- Subcontracted segments (the 3PL case) create a child shipment through the
connectionsmodule. Its tracker events are merged into the parent shipment’s tracker, withsource: "carrier_poll"or"carrier_push".
- In Carrier and 3PL modes,
rate.deliverycomes from the planned journey’splanned_delivery, andshipment.tracking.journeyis set at purchase. - Rerouting:
replanShipmentJourney(GraphQL Interface mutation) ({ reason, avoid: { facilities, runs } }) produces a new plan, andjourney.reroutedfires.
5. Events
facility.created, facility.updated, route.created, route.updated, route.activated, route.deactivated, route_run.created, route_run.dispatched, route_run.started, route_run.stop_arrived, route_run.stop_completed, route_run.stop_failed, route_run.completed, route_run.cancelled, route_run.delayed, journey.planned, journey.at_risk, journey.delayed, journey.rerouted, journey.completed.