Class: Peddler::APIs::ShippingV1
- Inherits:
-
Peddler::API
- Object
- Peddler::API
- Peddler::APIs::ShippingV1
- Defined in:
- lib/peddler/apis/shipping_v1.rb
Overview
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.
Instance Attribute Summary
Attributes inherited from Peddler::API
#access_token, #endpoint, #retries
Instance Method Summary collapse
-
#cancel_shipment(shipment_id, rate_limit: 5.0) ⇒ Peddler::Response
Cancel a shipment by the given shipmentId.
-
#create_shipment(body, rate_limit: 5.0) ⇒ Peddler::Response
Create a new shipment.
-
#get_account(rate_limit: 5.0) ⇒ Peddler::Response
Verify if the current account is valid.
-
#get_rates(body, rate_limit: 5.0) ⇒ Peddler::Response
Get service rates.
-
#get_shipment(shipment_id, rate_limit: 5.0) ⇒ Peddler::Response
Return the entire shipment object for the shipmentId.
-
#get_tracking_information(tracking_id, rate_limit: 1.0) ⇒ Peddler::Response
Return the tracking information of a shipment.
-
#purchase_labels(shipment_id, body, rate_limit: 5.0) ⇒ Peddler::Response
Purchase shipping labels based on a given rate.
-
#purchase_shipment(body, rate_limit: 5.0) ⇒ Peddler::Response
Purchase shipping labels.
-
#retrieve_shipping_label(shipment_id, tracking_id, body, rate_limit: 5.0) ⇒ Peddler::Response
Retrieve shipping label based on the shipment id and tracking id.
Methods inherited from Peddler::API
#endpoint_uri, #http, #initialize, #meter, #retriable, #sandbox, #sandbox?, #typed, #typed?, #use, #via
Constructor Details
This class inherits a constructor from Peddler::API
Instance Method Details
#cancel_shipment(shipment_id, rate_limit: 5.0) ⇒ Peddler::Response
This operation can make a static sandbox call.
Cancel a shipment by the given shipmentId.
54 55 56 57 58 |
# File 'lib/peddler/apis/shipping_v1.rb', line 54 def cancel_shipment(shipment_id, rate_limit: 5.0) path = "/shipping/v1/shipments/#{percent_encode(shipment_id)}/cancel" parser = Peddler::Types::ShippingV1::CancelShipmentResponse if typed? meter(rate_limit).post(path, parser:) end |
#create_shipment(body, rate_limit: 5.0) ⇒ Peddler::Response
This operation can make a static sandbox call.
Create a new shipment.
30 31 32 33 34 |
# File 'lib/peddler/apis/shipping_v1.rb', line 30 def create_shipment(body, rate_limit: 5.0) path = "/shipping/v1/shipments" parser = Peddler::Types::ShippingV1::CreateShipmentResponse if typed? meter(rate_limit).post(path, body:, parser:) end |
#get_account(rate_limit: 5.0) ⇒ Peddler::Response
This operation can make a static sandbox call.
Verify if the current account is valid.
116 117 118 119 120 |
# File 'lib/peddler/apis/shipping_v1.rb', line 116 def get_account(rate_limit: 5.0) path = "/shipping/v1/account" parser = Peddler::Types::ShippingV1::GetAccountResponse if typed? meter(rate_limit).get(path, parser:) end |
#get_rates(body, rate_limit: 5.0) ⇒ Peddler::Response
This operation can make a dynamic sandbox call.
Get service rates.
105 106 107 108 109 |
# File 'lib/peddler/apis/shipping_v1.rb', line 105 def get_rates(body, rate_limit: 5.0) path = "/shipping/v1/rates" parser = Peddler::Types::ShippingV1::GetRatesResponse if typed? meter(rate_limit).post(path, body:, parser:) end |
#get_shipment(shipment_id, rate_limit: 5.0) ⇒ Peddler::Response
This operation can make a static sandbox call.
Return the entire shipment object for the shipmentId.
42 43 44 45 46 |
# File 'lib/peddler/apis/shipping_v1.rb', line 42 def get_shipment(shipment_id, rate_limit: 5.0) path = "/shipping/v1/shipments/#{percent_encode(shipment_id)}" parser = Peddler::Types::ShippingV1::GetShipmentResponse if typed? meter(rate_limit).get(path, parser:) end |
#get_tracking_information(tracking_id, rate_limit: 1.0) ⇒ Peddler::Response
This operation can make a static sandbox call.
Return the tracking information of a shipment.
128 129 130 131 132 |
# File 'lib/peddler/apis/shipping_v1.rb', line 128 def get_tracking_information(tracking_id, rate_limit: 1.0) path = "/shipping/v1/tracking/#{percent_encode(tracking_id)}" parser = Peddler::Types::ShippingV1::GetTrackingInformationResponse if typed? meter(rate_limit).get(path, parser:) end |
#purchase_labels(shipment_id, body, rate_limit: 5.0) ⇒ Peddler::Response
This operation can make a static sandbox call.
Purchase shipping labels based on a given rate.
67 68 69 70 71 |
# File 'lib/peddler/apis/shipping_v1.rb', line 67 def purchase_labels(shipment_id, body, rate_limit: 5.0) path = "/shipping/v1/shipments/#{percent_encode(shipment_id)}/purchaseLabels" parser = Peddler::Types::ShippingV1::PurchaseLabelsResponse if typed? meter(rate_limit).post(path, body:, parser:) end |
#purchase_shipment(body, rate_limit: 5.0) ⇒ Peddler::Response
This operation can make a static sandbox call.
Purchase shipping labels.
93 94 95 96 97 |
# File 'lib/peddler/apis/shipping_v1.rb', line 93 def purchase_shipment(body, rate_limit: 5.0) path = "/shipping/v1/purchaseShipment" parser = Peddler::Types::ShippingV1::PurchaseShipmentResponse if typed? meter(rate_limit).post(path, body:, parser:) end |
#retrieve_shipping_label(shipment_id, tracking_id, body, rate_limit: 5.0) ⇒ Peddler::Response
This operation can make a static sandbox call.
Retrieve shipping label based on the shipment id and tracking id.
81 82 83 84 85 |
# File 'lib/peddler/apis/shipping_v1.rb', line 81 def retrieve_shipping_label(shipment_id, tracking_id, body, rate_limit: 5.0) path = "/shipping/v1/shipments/#{percent_encode(shipment_id)}/containers/#{percent_encode(tracking_id)}/label" parser = Peddler::Types::ShippingV1::RetrieveShippingLabelResponse if typed? meter(rate_limit).post(path, body:, parser:) end |