Skip to main content

Models

These pages describe every resource the Connect API accepts and returns, and what each field means. The API reference already gives you the types, which fields are required, and which are nullable. What a type cannot carry is the meaning: when a field is set, who sets it, and what a value implies about the delivery. That is what you will find here.

This is the contract for the HTTP API, so it is worth reading once before you model orders on your side.

The resource set

The Connect API has four resource types, described in On resource types.

ResourceWhat it represents
OrderA package, or set of packages, you are sending to a recipient.
CourierA courier your account is connected to and can submit orders to.
PickupLocationOne of your own locations a courier can collect from.
OrderShippingLabelsA short-lived link to an order's printable label PDF.

The Order is the only resource you write. Couriers and pickup locations are managed in the Spoke Connect app and read here so you can reference them by id. Shipping labels are rendered on demand and never stored.

How they relate

An order carries the ids of the other resources rather than embedding them:

  • Order.courier is a couriers/... id, null until the order is submitted.
  • Order.deliveryInstructions.handOffInfo.pickupLocationId is a pickupLocations/... id, set only when the courier collects from you.
  • Order.barcodes are the barcodes printed on the order's shipping labels.

Ids carry their collection prefix everywhere, and appending one to the base address is how you address that resource. See On resource IDs.

Reading the field tables

Each page lists the fields of the resource as the API returns them. Where a field is only accepted on the way in, or only produced on the way out, the page says so. Two conventions run through all of them:

  • null means "not set", never "empty" or "zero". A null packageLoadAmount means no load was recorded, not that the package weighs nothing.
  • Timestamps are seconds since epoch, not milliseconds. Calendar dates are { year, month, day } objects with no timezone, because they describe a day rather than an instant.