(tracking_status)
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.
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.
from shippo import Shippo
with Shippo(
api_key_header="<YOUR_API_KEY_HERE>",
shippo_api_version="2018-02-08",
) as s_client:
res = s_client.tracking_status.create(request={
"carrier": "usps",
"tracking_number": "9205590164917312751089",
"metadata": "Order 000123",
})
assert res is not None
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
request |
components.TracksRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
Returns the tracking status of a shipment using a carrier name and a tracking number.
from shippo import Shippo
with Shippo(
api_key_header="<YOUR_API_KEY_HERE>",
shippo_api_version="2018-02-08",
) as s_client:
res = s_client.tracking_status.get(tracking_number="<value>", carrier="<value>")
assert res is not None
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
tracking_number |
str | ✔️ | Tracking number |
carrier |
str | ✔️ | Name of the carrier |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |