If you sell products via Amazon and are interested in using data to improve your business, then look no further than Amazon Marketplace Web Service (MWS). Amazon MWS provides robust functionality for generating a wide variety of reports that will help you make decisions (among other features like inventory and order management). In this article, we’re going to walk through how to start using MWS and the basic functionality for accessing reporting.
Before we start, we want to mention that programmatically using this service is something that can be done quite easily, as Amazon provides an open source client library for interacting with their MWS. The library is available in several different development languages, including C#, PHP, and Java, and is ready to be used as is. During a recent project, we found it cleaner to take the library (the C# version) and compile it into a DLL (Dynamic Link Library) so it could be included in future projects.
Accessing the Amazon Marketplace Web Service
To use the Amazon Marketplace Web Service, sellers go through a registration process that generates certain “tokens” that are required for access. Specifically, a seller will need an Access Key ID, a Secret Access Key, and their Amazon Merchant ID in order to communicate with the MWS. The client library (thankfully) handles the building of properly formatted requests, so the tokens need only be passed to the various classes upon their instantiation or setup.
Downloading the Reports
Once you access the MWS, a wide variety of report types are available by on-demand generation or scheduling (see list of available Report Types). Many API’s are available for managing the reports, but the process of requesting a report and then retrieving it from the service can be simplified down to three particular API calls (see requesting a Report Flowchart):
- RequestReport
- GetReportRequestList
- GetReport
The RequestReport call initiates a request for a specific ReportType (depending on the report, you may have the option to pull a subset of the data with filters like StartDate, EndDate, MarketPlaceID, and more). A successful call of RequestReport will generate a response that contains a ReportRequestId. Take note of this ID, as it will be used to check the status of the report and you will ultimately download it when it is ready.
Once you have your ReportRequestID, the fetching of the requested report is a two-step process. A call is made to the API GetReportRequestList. This API will ask for your report ID (or ID’s – if you are requesting multiple reports) to check on the status.
If the report is ready to be downloaded, its status response will be “_DONE_”, and the response will contain a GeneratedReportId. Enter this GeneratedReportId into the API GetReport to initiate the download of your report file.
Most reports are formatted as either tab-delimited text files or XML, both of which can be easily processed and imported into a database for detailed analysis.
Amazon also provides a useful resource for debugging MWS API calls (see MWS Scratchpad). This site is useful for verifying that your user credentials (access key ID, secret key ID, etc.) are properly registered and working before trying to use your custom applications, as well as for troubleshooting other types of errors.
We hope that this breakdown of using Amazon’s Marketplace Web Service (MWS) was informative and useful. If your business needs help automating and integrating MWS into your current analytics processes, don’t hesitate to contact us!
Keep your data analytics sharp by subscribing to our mailing list!
Thanks for reading! Keep your knowledge sharp by subscribing to our mailing list to receive fresh Key2 content around data analytics, business intelligence, data warehousing, and more!
Key2 Consulting is a data warehousing and business intelligence company located in Atlanta, Georgia. We create and deliver custom data warehouse solutions, business intelligence solutions, and custom applications.
Hi,
I am already using Reports API which gives me all new merchant fulfillment orders but now i want FBA orders also. Means now i need to pull all orders automatically, please guide me achieving the same.
I am using RequestReport, GetReportRequestList, GetReport.
I went through ManageReportScheduleSample but getting confused with the use. Also i want to understand RequestReport useful pulling multiple type report in time interval?
Thanks & regards,
oceanicasa
Hi Jinal,
Thank you very much for your comment!
We believe you are asking two main questions.
1. Can multiple Report Types be requested at a time through RequestReport?
As best as we can tell from the documentation, no. A single call to RequestReport requests a specific ReportType (with optional parameters, such as date range, etc.). If you wanted multiple reports for the same date range, individual requests for each would need to be made.
http://docs.developer.amazonservices.com/en_US/reports/Reports_RequestReport.html
2. How to use ManageReportSchedule?
http://docs.developer.amazonservices.com/en_US/reports/Reports_ManageReportSchedule.html
We aren’t very familiar with this particular API, but as best as we can tell, the idea is to setup a ReportType to be generated on a regular schedule. This would eliminate the need to manually submit a RequestReport operation to have a report generated. If you knew you needed a particular report with particular options on a set schedule, you could set it up to be run automatically so you don’t have to keep manually requesting it. As far as the process for retrieving reports that were generated through the scheduler instead of through a manual request, we aren’t sure if it’s the same flow or a different flow.
We hope this information helps. Please let us know if it does, and thank you again for your comment!
– The Key2 Consulting Team