MwsAdvanced
Static Method Summary
Static Public Methods | ||
public static |
async callEndpoint(args: ...*): * |
|
public static |
getLowestPricedOffersForAsin(params: ...*): * |
|
public static |
getLowestPricedOffersForSku(params: ...*): * |
|
public static |
getMarketplaces(params: ...*): * |
|
public static |
getMatchingProductForId(params: ...*): * |
|
public static |
getMyFeesEstimate(params: ...*): * |
|
public static |
getOrder(params: ...*): * |
|
public static |
getProductCategoriesForAsins(params: ...*): * |
|
public static |
getProductCategoriesForSkus(params: ...*): * |
|
public static |
getReport(params: ...*): * |
|
public static |
getReportList(params: ...*): * |
|
public static |
getReportListAll(params: ...*): * |
|
public static |
getReportListByNextToken(params: ...*): * |
|
public static |
getReportRequestList(params: ...*): * |
|
public static |
getReportScheduleList(params: ...*): * |
|
public static |
init(args: ...*): * |
|
public static |
listFinancialEvents(params: ...*): * |
|
public static |
listInventorySupply(params: ...*): * |
|
public static |
listMatchingProducts(params: ...*): * |
|
public static |
listOrderItems(params: ...*): * |
|
public static |
listOrders(params: ...*): * |
|
public static |
manageReportSchedule(params: ...*): * |
|
public static |
parseEndpoint(args: ...*): * |
|
public static |
requestAndDownloadReport(params: ...*): * |
|
public static |
requestReport(params: ...*): * |
|
public static |
updateReportAcknowledgements(params: ...*): * |
Constructor Summary
Public Constructor | ||
public |
constructor(rest: object): MWSAdvanced Create a new instance of MWSAdvanced, calling init(), and binding this instance of callEndpoint to this instance of MWSAdvanced. |
Member Summary
Public Members | ||
public |
mws: * |
Method Summary
Public Methods | ||
public |
async callEndpoint(name: string, callOptions: object, opt: object): any Call a known endpoint at MWS, returning the raw data from the function. |
|
public |
async doRequest(requestData: *, options: {}): * |
|
public |
getLowestPricedOffersForAsin(options: object): LowestPricedOffers getLowestPricedOffersForASIN |
|
public |
getLowestPricedOffersForSku(options: object): LowestPricedOffers getLowestPricedOffersForSKU |
|
public |
getMarketplaces(params: ...*): MarketDetail Call MWS ListMarketplaceParticipations, return parsed results |
|
public |
getMatchingProductForId(options: Object): Product[] Returns a list of products and their attributes, based on a list of ASIN, GCID, SellerSKU, UPC, EAN, ISBN, or JAN values |
|
public |
Get an estimate of fees for an item, based on listing and shipping prices. |
|
public |
Return orders by ID, i.e. |
|
public |
getProductCategoriesForAsins(parameters: object): productCategoryByAsin[] return product categories for multiple asins |
|
public |
getProductCategoriesForSkus(parameters: object): productCategoryBySku[] return product categories for multiple SKUs |
|
public |
Download a specific report identified by the ReportId and return it |
|
public |
getReportList(params: ...*): * TODO: write documentation for getReportList |
|
public |
getReportListAll(params: ...*): * TODO: write documentation for getReportListAll (or see comment on getReportListByNextToken) |
|
public |
getReportListByNextToken(params: ...*): * TODO: write documentation for getReportListByNextToken (or just roll getReportList and getReportListByNextToken into the same wrapper) (that wrapper might be getReportListAll, and just rename it) |
|
public |
getReportRequestList(options: object, ReportRequestIdList: string[], ReportTypeList: string[], ReportProcessingStatusList: string[], MaxCount: number, RequestedFromDate: Date, RequestedToDate: Date): GetReportRequestListResult[] Returns a list of report requests that you can use to get the ReportRequestId for a report After calling requestReport, you should call this function occasionally to see if/when the report has been processed. |
|
public |
getReportScheduleList(params: ...*): * TO DO: WRITE DOCUMENTATION |
|
public |
Initialize mws-advanced with your MWS access keys, merchantId, optionally authtoken, host, port If accessKeyId, secretAccessKey, and/or merchantId are not provided, they will be read from the environment variables MWS_ACESS_KEY, MWS_SECRET_ACCESS_KEY, and MWS_MERCHANT_ID respectively |
|
public |
listFinancialEvents(options: object): object |
|
public |
listInventorySupply(options: object): {nextToken: string, supplyList: object[]} Return information about the availability of a seller's FBA inventory |
|
public |
listMatchingProducts(options: object): Product[] Return a list of products and their attributes, based on a text query and contextId. |
|
public |
listOrderItems(AmazonOrderId: string): OrderItemList Returns order items based on the AmazonOrderId that you specify. |
|
public |
listOrders(options: object): object Return orders created or updated during a specific time frame see https://docs.developer.amazonservices.com/en_UK/orders-2013-09-01/Orders_ListOrders.html At least ONE of the search options (and maybe more depending on which ones you select) must be specified. |
|
public |
manageReportSchedule(params: ...*): * TO DO: WRITE DOCUMENTATION |
|
public |
parseEndpoint(outParser: *, inParser: *): * |
|
public |
requestAndDownloadReport(params: ...*): * TODO: Document requestAndDownloadReport |
|
public |
requestReport(options: object, MarketplaceId: string[]): ReportRequestInfo Request a report from MWS Many optional parameters may be required by MWS! Read ReportType for specifics! |
|
public |
updateReportAcknowledgements(params: ...*): * TO DO: WRITE DOCUMENTATION |
Static Public Methods
public static async callEndpoint(args: ...*): * source
Params:
Name | Type | Attribute | Description |
args | ...* |
Return:
* |
public static getLowestPricedOffersForAsin(params: ...*): * source
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public static getLowestPricedOffersForSku(params: ...*): * source
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public static getMarketplaces(params: ...*): * source
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public static getMatchingProductForId(params: ...*): * source
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public static getMyFeesEstimate(params: ...*): * source
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public static getOrder(params: ...*): * source
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public static getProductCategoriesForAsins(params: ...*): * source
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public static getProductCategoriesForSkus(params: ...*): * source
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public static getReport(params: ...*): * source
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public static getReportList(params: ...*): * source
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public static getReportListAll(params: ...*): * source
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public static getReportListByNextToken(params: ...*): * source
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public static getReportRequestList(params: ...*): * source
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public static getReportScheduleList(params: ...*): * source
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public static listFinancialEvents(params: ...*): * source
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public static listInventorySupply(params: ...*): * source
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public static listMatchingProducts(params: ...*): * source
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public static listOrderItems(params: ...*): * source
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public static listOrders(params: ...*): * source
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public static manageReportSchedule(params: ...*): * source
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public static parseEndpoint(args: ...*): * source
Params:
Name | Type | Attribute | Description |
args | ...* |
Return:
* |
public static requestAndDownloadReport(params: ...*): * source
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public static requestReport(params: ...*): * source
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public static updateReportAcknowledgements(params: ...*): * source
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
Public Constructors
public constructor(rest: object): MWSAdvanced source
Create a new instance of MWSAdvanced, calling init(), and binding this instance of callEndpoint to this instance of MWSAdvanced.
Params:
Name | Type | Attribute | Description |
rest | object | passed on to @see #init |
Return:
MWSAdvanced | new instance of MWSAdvanced |
Public Members
public mws: * source
Public Methods
public async callEndpoint(name: string, callOptions: object, opt: object): any source
Call a known endpoint at MWS, returning the raw data from the function. Parameters are transformed and validated according to the rules defined in lib/endpoints
Params:
Name | Type | Attribute | Description |
name | string | name of MWS API function to call |
|
callOptions | object |
|
named hash object of the parameters to pass to the API |
callOptions.feedContent | string |
|
if calling a function that submits a feed, supply the feed data here |
callOptions....rest | any |
|
other parameters will be passed through validation and into the API |
opt | object |
|
options for callEndpoint |
opt.noFlatten | boolean |
|
do not flatten results |
opt.returnRaw | boolean |
|
return only the raw data (may or may not be flattened) |
opt.saveRaw | string |
|
filename to save raw data to (may or may not be flattened) |
opt.saveParsed | string |
|
filename to save final parsed data to (not compatible with returnRaw, since parsing won't happen) |
opt.maxThrottleRetries | int |
|
maximum number of retries for throttling |
Return:
any | Results of the call to MWS |
public async doRequest(requestData: *, options: {}): * source
Params:
Name | Type | Attribute | Description |
requestData | * | ||
options | {} |
|
Return:
* |
public getLowestPricedOffersForAsin(options: object): LowestPricedOffers source
getLowestPricedOffersForASIN
Calls GetLowestPricedOffersForASIN, reformats results, and returns the data
Params:
Name | Type | Attribute | Description |
options | object | see https://docs.developer.amazonservices.com/en_UK/products/Products_GetLowestPricedOffersForASIN.html |
|
options.MarketplaceId | string | Marketplace ID to search |
|
options.ASIN | string | ASIN to search for |
|
options.ItemCondition | string | Listing Condition: New, Used, Collectible, Refurbished, Club |
public getLowestPricedOffersForSku(options: object): LowestPricedOffers source
getLowestPricedOffersForSKU
Calls GetLowestPricedOffersForSKU, reformats results, and returns the data
Params:
Name | Type | Attribute | Description |
options | object | see https://docs.developer.amazonservices.com/en_UK/products/Products_GetLowestPricedOffersForASIN.html |
|
options.MarketplaceId | string | Marketplace ID to search |
|
options.SellerSKU | string | SKU to search for |
|
options.ItemCondition | string | Listing Condition: New, Used, Collectible, Refurbished, Club |
public getMarketplaces(params: ...*): MarketDetail source
Call MWS ListMarketplaceParticipations, return parsed results
Params:
Name | Type | Attribute | Description |
params | ...* |
Example:
const marketplaces = (async () => await mws.getMarketplaces())();
(async function() {
const result = await mws.getMarketplaces();
console.log(result);
})();
public getMatchingProductForId(options: Object): Product[] source
Returns a list of products and their attributes, based on a list of ASIN, GCID, SellerSKU, UPC, EAN, ISBN, or JAN values
Params:
Name | Type | Attribute | Description |
options | Object | see https://docs.developer.amazonservices.com/en_UK/products/Products_GetMatchingProductForId.html |
|
options.marketplaceId | string | Identifier for marketplace (see getMarketplaces) |
|
options.idType | string | Type of lookup to perform: ASIN, GCID, SellerSKU, UPC, EAN, ISBN, JAN |
|
options.idList | string[] | List of codes to perform lookup on |
Return:
Product[] |
public getMyFeesEstimate(-: EstimateRequest[]): Object source
Get an estimate of fees for an item, based on listing and shipping prices.
Params:
Name | Type | Attribute | Description |
- | EstimateRequest[] | Array of EstimateRequest items to get fees for |
public getOrder(options: object, options: string[]): object source
Return orders by ID, i.e. Amazon Order ID. see https://docs.developer.amazonservices.com/en_UK/orders-2013-09-01/Orders_GetOrder.html
public getProductCategoriesForAsins(parameters: object): productCategoryByAsin[] source
return product categories for multiple asins
public getProductCategoriesForSkus(parameters: object): productCategoryBySku[] source
return product categories for multiple SKUs
public getReport(options: object): Array | object source
Download a specific report identified by the ReportId and return it
Return:
Array | object | Contents of the report to return (format may vary WIDELY between different reports generated, see ReportType) |
Example:
mws.getReport({ ReportId: '12660293969017879' });
public getReportList(params: ...*): * source
TODO: write documentation for getReportList
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public getReportListAll(params: ...*): * source
TODO: write documentation for getReportListAll (or see comment on getReportListByNextToken)
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public getReportListByNextToken(params: ...*): * source
TODO: write documentation for getReportListByNextToken (or just roll getReportList and getReportListByNextToken into the same wrapper) (that wrapper might be getReportListAll, and just rename it)
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public getReportRequestList(options: object, ReportRequestIdList: string[], ReportTypeList: string[], ReportProcessingStatusList: string[], MaxCount: number, RequestedFromDate: Date, RequestedToDate: Date): GetReportRequestListResult[] source
Returns a list of report requests that you can use to get the ReportRequestId for a report After calling requestReport, you should call this function occasionally to see if/when the report has been processed.
Params:
Name | Type | Attribute | Description |
options | object |
|
Options to pass to GetReportRequestList |
ReportRequestIdList | string[] |
|
List of report request IDs @see requestReport |
ReportTypeList | string[] |
|
List of Report Types @see REQUEST_REPORT_TYPES |
ReportProcessingStatusList | string[] |
|
List of Report Processing Status @see REPORT_PROCESSING_STATUS_TYPES |
MaxCount | number |
|
Maximum number of report requests to return, max is 100 |
RequestedFromDate | Date |
|
Oldest date to search for |
RequestedToDate | Date |
|
Newest date to search for |
public getReportScheduleList(params: ...*): * source
TO DO: WRITE DOCUMENTATION
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public init(config: object): mws-simple source
Initialize mws-advanced with your MWS access keys, merchantId, optionally authtoken, host, port If accessKeyId, secretAccessKey, and/or merchantId are not provided, they will be read from the environment variables MWS_ACESS_KEY, MWS_SECRET_ACCESS_KEY, and MWS_MERCHANT_ID respectively
Params:
Name | Type | Attribute | Description |
config | object | Contains your MWS Access Keys/Tokens and options to configure the API |
|
config.accessKeyId | string |
|
Your MWS Access Key |
config.secretAccessKey | string |
|
Your MWS Secret Access Key |
config.merchantId | string |
|
Your MWS Merchant ID |
config.authToken | string |
|
If making a call for a third party account, the Auth Token provided for the third party account |
config.region | string |
|
One of the Amazon regions as specified in https://docs.developer.amazonservices.com/en_US/dev_guide/DG_Endpoints.html |
config.host | string |
|
Set MWS host server name, see https://docs.developer.amazonservices.com/en_US/dev_guide/DG_Endpoints.html |
config.port | number |
|
Set MWS host port |
Return:
mws-simple | The mws-simple instance used to communicate with the API |
Example:
const mws = MWS.init({ region: 'NA', accessKeyId: '1234', secretAccessKey: '2345', merchantId: '1234567890' });
const mws = MWS.init({ region: 'EU', accessKeyId, ... });
const mws = MWS.init({ authToken: 'qwerty', accessKeyId, ...});
const mws = MWS.init({ host: 'alternate-mws-server.com', accessKeyId, ... });
public listFinancialEvents(options: object): object source
Params:
Name | Type | Attribute | Description |
options | object | ||
options.maxResultsPerPage | number | Maximum number of results to return (1 <=> 100) |
|
options.amazonOrderId | string | An order number to search for |
|
options.financialEventGroupId | string | Type of Financial Event to search for |
|
options.postedAfter | Date | When to search for events after |
|
options.postedBefore | Date | When to search for events prior to |
public listInventorySupply(options: object): {nextToken: string, supplyList: object[]} source
Return information about the availability of a seller's FBA inventory
Params:
Name | Type | Attribute | Description |
options | object | ||
options.sellerSkus | String[] | A list of SKUs for items to get inventory info for |
|
options.queryStartDateTime | Date | Date to begin searching at |
|
options.responseGroup | string | 'Basic' = Do not include SupplyDetail, 'Detailed' = Do |
|
options.marketplaceId | string | Marketplace ID to search |
public listMatchingProducts(options: object): Product[] source
Return a list of products and their attributes, based on a text query and contextId.
Params:
Name | Type | Attribute | Description |
options | object | ||
options.marketplaceId | string | marketplace identifier to search |
|
options.query | string | a search string "with the same support as that provided on Amazon marketplace websites" |
|
options.queryContextId | string |
|
context in which to limit search. Not specified will mean "search everywhere". See https://docs.developer.amazonservices.com/en_UK/products/Products_QueryContextIDs.html |
Return:
Product[] | Array of product information |
public listOrderItems(AmazonOrderId: string): OrderItemList source
Returns order items based on the AmazonOrderId that you specify.
If you've pulled a list of orders using @see ListOrders, or have order identifiers stored in some other fashion, then to find out what items are actually on the orders, you will need to call ListOrderItems to obtain details about the items that were ordered. The ListOrders call does not give you any information about the items, except how many of them have shipped or not shipped.
If an Order is in the Pending state, ListOrderItems will not return any pricing or promotion information. Once an order has left the Pending state, the following items will be returned:
ItemTax, GiftWrapPrice, ItemPrice, PromotionDiscount, GiftWrapTax, ShippingTax, ShippingPrice, ShippingDiscount
Params:
Name | Type | Attribute | Description |
AmazonOrderId | string | 3-7-7 Amazon Order ID formatted string |
public listOrders(options: object): object source
Return orders created or updated during a specific time frame see https://docs.developer.amazonservices.com/en_UK/orders-2013-09-01/Orders_ListOrders.html At least ONE of the search options (and maybe more depending on which ones you select) must be specified. Error messages may or may not return information on what parameters you are missing. If you are having trouble, see the official parameter documentation above.
Params:
Name | Type | Attribute | Description |
options | object | ||
options.MarketplaceId | string[] | Array of Marketplace IDs to search @see MWS_MARKETPLACES |
|
options.CreatedAfter | Date |
|
Select orders created at or after the given Date |
options.CreatedBefore | Date |
|
Select orders created at or before the given Date |
options.LastUpdatedAfter | Date |
|
Select orders updated at or after the given Date |
options.LastUpdatedBefore | Date |
|
Select orders updated at or before the given Date |
options.OrderStatus | string |
|
OrderStatus, see MWS doc page |
options.FulfillmentChannel | string |
|
AFN for Amazon fulfillment, MFN for merchant |
options.PaymentMethod | string |
|
All, COD, CVS, Other |
options.BuyerEmail | string |
|
Search for orders with given Email address |
options.SellerOrderId | string |
|
Specified seller order ID |
options.MaxResultsPerPage | string |
|
Max number of results to return, 1 <=> 100 |
options.TFMShipmentStatus | string |
|
See MWS doc page |
public manageReportSchedule(params: ...*): * source
TO DO: WRITE DOCUMENTATION
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public parseEndpoint(outParser: *, inParser: *): * source
Params:
Name | Type | Attribute | Description |
outParser | * | ||
inParser | * |
|
Return:
* |
public requestAndDownloadReport(params: ...*): * source
TODO: Document requestAndDownloadReport
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |
public requestReport(options: object, MarketplaceId: string[]): ReportRequestInfo source
Request a report from MWS Many optional parameters may be required by MWS! Read ReportType for specifics!
Params:
Name | Type | Attribute | Description |
options | object | ||
options.ReportType | string | Type of Report to Request @see REQUEST_REPORT_TYPES |
|
options.StartDate | Date |
|
Date to start report |
options.EndDate | Date |
|
Date to end report at |
options.ReportOptions | object |
|
Reports may have additional options available. Please see the ReportType official docs |
MarketplaceId | string[] |
|
Array of marketplace IDs to generate reports covering |
public updateReportAcknowledgements(params: ...*): * source
TO DO: WRITE DOCUMENTATION
Params:
Name | Type | Attribute | Description |
params | ...* |
Return:
* |