Skip to content

Latest commit

 

History

History
192 lines (124 loc) · 9.92 KB

File metadata and controls

192 lines (124 loc) · 9.92 KB

ShippoAccounts

(shippo_accounts)

Overview

Shippo Accounts are used by Shippo Platform Accounts to create and manage Managed Shippo Accounts. Managed Shippo Accounts are headless accounts that represent your customers. They are opaque to your end customers, meaning customers do not need to create their own Shippo login or have a billing relationship with Shippo. They can be used by marketplaces, e-commerce platforms, and third-party logistics providers who want to offer, seamless, built-in shipping functionality to their customers. See our guide for more details.

Available Operations

  • list - List all Shippo Accounts
  • create - Create a Shippo Account
  • get - Retrieve a Shippo Account
  • update - Update a Shippo Account

list

Returns a list of Shippo Managed Accounts objects.

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.shippo_accounts.list()

    assert res is not None

    # Handle response
    print(res)

Parameters

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.

Response

components.ShippoAccountPaginatedList

Errors

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

create

Creates a new Shippo Managed Account.

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.shippo_accounts.create(request={
        "email": "hippo@shippo.com",
        "first_name": "Shippo",
        "last_name": "Meister",
        "company_name": "Acme",
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request components.ShippoAccountUpdateRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

components.ShippoAccount

Errors

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

get

Returns a Shippo Managed Account using an object ID.

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.shippo_accounts.get(shippo_account_id="<id>")

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
shippo_account_id str ✔️ Object ID of the ShippoAccount
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

components.ShippoAccount

Errors

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

update

Updates a Shippo Managed Account using an object ID.

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.shippo_accounts.update(shippo_account_id="<id>", shippo_account_update_request={
        "email": "hippo@shippo.com",
        "first_name": "Shippo",
        "last_name": "Meister",
        "company_name": "Acme",
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
shippo_account_id str ✔️ Object ID of the ShippoAccount
shippo_account_update_request Optional[components.ShippoAccountUpdateRequest] N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

components.ShippoAccount

Errors

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