Peddler
Peddler is a full-featured Ruby interface to the Amazon Marketplace Web Service (MWS) APIs.
Usage
Require the library:
require 'peddler'
Alternatively, require a particular API only:
require 'mws/orders'
Instantiate a client with the ISO 3166-1 two-letter country code of the marketplace and your seller credentials:
client = MWS::Orders::Client.new('GB', 'key', 'secret', 'merchant_id')
Alternatively, set your credentials as environment variables in your shell:
export AWS_ACCESS_KEY_ID=key
export AWS_SECRET_ACCESS_KEY=secret
export MERCHANT_ID=merchant_id
Then, instantiate with the country code:
client = MWS::Orders::Client.new('US')
Feeds
The MWS Feeds API lets you upload inventory and order data to Amazon. You can also use this API to get information about the processing of feeds.
API methods are available on the client.
Instantiate a client:
client = MWS::Feeds::Client.new('GB')
Submit Feed
Submit a feed:
client.submit_feed(xml, '_POST_PRODUCT_DATA_')
Feed Submission List
List past feed submissions:
# See the API for all available parameters for this and other methods.
client.get_feed_submissions
List the next page of feed submissions:
client.get_feed_submissions_by_next_token
Feed Submission Count
Get the feed submission count:
client.get_feed_submission_count(submitted_from_date: 1.day.ago)
Feed Submission Result
Get the processing report for a submitted feed:
client.feed_submission_result('123456')
Feed Submissions
Cancel one or more feed submissions:
client.cancel_feed_submissions(submitted_to_date: 1.day.ago)
``
### Fulfillment Inbound Shipment
This API is not implemented yet. You can still use the raw client like so:
```ruby
client = MWS::FulfillmentInboundShipment::Client.new('GB')
Pull requests are welcome!
Fulfillment Inventory
This API is not implemented yet. You can still use the raw client like so:
client = MWS::FulfillmentInventory::Client.new('GB')
Pull requests are welcome!
Fulfillment Outbound Shipment
This API is not implemented yet. You can still use the raw client like so:
client = MWS::FulfillmentOutboundShipment::Client.new('GB')
Pull requests are welcome!
Off Amazon Payments
This API is not implemented yet. You can still use the raw client like so:
client = MWS::OffAmazonPayments::Client.new('GB')
Pull requests are welcome!
Orders
With the MWS Orders API, you can list orders created or updated during a time frame you specify or retrieve information about specific orders.
API methods are available on the client.
Instantiate a client:
client = MWS::Orders::Client.new('GB')
Orders
List orders:
# See the API for all available parameters.
client.list_orders(
created_after: 1.week.ago,
order_status: %w(Pending Unshipped)
)
List the next page of orders:
client.list_orders_by_next_token
Get one or more orders based on their order numbers:
client.get_order('123-1234567-1234567')
All above queries will return an enumerable list of orders.
Order Items
List order items based on an order number you specify:
client.list_order_items('123-1234567-1234567')
List the next page of order items:
client.list_order_items_by_next_token
All above queries will return an enumerable list of order items.
Service Status
Check the operational status of the API:
client.get_service_status
Products
This API is not implemented yet. You can still use the raw client like so:
client = MWS::Products::Client.new('GB')
Pull requests are welcome!
Recommendations
This API is not implemented yet. You can still use the raw client like so:
client = MWS::Recommendations::Client.new('GB')
Pull requests are welcome!
Reports
This API is not implemented yet. You can still use the raw client like so:
client = MWS::Reports::Client.new('GB')
Pull requests are welcome!
Sellers
This API is not implemented yet. You can still use the raw client like so:
client = MWS::Sellers::Client.new('GB')
Pull requests are welcome!
Subscriptions
This API is not implemented yet. You can still use the raw client like so:
client = MWS::Subscriptions::Client.new('GB')
Pull requests are welcome!