Amazon Marketplace Web Service (MWS) API Call

Document created by ruchika_yadav Employee on Feb 20, 2017Last modified by Adam Arrowsmith on Mar 10, 2017
Version 4Show Document
  • View in full screen mode

This article explains Amazon Marketplace Web Service (MWS) API calls and how to implement the setup in AtomSphere. To start, let's first understand what Amazon MWS is and what is it used for.




Amazon Marketplace Web Service (Amazon MWS) is an integrated Web service API that helps Amazon sellers to programmatically exchange data on listings, orders, payments, reports, and more. XML data integration with Amazon enables higher levels of selling automation, which helps sellers grow their business.


With Amazon MWS, Amazon listing, order, and payment data can be integrated into existing workflows so that selling on Amazon fits seamlessly with sellers' current business practices.



The Amazon MWS API is divided into sections based on functionality. Feed, Finances, Fulfillment, Order API and further information can be found in the Amazon MWS API References.


Amazon Feed API: A variety of specialized feed formats are supported to meet a wide range of seller needs. For example, new products can be added to the Amazon catalog by using MWS supported feeds to define new product detail pages on



For the feeds API we will follow the the business flow as stated in the above diagram. You can always breakdown the flow based on your business use case. For example you can only submit feed and do not necessarily get a submission report or you would like to get the submissionlist only. 


Most of the flow and the functions for the API calls are described in the API guide .We are going to discuss the SubmitFeed API which involves two parts: 

  1. An MD5 hash of the feed content 
  2. the Part of the authentication process that is used for identifying and verifying who is sending a request.


In addition to that, the API call requires the request parameters which are mandatory and here is a list of those parameters: Required request parameters 


There are some key factors which we need to consider while working with the API's. 

  1. It is case sensitive 
  2. Sequence is important
  3. Be careful with the throttling request and the hourly request quota


Testing the API's

You can also test the API request using amazon scratchpad. You will need  awssecretkey ,sellerid, awsaccesskeyid. 


Example Process Flow


Add a set properties shape with the following Process Properties. Note that everything in orange is Process Property.










There are six steps in this process: 


1. Content-MD5: The Content-MD5 header and ContentMD5Value parameter are used as a message integrity check to verify that the decoded data received is the same data that was initially sent.When you use the SubmitFeed operation, you must create an MD5 hash of the HTTP entity body, and include it in your request. We include the hash in a ContentMD5Value parameter. This lets Amazon Marketplace Web Service (Amazon MWS) compare the MD5 hash you create with the MD5 hash it creates when it receives the feed. Amazon MWS can then determine if the feed submitted for processing is identical to the feed that was received. 


import java.util.Properties;

for( int i = 0; i < dataContext.getDataCount(); i++ ) {
InputStream is = dataContext.getStream(i);
Properties props = dataContext.getProperties(i);

//Retrieve a handle to the Logger
DigestInputStream dis = new DigestInputStream(is , MessageDigest.getInstance("MD5"));
byte[] buffer = new byte[8192];
while( > 0);
String md5Content = new String(
props.setProperty("document.dynamic.userdefined.MD5Value", md5Content);
props.setProperty("document.dynamic.userdefined.MD5Content",, "UTF-8"));

dataContext.storeStream(is, props);


2. Encode Timestamp: 

Use custom scripting to format Timestamp. Note that the date values have to be in ISO 8601 date time format. The valid Timestamp format should be something like this:


Here is the script. Use the data process shape for custom scripting.


import java.util.Properties;
String timestamp=''
String EncodedTimestamp=''
for( int i = 0; i < dataContext.getDataCount(); i++ ) {
InputStream is = dataContext.getStream(i);
Properties props = dataContext.getProperties(i);
timestamp= props.getProperty("document.dynamic.userdefined.Timestamp");
EncodedTimestamp = URLEncoder.encode(timestamp,"UTF-8")
props.setProperty("document.dynamic.userdefined.Timestamp", EncodedTimestamp);
dataContext.storeStream(is, props);


3. CanonicalizedQueryString:  This string is created based on the request body:


Replace all the parameters with the values based on the properties that you have set.


4. Create Signature: Part of the authentication process that is used for identifying and verifying who is sending a request. Please download the attached file which has the signature script.


5. CanonicalizedQueryString: After creating the signature, we will create the final query string. It should look like this : 



6. POST Request: The canonicalizedquerystring will be passed as the replacement variable in the POST request.


2 people found this helpful