Files
speakeasy-playground/docs/sdks/trackingstatus
Mike Lueders 14c449163c generate sdk
2024-03-01 12:52:50 -06:00
..
2024-03-01 12:52:50 -06: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.

A tracking status of a package is an indication of current location of a package in the supply chain. For example, sorting, warehousing, or out for delivery. Use the tracking status object to track the location of your shipments.

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

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

operations.GetTrackResponse

Errors

Error Object Status Code Content Type
errors.Tracks400Response 400 application/json
errors.SDKError 4x-5xx /