Nonflavored Prescription Medicine
Miss any of our Open RFC calls?Watch the recordings here! »


1.1.11 • Public • Published

travis-ci-status npm version npm downloads


This is a light-weight javascript library for Amazon Marketplace Web Service(Amazon MWS) APIs. It is said to be lite-weight because it only provides essentials to use Amazon MWS, it doesn't provide abstract API data types.

This library could run under several Javascript environments like:

  • Node.js
  • Web Pages(useless in most cases due to the cross domain request restriction)
  • Browser Extensions(you need to add the mws endpoint urls to manifest.json to allow access)
  • Google App Scripts, not working due to GAS runtime issues and bugs at the moment



npm install --save @lemay/mws-api-lite


There are three API signatures in this client:

// For API without body data, use this
apiName(params, callback);
// For special API SubmitFeed or any API that has request body, use this one, body should be a js string, client will do the encoding
apiName(params, body, callback);
// For special API GetServiceStatus, use this, the first parameter is the section name API, with whitespace striped
// it could be "Orders", "Products", "FulfillmentOutboundShipment", "Reports" etc
apiName('Orders', callback);

the callback is a standard Node.js style callback, first parameter is err, and second one is response, always compare err with null to check error, sometimes the api call may also throw an error, so a try catch block is recommended.

params is a api request parameter object, e.g. {"CreatedAfter": '2017-10-20T00:00:00Z', "MarketplaceId.Id.1": MWSClient.getMarketplaceId('US')}, when there are no request parameters, use a blank object {}.

Since marketplace id is used all the time in MWS APIs, we provide a special class method getMarketplaceId(), it takes a country code like CN, US, JP, FR etc, and will return the corresponding Amazon marketplace id, see examples below.


Create and initialize an mws client instance:

const MWSClient=require('@lemay/mws-api-lite').NodeJSMWSClient;
const client_auth = new MWSClient('US', '<your-access-id>', '<your-mws-access-secret>', '<your-seller-id>', '<your-mws-auth-token-optional>');

Get Orders Service Status:

client_auth.GetServiceStatus('Orders', function(err, res){
  } else {

List recent orders:

client_auth.ListOrders({"CreatedAfter": '2017-10-20T00:00:00Z', "MarketplaceId.Id.1": MWSClient.getMarketplaceId('US')}, function(err, res){
  } else {

Submit an xml price feed:

var xml=`
<?xml version="1.0" encoding="UTF-8"?>
<AmazonEnvelope xmlns:xsi="" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
        <StandardPrice currency="USD">13.80</StandardPrice>
client_auth.SubmitFeed({FeedType: '_POST_PRODUCT_PRICING_DATA_', "MarketplaceIdList.Id.1": MWSClient.getMarketplaceId('US'), }, xml, function(err, res){
  } else {

Submit a flat file(tsv) feed:

const fs=require('fs');
const path=require('path');
const tsv=fs.readFileSync(path.join(__dirname, 'data.tsv'), {encoding: 'utf8'});
client_auth.SubmitFeed({FeedType: '_POST_FLAT_FILE_LISTINGS_DATA_', "MarketplaceIdList.Id.1": MWSClient.getMarketplaceId('US')}, tsv, function(err, res){
  } else {

Browser or Browser extensions

Use <script> tag with jsDelivr CDN:

<script src=""></script>
var client = new WebBrowserMWSClient(...);

Or download the pre-built version from, then put it into your web page(will not work due to cross domain request restriction) or extension.

Google Apps Script(GAS)

GAS version is not working due to some GAS runtime issues and bugs.

var client = new GoogleAppsScriptMWSClient(...);

Download the pre-built version from



npm i @lemay/mws-api-lite

DownloadsWeekly Downloads






Unpacked Size

2.28 MB

Total Files


Last publish


  • avatar