README.md in peddler-0.3.1 vs README.md in peddler-0.4.1

- old
+ new

@@ -1,128 +1,65 @@ -Peddler -======= +# Peddler -Peddler is a Ruby wrapper to the Amazon Inventory management API. +[![travis][1]][2] -![Peddler](http://github.com/papercavalier/peddler/raw/master/mussels.jpg) +![Peddler][3] -Example usage -------------- +Peddler wraps the [Amazon Marketplace Web Service (MWS) APIs][4]. -Set up a client: +```ruby +service = Peddler.new 'US' - client = Peddler::Client.new( - :username => 'foo@bar.com', - :password => 'secret', - :region => :us) +service.configure key: 'key', + secret: 'secret', + seller: 'seller' -Create an inventory file: +service.status # => "GREEN" +``` - batch = client.new_inventory_batch - item = client.new_inventory_item( - :product_id => '1234567890', - :price => 100.00, - :sku => 'SKU-123', - :quantity => 10) - batch << item +## Feeds -Repeat ad infinitum and upload: +The Feeds API lets you upload inventory and order data to Amazon. - batch.upload +## Fulfillment Inbound Shipment -The batch now should have an upload ID. Now, check the error log: +With the Fulfillment Inbound Shipment API, you can create and update inbound +shipments of inventory in the Amazon Fulfillment Network. You can also request +lists of inbound shipments or inbound shipment items based on criteria that you +specify. - upload_log = client.new_report( - :upload, - :id => batch.id) - upload_log.body - => "Feed Processing Summary:\n\tNumber of records processed\t\t1\n\tNumber of records successful\t\t1\n\n" +## Fulfillment Inventory -You are wondering if you have any new orders: +The Fulfillment Inventory API lets you see what is available in your inventory. +It's a real-time reporting mechanism that returns your current or +recently-changed inventory supply in the Amazon fulfillment network. - orders_report = client.new_report :order - orders = client.detab(orders_report.body) - p orders.size - => 1500 - p orders[0].item_name - => "A Thousand Plateaus: Capitalism and Schizophrenia (Paperback) by Gilles Deleuze" +## Fulfillment Outbound Shipment -After processing the orders, post back the results to Amazon: +The Fulfillment Outbound Shipment API is designed to help you integrate +Fulfillment by Amazon with any payment processing application or inventory +management system currently in use. - feed = client.new_order_fulfillment_feed - fulfilled_order = client.new_fulfilled_order( - :order_id => '123-1234567-1234567', - :order_date => '2009-08-01', - :carrier_code => 'USPS', - :tracking_number => '0308 0330 0000 0000 0000') - feed << fulfilled_order +## Orders -Once done, upload: +The Orders API helps you build simple applications that retrieve only the order +information that you need. - feed.upload +## Products -Want to see the processing report? +The 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. - p feed.status - => "_SUBMITTED_" +## Reports -Refresh until you get: +The Reports API lets you request reports about your inventory and orders. - p feed.status! - => "_DONE_" +## Sellers -Then, check the report: +The Sellers API lets sellers retrieve information about their seller account, +such as the marketplaces they participate in. - p feed.download.to_s - -You have an order you can't fill and haven't shipped yet. No problem: - - feed = client.new_order_cancellation_feed - cancelled_order = client.new_cancelled_order( - :order_id => '123-1234567-1234567', - :cancellation_reason_code => 'NoInventory', - :amazon_order_item_code => '12341234567890') - feed << cancelled_order - feed.upload - sleep(60) - feed.status! - => "_DONE_" - p feed.download.to_s - => ... - -To post a refund for an already-shipped item, you use the batch refund method: - - refunds = client.new_refund_batch - refund = client.new_refund( - :order_id => '123-1234567-1234567', - :payments_transaction_id => '12341234567890', - :refund_amount => 1.00, - :reason => 'GeneralAdjustment', - :message => 'With our apologies.') - refunds << refund - refunds.upload - -For a change, let's download something different from Amazon, like a preorder report: - - preorder_report = client.new_report( - :preorder, - :product_line => 'Books', - :frequency => 2) - preorders = client.detab(preorder_report.body) - p preorders.size - => 2000 - p preorders[0].asin - => "1234567890" - p preorders[0].average_asking_price - => "100" - -[Read source](http://gloss.papercavalier.com/peddler) for more info. - -Todo ----- - -Switch to using the [Amazon Marketplace Web Service (Amazon MWS)](https://mws.amazon.com/index.html). - -Compatibility -------------- - -Specs pass against Ruby 1.8.7, Ruby 1.9.2, and Rubinius 1.1. +[1]: https://secure.travis-ci.org/papercavalier/peddler.png +[2]: http://travis-ci.org/papercavalier/peddler +[3]: http://f.cl.ly/items/0W3V0A1Z110Q0x461b3H/mussels.jpeg +[4]: https://developer.amazonservices.com/gp/mws/docs.html