Sha256: b2c4a03fb3c7f33be2c1700c7e6998ed9ea9a09a5d93de5984ce6ace6cd7adb3

Contents?: true

Size: 1.48 KB

Versions: 2

Compression:

Stored size: 1.48 KB

Contents

# MWS Orders

**MWS Orders** is a full-featured Ruby interface to the [Amazon Marketplace Web Service (MWS) Orders API](http://docs.developer.amazonservices.com/en_UK/orders/index.html). 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"
client = MWS.orders
```

Set up credentials [when instantiating or with environment variables](https://github.com/hakanensari/peddler#quick-start).

### Orders

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

```ruby
orders = client.list_orders(created_after: 1.month.ago)
puts orders.count # => 100
puts orders.first # => #<MWS::Orders::Order amazon_order_id="123...
)
```

List the next page of orders:

```ruby
client.list_orders_by_next_token(orders.next_token)
```

Get one or more orders based on their order numbers:

```ruby
order = client.get_order("123-1234567-1234567")
puts order # => #<MWS::Orders::Order amazon_order_id="123...
```

### Order Items

List order items:

```ruby
order_items = client.list_order_items("123-1234567-1234567")
```

List the next page of order items:

```ruby
client.list_order_items_by_next_token
```

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
```

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mws-orders-0.1.1 README.md
mws-orders-0.1.0 README.md