Skip to main content

Orders and Shipments

Order is the public root resource​

An Order is the public resource created through V1 creation or Create an Order with Rates. Retain the orderId: it is used to list Orders, get an Order, and update Order status.

Why the API is order-first​

Every workflow in this API starts by creating an Order. There is no operation that creates a Shipment, a Parcel, or an Address on its own, and no operation that rates or labels anything that does not already belong to an Order. That is a property of the published surface, not a convention you can route around:

Order -> Shipment -> Rates -> Label

Two consequences follow from it, and they are the practical reason to know the shape:

  • An Order is the unit of identity. shipmentId, rateId and labelId are all reachable from an orderId, so getting the Order is how you recover the state of anything underneath it. This is what makes recovery after a lost response possible without a separate lookup operation per resource — see Retries and Ambiguous Outcomes.
  • Addresses and parcels are Order data, not standalone resources. They are supplied inside the create-Order request and echoed back on the Order; there is no address book or parcel catalogue to populate first, and nothing to keep in sync.

Model your integration the same way: create the Order when you have a fulfilment decision to record, keep the identifiers it returns, and drive rating and labelling from those. Building a client that holds shipments outside an Order will not map onto any operation this API publishes.

Shipment belongs to an Order​

A Shipment is created as part of an Order. Retain each shipmentId: it is the identifier used to get Rates and create a Label. The Shipment uses the Order's embedded Address and Parcel data.

Shipment processing or status is distinct from Order fulfilment status. Do not infer Order fulfilment from a Shipment status; use the Order status when you need the Order's fulfilment progress.

Get Order returns one Shipment​

An Order is created with exactly one Shipment, and the Get Order response returns a single shipment object; the shipmentId and labelId alongside it refer to that Shipment and its most recent Label. An Order created before the one-Shipment rule can still hold several Shipments; Get Order then returns the most recently created one that a merge has not replaced. When the Order is in a merged Shipment, shipment is that shared Shipment: shipment.isMerged is true and shipment.orderIds lists every Order in it, the anchor first — see Merge Orders into One Shipment.

The diagram below predates the one-Shipment rule and merged Shipments; the text on this page is authoritative where they differ.

Retain the shipmentId that Order creation returned and use it for Rates and Label purchase. After a merge, use the merged Shipment's shipmentId instead: the Order's earlier Shipment is replaced, and rating it answers 409 Shipment.Superseded. An Order with no Shipment yet returns none.

Two creation choices​

Standard Order creation creates one Order without requesting Rates during creation. Create an Order with Rates uses the same creation path, then adds immediate Rate retrieval for each created Shipment in that one Order. Its shipmentRates response groups results by Shipment, not by Order. It is a combined create-and-rate flow, not a replacement for the standard flow.

Identifier flow​

create Order
-> retain orderId
-> retain shipmentId
-> use shipmentId for Rates
-> use a selected rateId for Label purchase
-> retain labelId

Continue with the workflows​