mirror of
https://github.com/LukeHagar/speakeasy-playground.git
synced 2025-12-09 12:47:46 +00:00
TrackingStatus
(tracking_status)
Overview
If you purchased your shipping label through Shippo, you can also get all the tracking details of your Shipment
from the Transaction object.
When using your Test token for tracking, you need to use Shippo's
predefined tokens for testing different tracking statuses. You can find more information in our
Tracking tutorial on how to do this, and what the
payloads look like.
Available Operations
- create_track - Register a tracking webhook
- get_track - Get a tracking status
create_track
Registers a webhook that will send HTTP notifications to you when the status of your tracked package changes. For more details on creating a webhook, see our guides on Webhooks and Tracking.
Example Usage
import shippo
from shippo.models import components
s = shippo.Shippo(
api_key_header="<YOUR_API_KEY_HERE>",
)
res = s.tracking_status.create_track(shippo_api_version='<value>', tracks_request=components.TracksRequest(
carrier='usps',
tracking_number='9205590164917312751089',
metadata='Order 000123',
))
if res.track is not None:
# handle response
pass
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
shippo_api_version |
Optional[str] | ➖ | String used to pick a non-default API version to use |
tracks_request |
Optional[components.TracksRequest] | ➖ | N/A |
Response
operations.CreateTrackResponse
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.Tracks400Response | 400 | application/json |
| errors.SDKError | 4x-5xx | / |
get_track
Returns the tracking status of a shipment using a carrier name and a tracking number.
Example Usage
import shippo
s = shippo.Shippo(
api_key_header="<YOUR_API_KEY_HERE>",
)
res = s.tracking_status.get_track(tracking_number='<value>', carrier='<value>', shippo_api_version='<value>')
if res.track is not None:
# handle response
pass
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
tracking_number |
str | ✔️ | Tracking number |
carrier |
str | ✔️ | Name of the carrier |
shippo_api_version |
Optional[str] | ➖ | String used to pick a non-default API version to use |
Response
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.Tracks400Response | 400 | application/json |
| errors.SDKError | 4x-5xx | / |