-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Inventory Feed API (via new Inventory#update_inventory_supply method) #4
base: master
Are you sure you want to change the base?
Conversation
Hl @alexdowad, thanks for this PR. I'm finally picking this project back up. Have you been using it with success? |
The project for which I wrote this patch was successfully completed a long time ago, and the customer hasn't come back with any complaints. So I assume that ruby-mws is working for them. (Thanks!) |
Good to hear. Do you have any specs to contribute as well? Or at least examples of usage? Thanks |
Hi! The project which I wrote this patch for is already finished, and I'm
|
…quest-URI too large' errors)
…e' errors). Moved Content-MD5 logic into Query
…(to avoid RequestThrottled errors)
…:API::Inventory#update_inventory_prices
… product SKUS + quantities (only for products with quantity > 0)
No news for this PR? |
Hey Guys--yea just wondering if this PR was to be merged. Let me know--this would be SUPER helpful! |
Hey all, sorry I've been so busy and disregarding this project. I'm going to take a look at this over the next few days. I haven't had a chance to use the inventory API but I will be soon so I'll have use for this method and I'll be building support for other inventory API endpoints in the near future. Thanks for your patience. |
(Development of this patch was funded by Sam Hamilton of Mad Jungle. It was done for Sam's web site, but he gave me permission to donate the code back to ruby-mws so others can benefit from it. Thanks, Sam!)
This PR adds support for the Inventory Feeds API, so users of ruby-mws can update the inventory stock levels for their Amazon MWS products.
Using the Feeds API is a bit different from the other APIs. Most of the others just require a single HTTP request, but the Feeds API requires a series of related requests; first to submit a "feed" or XML document, then to check whether Amazon is finished processing the "feed", then to check whether Amazon encountered any errors while processing the "feed".
This means that the code for the new method is rather long compared to the other existing ones. If support for more of the Feeds APIs was desired, a lot of this code could be factored out into a common method. But for now, this is the first one.
The Feeds API requires a "Content-MD5" header be used on the HTTP POST request, so I added some code to MWS::API::Base which can compute and add the needed header. I think it might be useful for access to more of the Amazon MWS API in the future.