Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hakanensari/mws-orders
A Ruby interface to the Amazon MWS Orders API
https://github.com/hakanensari/mws-orders
amazon ecommerce ruby
Last synced: 2 months ago
JSON representation
A Ruby interface to the Amazon MWS Orders API
- Host: GitHub
- URL: https://github.com/hakanensari/mws-orders
- Owner: hakanensari
- License: mit
- Created: 2013-08-07T19:50:58.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2020-06-04T14:06:08.000Z (over 4 years ago)
- Last Synced: 2024-10-09T16:46:25.937Z (3 months ago)
- Topics: amazon, ecommerce, ruby
- Language: Ruby
- Homepage:
- Size: 150 KB
- Stars: 15
- Watchers: 5
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# MWS Orders
[![Build](https://github.com/hakanensari/mws-orders/workflows/build/badge.svg)](https://github.com/hakanensari/mws-orders/actions)
**MWS Orders** is a full-featured Ruby interface to the [Amazon Marketplace Web Service (MWS) Orders API](https://docs.developer.amazonservices.com/en_UK/orders-2013-09-01/). 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:
```ruby
require 'mws/orders/parser'
client = MWS.orders(marketplace: 'ATVPDKIKX0DER',
merchant_id: '123')
```Set up credentials [when instantiating or with environment variables](https://github.com/hakanensari/peddler#usage).
### Orders
List orders created or updated during a time frame you specify:
```ruby
response = client.list_orders('ATVPDKIKX0DER', created_after: 1.month.ago)
orders = response.parse
puts orders.count # => 100
orders.first.inspect # => #
```List the next page of orders:
```ruby
client.list_orders_by_next_token(orders.next_token).parse
```Get one or more orders based on their order numbers:
```ruby
response = client.get_order('902-3159896-1390916')
orders = response.parse
orders.first.inspect # => #
```### Order Items
List order items:
```ruby
response = client.list_order_items('902-3159896-1390916')
order_items = response.parse
```List the next page of order items:
```ruby
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:
```ruby
client.get_service_status.parse
```