(carrier_parcel_templates)
A carrier parcel template represents a package used for shipping that has preset dimensions defined by a carrier. Some examples of a carrier parcel template include USPS Flat Rate Box and Fedex Small Pak. When using a carrier parcel template, the rates returned may be limited to the carrier that provides the box. You can create user parcel templates using a carrier parcel template. Shippo takes the dimensions of the carrier parcel template but you must configure the weight.
List all carrier parcel template objects.
Use the following query string params to filter the results as needed.
- `include=all` (the default). Includes templates from all carriers
- `include=user`. Includes templates only from carriers which the user has added (whether or not they're currently enabled)
- `include=enabled`. includes templates only for carriers which the user has added and enabled
- `carrier=*token*`. filter by specific carrier, e.g. fedex, usps
import shippo
s = shippo.Shippo(
api_key_header="<YOUR_API_KEY_HERE>",
shippo_api_version='2018-02-08',
)
res = s.carrier_parcel_templates.list(carrier='fedex')
if res is not None:
# handle response
pass
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
include |
Optional[operations.Include] | ➖ | filter by user or enabled | |
carrier |
Optional[str] | ➖ | filter by specific carrier | fedex |
components.CarrierParcelTemplateList
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |
Fetches the parcel template information for a specific carrier parcel template, identified by the token.
import shippo
s = shippo.Shippo(
api_key_header="<YOUR_API_KEY_HERE>",
shippo_api_version='2018-02-08',
)
res = s.carrier_parcel_templates.get(carrier_parcel_template_token='<value>')
if res is not None:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
carrier_parcel_template_token |
str | ✔️ | The unique string representation of the carrier parcel template |
components.CarrierParcelTemplate
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |