Project

mws-orders

0.02
No commit activity in last 3 years
No release in over 3 years
A Ruby interface to the Amazon MWS Orders API, built on Peddler
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 6.0
~> 1.0
~> 2.0
~> 2.0
 Project Readme

MWS Orders

Build

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.

Usage

Create a client:

require 'mws/orders/parser'
client = MWS.orders(marketplace: 'ATVPDKIKX0DER',
                    merchant_id: '123')

Set up credentials when instantiating or with environment variables.

Orders

List orders created or updated during a time frame you specify:

response = client.list_orders('ATVPDKIKX0DER', created_after: 1.month.ago)
orders = response.parse
puts orders.count # => 100
orders.first.inspect # => #<MWS::Orders::Order 902-3159896-1390916>

List the next page of orders:

client.list_orders_by_next_token(orders.next_token).parse

Get one or more orders based on their order numbers:

response = client.get_order('902-3159896-1390916')
orders = response.parse
orders.first.inspect # => #<MWS::Orders::Order 902-3159896-1390916>

Order Items

List order items:

response = client.list_order_items('902-3159896-1390916')
order_items = response.parse

List the next page of order items:

client.list_order_items_by_next_token.parse

Orders and order items are represented by POROs that map one on one to the attributes returned by the API.

Service Status

Check the operational status of the API:

client.get_service_status.parse