Skip to content

Latest commit

 

History

History
108 lines (71 loc) · 5.22 KB

File metadata and controls

108 lines (71 loc) · 5.22 KB

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 - Register a tracking webhook
  • get - Get a tracking status

create

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

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)

Parameters

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.

Response

components.Track

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get

Returns the tracking status of a shipment using a carrier name and a tracking number.

Example Usage

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)

Parameters

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.

Response

components.Track

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*