(customs_items)
Customs declarations are relevant information, including one or multiple customs items, you need to provide for customs clearance for your international shipments.
Returns a list all customs items objects.
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.customs_items.list()
assert res is not None
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
page |
Optional[int] | ➖ | The page number you want to select |
results |
Optional[int] | ➖ | The number of results to return per page (max 100) |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
components.CustomsItemPaginatedList
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
Creates a new customs item object.
from shippo import Shippo
from shippo.models import components
with Shippo(
api_key_header="<YOUR_API_KEY_HERE>",
shippo_api_version="2018-02-08",
) as s_client:
res = s_client.customs_items.create(request={
"description": "T-Shirt",
"mass_unit": components.WeightUnitEnum.LB,
"net_weight": "5",
"origin_country": "<value>",
"quantity": 20,
"value_amount": "200",
"value_currency": "USD",
"metadata": "Order ID \"123454\"",
"sku_code": "HM-123",
"hs_code": "0901.21",
})
assert res is not None
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
request |
components.CustomsItemCreateRequest | ✔️ | 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 an existing customs item using an object ID
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.customs_items.get(customs_item_id="<id>")
assert res is not None
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
customs_item_id |
str | ✔️ | Object ID of the customs item |
page |
Optional[int] | ➖ | The page number you want to select |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |