Python Client SDK Generated by Speakeasy
Project description
Shippo Python SDK
Shippo is a shipping API that connects you with multiple shipping carriers (such as USPS, UPS, DHL, Canada Post, Australia Post, and many others) through one interface.
You must register for a Shippo account to use our API. It's free to sign up. Only pay to print a live label, test labels are free.
To use the API, you must generate an API Token. In the following examples, replace <YOUR_API_KEY_HERE>
with your own token.
For example.
api_key_header="ShippoToken shippo_test_595d9cb0c0e14497bf07e75ecfec6c6d"
SDK Installation
pip install shippo
SDK Example Usage
Example
import shippo
shippo_sdk = shippo.Shippo(
api_key_header="<YOUR_API_KEY_HERE>",
# the API version can be globally set, though this is normally not required
# shippo_api_version='<YYYY-MM-DD>',
)
address_list = shippo_sdk.addresses.list()
if address_list is not None:
# handle response
pass
Custom HTTP Client
The Python SDK makes API calls using the requests HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom requests.Session
object.
For example, you could specify a header for every request that this sdk makes as follows:
import shippo
import requests
http_client = requests.Session()
http_client.headers.update({'x-custom-header': 'someValue'})
s = shippo.Shippo(client=http_client)
Documentation
Review our full guides and references at https://docs.goshippo.com/.
Available Resources and Operations
addresses
- list - List all addresses
- create - Create a new address
- get - Retrieve an address
- validate - Validate an address
batches
- create - Create a batch
- get - Retrieve a batch
- add_shipments - Add shipments to a batch
- purchase - Purchase a batch
- remove_shipments - Remove shipments from a batch
carrier_accounts
- list - List all carrier accounts
- create - Create a new carrier account
- get - Retrieve a carrier account
- update - Update a carrier account
- register - Add a Shippo carrier account
- get_registration_status - Get Carrier Registration status
customs_declarations
- list - List all customs declarations
- create - Create a new customs declaration
- get - Retrieve a customs declaration
customs_items
rates_at_checkout
- create - Generate a live rates request
- get_default_parcel_template - Show current default parcel template
- update_default_parcel_template - Update default parcel template
- delete_default_parcel_template - Clear current default parcel template
manifests
orders
carrier_parcel_templates
parcels
pickups
- create - Create a pickup
rates
- get - Retrieve a rate
- list_shipment_rates - Retrieve shipment rates
- list_shipment_rates_by_currency_code - Retrieve shipment rates in currency
refunds
service_groups
- list - List all service groups
- create - Create a new service group
- update - Update an existing service group
- delete - Delete a service group
shipments
tracking_status
transactions
user_parcel_templates
- list - List all user parcel templates
- create - Create a new user parcel template
- delete - Delete a user parcel template
- get - Retrieves a user parcel template
- update - Update an existing user parcel template
shippo_accounts
- list - List all Shippo Accounts
- create - Create a Shippo Account
- get - Retrieve a Shippo Account
- update - Update a Shippo Account
Maturity
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.
Contributions
While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release.
About Shippo
Connect with multiple different carriers, get discounted shipping labels, track parcels, and much more with just one integration. You can use your own carrier accounts or take advantage of our discounted rates with the Shippo carrier accounts. Using Shippo makes it easy to deal with multiple carrier integrations, rate shopping, tracking and other parts of the shipping workflow. We provide the API and web app for all your shipping needs.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.