In this blog post, I will try to cover how to send item quantity data to Amazon and parse the results from Amazon using AWS. We used C# with Amazon SDK leveraging AWS.
We get the list of items that had change in available qty within the last hour. The data is parsed within C# application. You can do other data related operations such as whether the item is valid or if there was really a change in last available qty or not. I am not covering them here.
Next the main aspect this blog is to cover what we need to reference in C# standalone application. You can download Amazon SDK for C# and incorporate them in your project/solution file.
We also need below reference values which you can gather from Amazon Seller.
If this C# application is going to submit data to Amazon USA, then ServiceURL value is something like https://mws.amazonservices.com
Since we are going to update the Qty, we will be using in this example submit operation named “_POST_INVENTORY_AVAILABILITY_DATA_”
Once we have the above credentials and setup ready, next is build XML file that we need to submit. Build XML file in C# using file operations & string builder. Example of what XML should look like:
This XML file contains list of item(s) that need Qty update. The SwitchFulfillmentTo value is important.
Below is sample code. Note:
- Path is the XML file produced above.
- MD5Content is important and you can use what SDK offers.
- Reference/use MktWebClient and MktWebServiceConfig from SDK.
- CustomLog is function that shows output on screen and/or logs to file.
Next step is to find if the feedID received from Amazon is success or errored out or had warnings. If not success, how to tweak them further. All these details will be covered in another blog.
Feel free to contact us for any questions.