Skip to content
MothershipDevelopers

GuidesTracking a shipment

Getting tracking information

Read a shipment's status and tracking events, and know when to check again.

1 min read

Tracking information for a shipment is available among the details exposed by the Retrieve a shipment endpoint.

Let's fetch these details using the shipment ID returned by the Create a shipment endpoint, as in the request below.

curl --request GET \
  --url https://sandbox.api.mothership.com/beta/shipments/MS5016101 \
  --header "Authorization: Bearer $MOTHERSHIP_API_TOKEN" \
  --header 'Accept: application/json'

Within the response, we can see the following tracking information.

PropertyDescription
statusCurrent status of the shipment. Refer to Shipment statuses for more information.
earliestPickupDateISO 8601 string representing the earliest pickup datetime. This is unlikely to change from the date given on purchase.
estimatedDeliveryDateISO 8601 string representing the estimated delivery datetime. This is unlikely to change from the date given on purchase.
trackingUrlA page where anyone with the link can follow the shipment.
estimatedLocationEstimated current latitude and longitude of the shipment, when one is available. It is often absent, so don't depend on it.

Tracking events

For the history of a shipment rather than its current state, call Track a shipment. It returns one event per update, with the carrier's PRO number once a carrier is assigned.

curl --request GET \
  --url https://sandbox.api.mothership.com/beta/tracking/MS5016101 \
  --header "Authorization: Bearer $MOTHERSHIP_API_TOKEN" \
  --header 'Accept: application/json'

When to check for updates

We can know when to poll for the above tracking information by subscribing to the shipment.status.updated webhook event that fires each time a significant status update occurs.

See Creating a webhook configuration for details about how to subscribe to shipment.status.updated events.