Shipping

class sp_api.api.Shipping(marketplace: Marketplaces = Marketplaces.US, *, refresh_token=None, account='default', credentials=None, restricted_data_token=None, proxies=None, verify=True, timeout=None, version=None, credential_providers=None)

Shipping SP-API Client :link:

Provides programmatic access to Amazon Shipping APIs.

create_shipment(self, **kwargs) ApiResponse

Create a new shipment.

Usage Plan:

Rate (requests per second)

Burst

5

15

For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.

Parameters:
  • body

    { “clientReferenceId”: “string”, “shipTo”: {

    ”name”: “string”, “addressLine1”: “string”, “addressLine2”: “string”, “addressLine3”: “string”, “stateOrRegion”: “string”, “city”: “string”, “countryCode”: “st”, “postalCode”: “string”, “email”: “string”, “copyEmails”: [

    ”string”

    ], “phoneNumber”: “string”

    }, “shipFrom”: {

    ”name”: “string”, “addressLine1”: “string”, “addressLine2”: “string”, “addressLine3”: “string”, “stateOrRegion”: “string”, “city”: “string”, “countryCode”: “st”, “postalCode”: “string”, “email”: “string”, “copyEmails”: [

    ”string”

    ], “phoneNumber”: “string”

    }, “containers”: [

    {

    “containerType”: “PACKAGE”, “containerReferenceId”: “string”, “value”: {

    ”value”: 0, “unit”: “str”

    }, “dimensions”: {

    ”length”: 0, “width”: 0, “height”: 0, “unit”: “IN”

    }, “items”: [

    {

    “quantity”: 0, “unitPrice”: {

    ”value”: 0, “unit”: “str”

    }, “unitWeight”: {

    ”unit”: “g”, “value”: 0

    }, “title”: “string”

    }

    ], “weight”: {

    ”unit”: “g”, “value”: 0

    }

    }

    ]

  • }

Return type:

ApiResponse

get_shipment(self, shipmentId, **kwargs) ApiResponse

Return the entire shipment object for the shipmentId.

Usage Plan:

Rate (requests per second)

Burst

5

15

For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.

Parameters:

shipmentId – string | * REQUIRED

Return type:

ApiResponse

cancel_shipment(self, shipmentId, **kwargs) ApiResponse

Cancel a shipment by the given shipmentId.

Usage Plan:

Rate (requests per second)

Burst

5

15

For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.

Parameters:

shipmentId – string | * REQUIRED

Return type:

ApiResponse

purchase_labels(self, shipmentId, **kwargs) ApiResponse

Purchase shipping labels based on a given rate.

Usage Plan:

Rate (requests per second)

Burst

5

15

For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.

Parameters:
  • shipmentId – string | * REQUIRED

  • body

    { “rateId”: “string”, “labelSpecification”: {

    ”labelFormat”: “PNG”, “labelStockSize”: “4x6”

    }

  • }

Return type:

ApiResponse

retrieve_shipping_label(self, shipmentId, **kwargs) ApiResponse

Retrieve shipping label based on the shipment id and tracking id.

Usage Plan:

Rate (requests per second)

Burst

5

15

For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.

Parameters:
  • shipmentId – string | * REQUIRED

  • trackingId – string | * REQUIRED

  • body

    { “labelSpecification”: {

    ”labelFormat”: “PNG”, “labelStockSize”: “4x6”

    }

  • }

Return type:

ApiResponse

purchase_shipment(self, **kwargs) ApiResponse

Purchase shipping labels.

Usage Plan:

Rate (requests per second)

Burst

5

15

For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.

Parameters:
  • body

    { “clientReferenceId”: “string”, “shipTo”: {

    ”name”: “string”, “addressLine1”: “string”, “addressLine2”: “string”, “addressLine3”: “string”, “stateOrRegion”: “string”, “city”: “string”, “countryCode”: “st”, “postalCode”: “string”, “email”: “string”, “copyEmails”: [

    ”string”

    ], “phoneNumber”: “string”

    }, “shipFrom”: {

    ”name”: “string”, “addressLine1”: “string”, “addressLine2”: “string”, “addressLine3”: “string”, “stateOrRegion”: “string”, “city”: “string”, “countryCode”: “st”, “postalCode”: “string”, “email”: “string”, “copyEmails”: [

    ”string”

    ], “phoneNumber”: “string”

    }, “shipDate”: “2019-08-24T14:15:22Z”, “serviceType”: “Amazon Shipping Ground”, “containers”: [

    {

    “containerType”: “PACKAGE”, “containerReferenceId”: “string”, “value”: {

    ”value”: 0, “unit”: “str”

    }, “dimensions”: {

    ”length”: 0, “width”: 0, “height”: 0, “unit”: “IN”

    }, “items”: [

    {

    “quantity”: 0, “unitPrice”: {

    ”value”: 0, “unit”: “str”

    }, “unitWeight”: {

    ”unit”: “g”, “value”: 0

    }, “title”: “string”

    }

    ], “weight”: {

    ”unit”: “g”, “value”: 0

    }

    }

    ], “labelSpecification”: {

    ”labelFormat”: “PNG”, “labelStockSize”: “4x6”

    }

  • }

Return type:

ApiResponse

get_rates(self, **kwargs) ApiResponse

Get service rates.

Usage Plan:

Rate (requests per second)

Burst

5

15

For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.

Parameters:
  • body

    { “shipTo”: {

    ”name”: “string”, “addressLine1”: “string”, “addressLine2”: “string”, “addressLine3”: “string”, “stateOrRegion”: “string”, “city”: “string”, “countryCode”: “st”, “postalCode”: “string”, “email”: “string”, “copyEmails”: [

    ”string”

    ], “phoneNumber”: “string”

    }, “shipFrom”: {

    ”name”: “string”, “addressLine1”: “string”, “addressLine2”: “string”, “addressLine3”: “string”, “stateOrRegion”: “string”, “city”: “string”, “countryCode”: “st”, “postalCode”: “string”, “email”: “string”, “copyEmails”: [

    ”string”

    ], “phoneNumber”: “string”

    }, “serviceTypes”: [

    ”Amazon Shipping Ground”

    ], “shipDate”: “2019-08-24T14:15:22Z”, “containerSpecifications”: [

    {
    “dimensions”: {

    “length”: 0, “width”: 0, “height”: 0, “unit”: “IN”

    }, “weight”: {

    ”unit”: “g”, “value”: 0

    }

    }

    ]

  • }

Return type:

ApiResponse

get_account(self, **kwargs) ApiResponse

Verify if the current account is valid.

Usage Plan:

Rate (requests per second)

Burst

5

15

For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.

Return type:

ApiResponse

get_tracking_information(self, trackingId, **kwargs) ApiResponse

Return the tracking information of a shipment.

Usage Plan:

Rate (requests per second)

Burst

1

1

For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.

Parameters:

trackingId – string | * REQUIRED

Return type:

ApiResponse