(addresses)
Addresses are the locations a parcel is being shipped from and to. They represent company and residential places. Among other things, you can use address objects to create shipments, calculate shipping rates, and purchase shipping labels.
- list - List all addresses
- create - Create a new address
- get - Retrieve an address
- validate - Validate an address
Returns a list of all address objects that have been created in this account.
import shippo
s = shippo.Shippo(
api_key_header='<YOUR_API_KEY_HERE>',
shippo_api_version='2018-02-08',
)
res = s.addresses.list()
if res is not None:
# handle response
pass
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, default 5) |
components.AddressPaginatedList
Error Type |
Status Code |
Content Type |
errors.SDKError |
4XX, 5XX |
*/* |
Creates a new address object. You can use address objects to create new shipments, calculate rates, and to create orders.
import shippo
from shippo.models import components
s = shippo.Shippo(
api_key_header='<YOUR_API_KEY_HERE>',
shippo_api_version='2018-02-08',
)
res = s.addresses.create(request=components.AddressCreateRequest(
country='US',
name='Shwan Ippotle',
company='Shippo',
street1='215 Clayton St.',
street3='',
street_no='',
city='San Francisco',
state='CA',
zip='94117',
phone='+1 555 341 9393',
email='[email protected]',
is_residential=True,
metadata='Customer ID 123456',
validate=True,
))
if res is not None:
# handle response
pass
components.Address
Error Type |
Status Code |
Content Type |
errors.SDKError |
4XX, 5XX |
*/* |
Returns an existing address using an object ID.
import shippo
s = shippo.Shippo(
api_key_header='<YOUR_API_KEY_HERE>',
shippo_api_version='2018-02-08',
)
res = s.addresses.get(address_id='<value>')
if res is not None:
# handle response
pass
Parameter |
Type |
Required |
Description |
address_id |
str |
✔️ |
Object ID of the address |
components.Address
Error Type |
Status Code |
Content Type |
errors.SDKError |
4XX, 5XX |
*/* |
Validates an existing address using an object ID
import shippo
s = shippo.Shippo(
api_key_header='<YOUR_API_KEY_HERE>',
shippo_api_version='2018-02-08',
)
res = s.addresses.validate(address_id='<value>')
if res is not None:
# handle response
pass
Parameter |
Type |
Required |
Description |
address_id |
str |
✔️ |
Object ID of the address |
components.Address
Error Type |
Status Code |
Content Type |
errors.SDKError |
4XX, 5XX |
*/* |