Shipping V2

class sp_api.api.ShippingV2(*args, **kwargs)

Shipping V2 SP-API Client :link:

Provides programmatic access to Amazon Shipping APIs.

amzn_shipping_business: AmznShippingBusiness = 'AmazonShipping_US'
property headers
get_rates(self, **kwargs) ApiResponse

Returns the available shipping service offerings.

Usage Plan:

Rate (requests per second)

Burst

80

100

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

Examples

literal blocks:

ShippingV2().get_rates()
Parameters:
  • body – GetRatesRequest | required GetRatesRequest body

  • x-amzn-shipping-business-id – object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.

Returns:

ApiResponse

purchase_shipment(self, **kwargs) ApiResponse

Purchases a shipping service and returns purchase related details and documents.

Note: You must complete the purchase within 10 minutes of rate creation by the shipping service provider. If you make the request after the 10 minutes have expired, you will receive an error response with the error code equal to “TOKEN_EXPIRED”. If you receive this error response, you must get the rates for the shipment again.

Usage Plan:

Rate (requests per second)

Burst

80

100

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

Examples

literal blocks:

ShippingV2().purchase_shipment()
Parameters:
  • body – PurchaseShipmentRequest | required PurchaseShipmentRequest body

  • x-amzn-IdempotencyKey – object | A unique value which the server uses to recognize subsequent retries of the same request.

  • x-amzn-shipping-business-id – object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.

Returns:

ApiResponse

one_click_shipment(self, **kwargs) ApiResponse

Purchases a shipping service identifier and returns purchase-related details and documents.

Usage Plan:

Rate (requests per second)

Burst

80

100

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

Examples

literal blocks:

ShippingV2().one_click_shipment()
Parameters:
  • body – OneClickShipmentRequest | required OneClickShipmentRequest body

  • x-amzn-shipping-business-id – object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.

Returns:

ApiResponse

get_tracking(self, **kwargs) ApiResponse

Returns tracking information for a purchased shipment.

Usage Plan:

Rate (requests per second)

Burst

80

100

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

Examples

literal blocks:

ShippingV2().get_tracking()
Parameters:
  • trackingId (key) – object | required A carrier-generated tracking identifier originally returned by the purchaseShipment operation.

  • carrierId (key) – object | required A carrier identifier originally returned by the getRates operation for the selected rate.

  • x-amzn-shipping-business-id – object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.

Returns:

ApiResponse

get_shipment_documents(self, shipmentId, **kwargs) ApiResponse

Returns the shipping documents associated with a package in a shipment.

Usage Plan:

Rate (requests per second)

Burst

80

100

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

Examples

literal blocks:

ShippingV2().get_shipment_documents("value")
Parameters:
  • shipmentId – object | required The shipment identifier originally returned by the purchaseShipment operation.

  • packageClientReferenceId (key) – object | required The package client reference identifier originally provided in the request body parameter for the getRates operation.

  • format (key) – object | The file format of the document. Must be one of the supported formats returned by the getRates operation.

  • dpi (key) – object | The resolution of the document (for example, 300 means 300 dots per inch). Must be one of the supported resolutions returned in the response to the getRates operation.

  • x-amzn-shipping-business-id – object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.

Returns:

ApiResponse

cancel_shipment(self, shipmentId, **kwargs) ApiResponse

Cancels a purchased shipment. Returns an empty object if the shipment is successfully cancelled.

Usage Plan:

Rate (requests per second)

Burst

80

100

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

Examples

literal blocks:

ShippingV2().cancel_shipment("value")
Parameters:
  • shipmentId – object | required The shipment identifier originally returned by the purchaseShipment operation.

  • x-amzn-shipping-business-id – object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.

Returns:

ApiResponse

get_access_points(self, **kwargs) ApiResponse

Returns a list of access points in proximity of input postal code.

Usage Plan:

Rate (requests per second)

Burst

80

100

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

Examples

literal blocks:

ShippingV2().get_access_points()
Parameters:
  • accessPointTypes (key) – object | required Access point types

  • countryCode (key) – object | required Country code for access point

  • postalCode (key) – object | required postal code for access point

  • x-amzn-shipping-business-id – object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.

Returns:

ApiResponse

submit_ndr_feedback(self, **kwargs) ApiResponse

This API submits the NDR (Non-delivery Report) Feedback for any eligible shipment.

Usage Plan:

Rate (requests per second)

Burst

80

100

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

Examples

literal blocks:

ShippingV2().submit_ndr_feedback()
Parameters:
  • body – SubmitNdrFeedbackRequest | required Request body for ndrFeedback operation

  • x-amzn-shipping-business-id – object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.

Returns:

ApiResponse

get_additional_inputs(self, **kwargs) ApiResponse

Returns the JSON schema to use for providing additional inputs when needed to purchase a shipping offering. Call the getAdditionalInputs operation when the response to a previous call to the getRates operation indicates that additional inputs are required for the rate (shipping offering) that you want to purchase.

Usage Plan:

Rate (requests per second)

Burst

80

100

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

Examples

literal blocks:

ShippingV2().get_additional_inputs()
Parameters:
  • requestToken (key) – object | required The request token returned in the response to the getRates operation.

  • rateId (key) – object | required The rate identifier for the shipping offering (rate) returned in the response to the getRates operation.

  • x-amzn-shipping-business-id – object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.

Returns:

ApiResponse

direct_purchase_shipment(self, **kwargs) ApiResponse

Purchases the shipping service for a shipment using the best fit service offering. Returns purchase related details and documents.

Usage Plan:

Rate (requests per second)

Burst

80

100

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

Examples

literal blocks:

ShippingV2().direct_purchase_shipment()
Parameters:
  • body – DirectPurchaseRequest | required DirectPurchaseRequest body

  • x-amzn-IdempotencyKey – object | A unique value which the server uses to recognize subsequent retries of the same request.

  • locale – object | The IETF Language Tag. Note that this only supports the primary language subtag with one secondary language subtag (i.e. en-US, fr-CA). The secondary language subtag is almost always a regional designation. This does not support additional subtags beyond the primary and secondary language subtags.

  • x-amzn-shipping-business-id – object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.

Returns:

ApiResponse

get_carrier_account_form_inputs(self, **kwargs) ApiResponse

This API will return a list of input schema required to register a shipper account with the carrier.

Usage Plan:

Rate (requests per second)

Burst

80

100

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

Examples

literal blocks:

ShippingV2().get_carrier_account_form_inputs()
Parameters:

x-amzn-shipping-business-id – object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.

Returns:

ApiResponse

get_carrier_accounts(self, **kwargs) ApiResponse

This API will return Get all carrier accounts for a merchant.

Usage Plan:

Rate (requests per second)

Burst

80

100

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

Examples

literal blocks:

ShippingV2().get_carrier_accounts()
Parameters:
  • body – GetCarrierAccountsRequest | required GetCarrierAccountsRequest body

  • x-amzn-shipping-business-id – object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.

Returns:

ApiResponse

This API associates/links the specified carrier account with the merchant.

Usage Plan:

Rate (requests per second)

Burst

80

100

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

Examples

literal blocks:

ShippingV2().link_carrier_account("value")
Parameters:
  • carrierId – object | required An identifier for the carrier with which the seller’s account is being linked.

  • body – LinkCarrierAccountRequest | required LinkCarrierAccountRequest body

  • x-amzn-shipping-business-id – object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.

Returns:

ApiResponse

link_carrier_account_post(self, carrierId, **kwargs) ApiResponse

This API associates/links the specified carrier account with the merchant.

Usage Plan:

Rate (requests per second)

Burst

5

10

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

Examples

literal blocks:

ShippingV2().link_carrier_account_post("value")
Parameters:
  • carrierId – object | required An identifier for the carrier with which the seller’s account is being linked.

  • body – LinkCarrierAccountRequest | required LinkCarrierAccountRequest body

  • x-amzn-shipping-business-id – object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.

Returns:

ApiResponse

This API Unlink the specified carrier account with the merchant.

Usage Plan:

Rate (requests per second)

Burst

80

100

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

Examples

literal blocks:

ShippingV2().unlink_carrier_account("value")
Parameters:
  • carrierId – object | required carrier Id to unlink with merchant.

  • body – UnlinkCarrierAccountRequest | required UnlinkCarrierAccountRequest body

  • x-amzn-shipping-business-id – object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.

Returns:

ApiResponse

generate_collection_form(self, **kwargs) ApiResponse

This API Call to generate the collection form.

Usage Plan:

Rate (requests per second)

Burst

80

100

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

Examples

literal blocks:

ShippingV2().generate_collection_form()
Parameters:
  • body – GenerateCollectionFormRequest | required GenerateCollectionFormRequest body

  • x-amzn-IdempotencyKey – object | A unique value which the server uses to recognize subsequent retries of the same request.

  • x-amzn-shipping-business-id – object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.

Returns:

ApiResponse

get_collection_form_history(self, **kwargs) ApiResponse

This API Call to get the history of the previously generated collection forms.

Usage Plan:

Rate (requests per second)

Burst

80

100

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

Examples

literal blocks:

ShippingV2().get_collection_form_history()
Parameters:
  • body – GetCollectionFormHistoryRequest | required GetCollectionFormHistoryRequest body

  • x-amzn-shipping-business-id – object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.

Returns:

ApiResponse

get_unmanifested_shipments(self, **kwargs) ApiResponse
This API Get all unmanifested carriers with shipment locations. Any locations which has unmanifested shipments

with an eligible carrier for manifesting shall be returned.

Usage Plan:

Rate (requests per second)

Burst

80

100

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

Examples

literal blocks:

ShippingV2().get_unmanifested_shipments()
Parameters:
  • body – GetUnmanifestedShipmentsRequest | required GetUmanifestedShipmentsRequest body

  • x-amzn-shipping-business-id – object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.

Returns:

ApiResponse

get_collection_form(self, collectionFormId, **kwargs) ApiResponse

This API reprint a collection form.

Usage Plan:

Rate (requests per second)

Burst

80

100

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

Examples

literal blocks:

ShippingV2().get_collection_form("value")
Parameters:
  • collectionFormId – object | required collection form Id to reprint a collection.

  • x-amzn-shipping-business-id – object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.

Returns:

ApiResponse

create_claim(self, **kwargs) ApiResponse

This API will be used to create claim for single eligible shipment.

Usage Plan:

Rate (requests per second)

Burst

80

100

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

Examples

literal blocks:

ShippingV2().create_claim()
Parameters:
  • body – CreateClaimRequest | required Request body for the createClaim operation

  • x-amzn-shipping-business-id – object | Amazon shipping business to assume for this request. The default is AmazonShipping_UK.

Returns:

ApiResponse