shipping-api-model

AmzSpApi::ShippingApiModel - the Ruby gem for the Selling Partner API for Shipping

Provides programmatic access to Amazon Shipping APIs.

This SDK is automatically generated by the Swagger Codegen project:

Installation

Build a gem

To build the Ruby code into a gem:

gem build shipping-api-model.gemspec

Then either install the gem locally:

gem install ./shipping-api-model-0.1.0.gem

(for development, run gem install --dev ./shipping-api-model-0.1.0.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'shipping-api-model', '~> 0.1.0'

Install from Git

If the Ruby gem is hosted at a git repository: github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:

gem 'shipping-api-model', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'shipping-api-model'

api_instance = AmzSpApi::ShippingApiModel::ShippingApi.new
shipment_id = 'shipment_id_example' # String |


begin
  result = api_instance.cancel_shipment(shipment_id)
  p result
rescue AmzSpApi::ShippingApiModel::ApiError => e
  puts "Exception when calling ShippingApi->cancel_shipment: #{e}"
end

api_instance = AmzSpApi::ShippingApiModel::ShippingApi.new
body = AmzSpApi::ShippingApiModel::CreateShipmentRequest.new # CreateShipmentRequest |


begin
  result = api_instance.create_shipment(body)
  p result
rescue AmzSpApi::ShippingApiModel::ApiError => e
  puts "Exception when calling ShippingApi->create_shipment: #{e}"
end

api_instance = AmzSpApi::ShippingApiModel::ShippingApi.new

begin
  result = api_instance.get_account
  p result
rescue AmzSpApi::ShippingApiModel::ApiError => e
  puts "Exception when calling ShippingApi->get_account: #{e}"
end

api_instance = AmzSpApi::ShippingApiModel::ShippingApi.new
body = AmzSpApi::ShippingApiModel::GetRatesRequest.new # GetRatesRequest |


begin
  result = api_instance.get_rates(body)
  p result
rescue AmzSpApi::ShippingApiModel::ApiError => e
  puts "Exception when calling ShippingApi->get_rates: #{e}"
end

api_instance = AmzSpApi::ShippingApiModel::ShippingApi.new
shipment_id = 'shipment_id_example' # String |


begin
  result = api_instance.get_shipment(shipment_id)
  p result
rescue AmzSpApi::ShippingApiModel::ApiError => e
  puts "Exception when calling ShippingApi->get_shipment: #{e}"
end

api_instance = AmzSpApi::ShippingApiModel::ShippingApi.new
tracking_id = 'tracking_id_example' # String |


begin
  result = api_instance.get_tracking_information(tracking_id)
  p result
rescue AmzSpApi::ShippingApiModel::ApiError => e
  puts "Exception when calling ShippingApi->get_tracking_information: #{e}"
end

api_instance = AmzSpApi::ShippingApiModel::ShippingApi.new
body = AmzSpApi::ShippingApiModel::PurchaseLabelsRequest.new # PurchaseLabelsRequest |
shipment_id = 'shipment_id_example' # String |


begin
  result = api_instance.purchase_labels(body, shipment_id)
  p result
rescue AmzSpApi::ShippingApiModel::ApiError => e
  puts "Exception when calling ShippingApi->purchase_labels: #{e}"
end

api_instance = AmzSpApi::ShippingApiModel::ShippingApi.new
body = AmzSpApi::ShippingApiModel::PurchaseShipmentRequest.new # PurchaseShipmentRequest |


begin
  result = api_instance.purchase_shipment(body)
  p result
rescue AmzSpApi::ShippingApiModel::ApiError => e
  puts "Exception when calling ShippingApi->purchase_shipment: #{e}"
end

api_instance = AmzSpApi::ShippingApiModel::ShippingApi.new
body = AmzSpApi::ShippingApiModel::RetrieveShippingLabelRequest.new # RetrieveShippingLabelRequest |
shipment_id = 'shipment_id_example' # String |
tracking_id = 'tracking_id_example' # String |


begin
  result = api_instance.retrieve_shipping_label(body, shipment_id, tracking_id)
  p result
rescue AmzSpApi::ShippingApiModel::ApiError => e
  puts "Exception when calling ShippingApi->retrieve_shipping_label: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://sellingpartnerapi-na.amazon.com/

Class | Method | HTTP request | Description ———— | ————- | ————- | ————- AmzSpApi::ShippingApiModel::ShippingApi | {cancel_shipment} | POST /shipping/v1/shipments/{shipmentId}/cancel | AmzSpApi::ShippingApiModel::ShippingApi | {create_shipment} | POST /shipping/v1/shipments | AmzSpApi::ShippingApiModel::ShippingApi | {get_account} | GET /shipping/v1/account | AmzSpApi::ShippingApiModel::ShippingApi | {get_rates} | POST /shipping/v1/rates | AmzSpApi::ShippingApiModel::ShippingApi | {get_shipment} | GET /shipping/v1/shipments/{shipmentId} | AmzSpApi::ShippingApiModel::ShippingApi | {get_tracking_information} | GET /shipping/v1/tracking/{trackingId} | AmzSpApi::ShippingApiModel::ShippingApi | {purchase_labels} | POST /shipping/v1/shipments/{shipmentId}/purchaseLabels | AmzSpApi::ShippingApiModel::ShippingApi | {purchase_shipment} | POST /shipping/v1/purchaseShipment | AmzSpApi::ShippingApiModel::ShippingApi | {retrieve_shipping_label} | POST /shipping/v1/shipments/{shipmentId}/containers/{trackingId}/label |

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.