MWS Orders is a full-featured Ruby interface to the Amazon Marketplace Web Service (MWS) Orders API. With the MWS Orders API, you can list orders created or updated during a time frame you specify or retrieve information about specific orders.
To use Amazon MWS, you must have an eligible seller account.
Create a client:
require 'mws/orders/parser' client = .orders(marketplace: 'ATVPDKIKX0DER', merchant_id: '123')
Set up credentials when instantiating or with environment variables.
List orders created or updated during a time frame you specify:
response = client.list_orders(created_after: 1.month.ago) orders = response.parse puts orders.count # => 100 puts orders.first # => #<MWS::Orders::Order amazon_order_id="123... )
List the next page of orders:
Get one or more orders based on their order numbers:
response = client.get_order('123-1234567-1234567') order = response.parse puts order # => #<MWS::Orders::Order amazon_order_id="123...
List order items:
response = client.list_order_items('123-1234567-1234567') order_items = response.parse
List the next page of order items:
Orders and order items are represented by POROs that map one on one to the attributes returned by the API.
Check the operational status of the API: