GitHub Actions workflows status
CodeClimate
npm i mws-client
Module | Description |
---|---|
mws-client | Creates a new client to communicate with MWS API |
Name | Description |
---|---|
Section | A section of MWS API. Note: all sections and associated endpoints are generated automatically when instanciating a new client |
Name | Description |
---|---|
MWSResponse | Response received from MWS API |
Options | Options for the new MWS client instanciation |
MWS | MWS client |
Creates a new client to communicate with MWS API
Returns: MWS
- MWS client
Param | Type | Description |
---|---|---|
opts | Options |
Options to be passed to instanciate a new client |
Example
const MWS = require('mws-client')({
AWSAccessKeyId: process.env.YOUR_AWS_ACCESS_KEY,
SellerId: process.env.YOUR_SELLER_ID,
MWSAuthToken: process.env.YOUR_MWS_AUTH_TOKEN
})
A section of MWS API. Note: all sections and associated endpoints are generated automatically when instanciating a new client
Kind: global class
Send a request to the given endpoint
Kind: static method of Section
Returns: MWSResponse
- Response received from MWS API
Param | Type | Description |
---|---|---|
opts | Object |
Parameters for the API call. See here for details regarding parameters for every endpoints. Note: list parameters are not supporting Array type yet. You will have to build them in the same way as they appear in the query string of the signed request to MWS API (i.e. param.1=foo¶m.2=bar ) |
Example
// retrieves inventory from given date for the German marketplace
const list = await MWS.fulfillmentInventory.listInventorySupply({
QueryStartDateTime: new Date(d).toISOString(),
ResponseGroup: 'Basic',
_marketplace: 'DE'
})
// retrieve status of the fullfillmentInventory API for the German marketplace
const status = await MWS.fulfillmentInventory.getServiceStatus({ _marketplace: 'DE' })
Response received from MWS API
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
headers | Object |
Headers of the response received from the MWS API. Those are typical Headers as you would find in the Fetch API. |
status | number |
Response status code |
body | Object |
Parsed body from MWS API response |
Options for the new MWS client instanciation
Kind: global typedef
Properties
Name | Type | Default | Description |
---|---|---|---|
AWSAccessKeyId | string |
AWS access key ID | |
MWSAuthToken | string |
MWS authentication token | |
SellerId | string |
Seller ID | |
[SignatureVersion] | string |
'2' |
Signature version used for signing to request URL |
[SignatureMethod] | string |
'HmacSHA256' |
Signature method used for signing to request URL |
[userAgent] | string |
'kaskadi-mws-client/VERSION (Language=node.js)' |
User agent used when sending request |
[parserType] | string |
'xml' |
Parser used for the response received from MWS. Accepted values: 'xml' , 'text' |
MWS client
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
Section | Section |
MWS API section |
This client does not include throttling handling. The reason being that our internal implementation uses Lambda
functions which are not persistent and therefore instantiate a new client at each function call. This makes a throttling handled via client irrelevant since multiple clients may be instantiated in a short period of time (or even in parallel) to call the same endpoint which leads to a client throttling state not reflecting the actual throttling state of the MWS API.
We encourage you to implement your own throttling handling in your infrastructure so that it fits your implementation. You can refer to MWS API documentation for more information on this.
Reminder: response headers are exposed via the mws-client
return value so you may use those to handle an hourly capped endpoint.
This client uses signed requests to communicate with the MWS API. See docs here and there for more details.
All items listed here point to the MWS API docs
EasyShip
Feeds
Finances
FulfillmentInboundShipment
getInboundGuidanceForSKU
getInboundGuidanceForASIN
createInboundShipmentPlan
createInboundShipment
updateInboundShipment
getPreorderInfo
confirmPreorder
getPrepInstructionsForSKU
getPrepInstructionsForASIN
putTransportContent
estimateTransportRequest
getTransportContent
confirmTransportRequest
voidTransportRequest
getPackageLabels
getUniquePackageLabels
getPalletLabels
getBillOfLading
listInboundShipments
listInboundShipmentsByNextToken
listInboundShipmentItems
listInboundShipmentItemsByNextToken
getServiceStatus
FulfillmentInventory
FulfillmentOutboundShipment
MerchantFulfillment
Orders
Products
listMatchingProducts
getMatchingProduct
getMatchingProductForId
getCompetitivePricingForSKU
getCompetitivePricingForASIN
getLowestOfferListingsForSKU
getLowestOfferListingsForASIN
getLowestPricedOffersForSKU
getLowestPricedOffersForASIN
getMyFeesEstimate
getMyPriceForSKU
getMyPriceForASIN
getProductCategoriesForSKU
getProductCategoriesForASIN
getServiceStatus
Recommendations
Reports
Sellers
ShipmentInvoicing
Subscriptions