README.md in peddler-0.9.2 vs README.md in peddler-0.10.0
- old
+ new
@@ -9,85 +9,91 @@
To use Amazon MWS, you must have an eligible seller account.
![Peddler](http://f.cl.ly/items/231z2m0r1Q2o2q1n0w1N/peddler.jpg)
-## Scope
-
-**Peddler** maps one on one to the MWS APIs and their various operations. It treats required request parameters as ordinary arguments and optional ones as keyword arguments. It parses XML responses with [**MultiXml**](https://github.com/sferik/multi_xml), which helps cast the result nodes into Ruby Hashes. Tab-delimited files are handled with Standard Library's [**CSV**](https://github.com/ruby/ruby/blob/trunk/lib/csv.rb).
-
-Further abstraction is not in the scope of this project. See [**MWS Orders**](https://github.com/hakanensari/mws-orders) for a richer interface to the same-named API, built on **Peddler**.
-
## Quick Start
```ruby
require 'peddler'
client = MWS.orders
-parser = client.list_orders(created_after: 1.month.ago)
+parser = client.get_service_status
parser.parse
```
+You can handle HTTP client errors by rescuing API calls individually or defining a global handler on the client level:
+
+```ruby
+client.on_error do |request, response|
+ if response.status == 503
+ # handle throttling by backing off and retrying
+ end
+end
+```
+
+## Credentials
+
You can set up credentials when instantiating:
```ruby
client = MWS.orders(
- marketplace_id: "YOUR_MARKETPLACE_ID",
- merchant_id: "YOUR_MERCHANT_ID",
- aws_access_key_id: "YOUR_AWS_ACCESS_KEY_ID",
- aws_secret_access_key: "YOUR_AWS_SECRET_ACCESS_KEY"
+ marketplace_id: "...",
+ merchant_id: "...",
+ aws_access_key_id: "...",
+ aws_secret_access_key: "..."
)
```
-Alternatively, you can use environment variables if you only have a single set of credentials:
+Alternatively, use environment variables:
```sh
-export MWS_MARKETPLACE_ID=YOUR_MARKETPLACE_ID
-export MWS_MERCHANT_ID=YOUR_MERCHANT_ID
-export AWS_ACCESS_KEY_ID=YOUR_AWS_ACCESS_KEY_ID
-export AWS_SECRET_ACCESS_KEY=YOUR_AWS_SECRET_ACCESS_KEY
+export MWS_MARKETPLACE_ID=...
+export MWS_MERCHANT_ID=...
+export AWS_ACCESS_KEY_ID=...
+export AWS_SECRET_ACCESS_KEY=...
```
## Usage
### Cart Information
With the MWS Cart Information API, you can retrieve shopping carts that your Amazon Webstore customers have created. The Cart Information API enables you to programmatically integrate Amazon Webstore cart information with your CRM systems, marketing applications, and other systems that require cart data.
-[Read the API](http://rubydoc.info/github/hakanensari/peddler/MWS/CartInformation/Client)
+[Read the API](http://www.rubydoc.info/gems/peddler/MWS/CartInformation/Client)
### Customer Information
With the MWS Customer Information API, you can retrieve information from the customer accounts of your Amazon Webstore customers. This customer information includes customer name, contact information, customer account type, and associated Amazon Webstore marketplaces. The Customer Information API enables you to programmatically integrate Amazon Webstore customer account information with your CRM systems, marketing applications, and other systems that require customer data.
-[Read the API](http://rubydoc.info/github/hakanensari/peddler/MWS/CustomerInformation/Client)
+[Read the API](http://www.rubydoc.info/gems/peddler/MWS/CustomerInformation/Client)
### 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.
-[Read the API](http://rubydoc.info/github/hakanensari/peddler/MWS/Feeds/Client)
+[Read the API](http://www.rubydoc.info/gems/peddler/MWS/Feeds/Client)
### Fulfillment Inbound Shipment
With the MWS Fulfillment Inbound Shipment API, you can create and update inbound shipments of inventory in the Amazon Fulfillment Network. You can also also request lists of inbound shipments or inbound shipment items based on criteria that you specify.
-[Read the API](http://rubydoc.info/github/hakanensari/peddler/MWS/FulfillmentInboundShipment/Client)
+[Read the API](http://www.rubydoc.info/gems/peddler/MWS/FulfillmentInboundShipment/Client)
### Fulfillment Inventory
The MWS Fulfillment Inventory API can help you stay up-to-date on the availability of your inventory in the Amazon Fulfillment Network. The Fulfillment Inventory API reports real-time availability information for your Amazon Fulfillment Network inventory regardless of whether you are selling your inventory on Amazon's retail web site or through other retail channels.
-[Read the API](http://rubydoc.info/github/hakanensari/peddler/MWS/FulfillmentInventory/Client)
+[Read the API](http://www.rubydoc.info/gems/peddler/MWS/FulfillmentInventory/Client)
### Fulfillment Outbound Shipment
The MWS Fulfillment Outbound Shipment API enables you to fulfill orders placed through channels other than Amazon's retail web site, using your inventory in the Amazon Fulfillment Network. You can request previews of potential fulfillment orders that return estimated shipping fees and shipping dates based on shipping speed. You can get detailed item-level, shipment-level, and order-level information for any existing fulfillment order that you specify. You can also request lists of existing fulfillment orders based on when they were fulfilled and by the fulfillment method associated with them.
Support for creating and cancelling fulfillment orders has been implemented, but the rest of the API is not supported yet.
-[Read the API](http://rubydoc.info/github/hakanensari/peddler/MWS/FulfillmentOutboundShipment/Client)
+[Read the API](http://www.rubydoc.info/gems/peddler/MWS/FulfillmentOutboundShipment/Client)
### Off Amazon Payments
The MWS Off-Amazon Payments API helps you to process payments for purchases made by buyers on your website using the Login and Pay with Amazon service. This API enables you to programmatically retrieve shipping and payment information provided by the buyer from their Amazon account. It allows you to authorize, capture, and refund payments, enabling a variety of payments scenarios.
@@ -95,42 +101,42 @@
```ruby
client = MWS.off_amazon_payments.sandbox
```
-[Read the API](http://rubydoc.info/github/hakanensari/peddler/MWS/OffAmazonPayments/Client)
+[Read the API](http://www.rubydoc.info/gems/peddler/MWS/OffAmazonPayments/Client)
### 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.
-[Read the API](http://rubydoc.info/github/hakanensari/peddler/MWS/Orders/Client)
+[Read the API](http://www.rubydoc.info/gems/peddler/MWS/Orders/Client)
### Products
The MWS Products API helps you get information to match your products to existing product listings on Amazon Marketplace websites and to make sourcing and pricing decisions for listing those products on Amazon Marketplace websites.
-[Read the API](http://rubydoc.info/github/hakanensari/peddler/MWS/Products/Client)
+[Read the API](http://www.rubydoc.info/gems/peddler/MWS/Products/Client)
### Recommendations
The Recommendations API enables you to programmatically retrieve Amazon Selling Coach recommendations by recommendation category. A recommendation is an actionable, timely, and personalized opportunity to increase your sales and performance.
-[Read the API](http://rubydoc.info/github/hakanensari/peddler/MWS/Recommendations/Client)
+[Read the API](http://www.rubydoc.info/gems/peddler/MWS/Recommendations/Client)
### Reports
The Reports API lets you request reports about your inventory and orders.
-[Read the API](http://rubydoc.info/github/hakanensari/peddler/MWS/Reports/Client)
+[Read the API](http://www.rubydoc.info/gems/peddler/MWS/Reports/Client)
### Sellers
The Sellers API lets sellers retrieve information about their seller account, such as the marketplaces they participate in.
-[Read the API](http://rubydoc.info/github/hakanensari/peddler/MWS/Sellers/Client)
+[Read the API](http://www.rubydoc.info/gems/peddler/MWS/Sellers/Client)
### Subscriptions
The Amazon MWS Subscriptions API section enables you to subscribe to receive notifications that are relevant to your business with Amazon. With the operations in the Subscriptions API section, you can register to receive important information from Amazon without having to poll the Amazon MWS service. Instead, the information is sent directly to you when an event occurs to which you are subscribed.
-[Read the API](http://rubydoc.info/github/hakanensari/peddler/MWS/Subscriptions/Client)
+[Read the API](http://www.rubydoc.info/gems/peddler/MWS/Subscriptions/Client)