class Peddler::API::ShippingV1

Selling Partner API for Shipping

Provides programmatic access to Amazon Shipping APIs. Note: If you are new to the Amazon Shipping API, refer to the latest version of <a href=“developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference”>Amazon Shipping API (v2)</a> on the <a href=“developer-docs.amazon.com/amazon-shipping/”>Amazon Shipping Developer Documentation</a> site.

Public Instance Methods

cancel_shipment(shipment_id, rate_limit: 5.0) click to toggle source

Cancel a shipment by the given shipmentId.

@note This operation can make a static sandbox call. @param shipment_id [String] @param rate_limit [Float] Requests per second @return [Hash] The API response

# File lib/peddler/api/shipping_v1.rb, line 51
def cancel_shipment(shipment_id, rate_limit: 5.0)
  path = "/shipping/v1/shipments/#{shipment_id}/cancel"

  meter(rate_limit).post(path)
end
create_shipment(body, rate_limit: 5.0) click to toggle source

Create a new shipment.

@note This operation can make a static sandbox call. @param body [Hash] @param rate_limit [Float] Requests per second @return [Hash] The API response

# File lib/peddler/api/shipping_v1.rb, line 27
def create_shipment(body, rate_limit: 5.0)
  path = "/shipping/v1/shipments"

  meter(rate_limit).post(path, body:)
end
get_account(rate_limit: 5.0) click to toggle source

Verify if the current account is valid.

@note This operation can make a static sandbox call. @param rate_limit [Float] Requests per second @return [Hash] The API response

# File lib/peddler/api/shipping_v1.rb, line 113
def get_account(rate_limit: 5.0)
  path = "/shipping/v1/account"

  meter(rate_limit).get(path)
end
get_rates(body, rate_limit: 5.0) click to toggle source

Get service rates.

@note This operation can make a static sandbox call. @param body [Hash] @param rate_limit [Float] Requests per second @return [Hash] The API response

# File lib/peddler/api/shipping_v1.rb, line 102
def get_rates(body, rate_limit: 5.0)
  path = "/shipping/v1/rates"

  meter(rate_limit).post(path, body:)
end
get_shipment(shipment_id, rate_limit: 5.0) click to toggle source

Return the entire shipment object for the shipmentId.

@note This operation can make a static sandbox call. @param shipment_id [String] @param rate_limit [Float] Requests per second @return [Hash] The API response

# File lib/peddler/api/shipping_v1.rb, line 39
def get_shipment(shipment_id, rate_limit: 5.0)
  path = "/shipping/v1/shipments/#{shipment_id}"

  meter(rate_limit).get(path)
end
get_tracking_information(tracking_id, rate_limit: 1.0) click to toggle source

Return the tracking information of a shipment.

@note This operation can make a static sandbox call. @param tracking_id [String] @param rate_limit [Float] Requests per second @return [Hash] The API response

# File lib/peddler/api/shipping_v1.rb, line 125
def get_tracking_information(tracking_id, rate_limit: 1.0)
  path = "/shipping/v1/tracking/#{tracking_id}"

  meter(rate_limit).get(path)
end
purchase_labels(shipment_id, body, rate_limit: 5.0) click to toggle source

Purchase shipping labels based on a given rate.

@note This operation can make a static sandbox call. @param shipment_id [String] @param body [Hash] @param rate_limit [Float] Requests per second @return [Hash] The API response

# File lib/peddler/api/shipping_v1.rb, line 64
def purchase_labels(shipment_id, body, rate_limit: 5.0)
  path = "/shipping/v1/shipments/#{shipment_id}/purchaseLabels"

  meter(rate_limit).post(path, body:)
end
purchase_shipment(body, rate_limit: 5.0) click to toggle source

Purchase shipping labels.

@note This operation can make a static sandbox call. @param body [Hash] @param rate_limit [Float] Requests per second @return [Hash] The API response

# File lib/peddler/api/shipping_v1.rb, line 90
def purchase_shipment(body, rate_limit: 5.0)
  path = "/shipping/v1/purchaseShipment"

  meter(rate_limit).post(path, body:)
end
retrieve_shipping_label(shipment_id, tracking_id, body, rate_limit: 5.0) click to toggle source

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

@note This operation can make a static sandbox call. @param shipment_id [String] @param tracking_id [String] @param body [Hash] @param rate_limit [Float] Requests per second @return [Hash] The API response

# File lib/peddler/api/shipping_v1.rb, line 78
def retrieve_shipping_label(shipment_id, tracking_id, body, rate_limit: 5.0)
  path = "/shipping/v1/shipments/#{shipment_id}/containers/#{tracking_id}/label"

  meter(rate_limit).post(path, body:)
end