Function
| Static Public Summary | ||
| 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 getLowestPricedOffersForASIN(options: object): LowestPricedOffers getLowestPricedOffersForASIN |
|
| public |
async getMarketplaces(): MarketDetail Call MWS ListMarketplaceParticipations, return parsed results |
|
| public |
async 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 |
Returns the contents of a report |
|
| public |
async getReportList(options: {}): * TODO: write documentation for getReportList |
|
| public |
async getReportListAll(options: {}): * TODO: write documentation for getReportListAll (or see comment on getReportListByNextToken) |
|
| public |
async getReportListByNextToken(options: *): * 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 |
async 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 |
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 |
async listFinancialEvents(options: object): object |
|
| public |
async listInventorySupply(options: object): {nextToken: string, supplyList: object[]} Return information about the availability of a seller's FBA inventory |
|
| public |
async listOrderItems(AmazonOrderId: string): OrderItemList Returns order items based on the AmazonOrderId that you specify. |
|
| public |
async 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 |
async requestAndDownloadReport(ReportType: *, file: *, reportParams: {}): * TODO: Document requestAndDownloadReport |
|
| public |
async requestReport(options: object, MarketplaceId: string[]): ReportRequestInfo Request a report from MWS Many optional parameters may be required by MWS! Read ReportType for specifics! |
|
Static Public
public async callEndpoint(name: string, callOptions: object, opt: object): any source
import {callEndpoint} from 'mws-advanced/lib/callEndpoint.js'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 |
| 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) |
Return:
| any | Results of the call to MWS |
public async getLowestPricedOffersForASIN(options: object): LowestPricedOffers source
import {getLowestPricedOffersForASIN} from 'mws-advanced/lib/get-lowest-priced-offers.js'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 async getMarketplaces(): MarketDetail source
import {getMarketplaces} from 'mws-advanced/lib/get-marketplaces.js'Call MWS ListMarketplaceParticipations, return parsed results
Example:
const marketplaces = (async () => await mws.getMarketplaces())();
(async function() {
const result = await mws.getMarketplaces();
console.log(result);
})();
public async getMatchingProductForId(options: Object): Product[] source
import {getMatchingProductForId} from 'mws-advanced/lib/get-matching-product.js'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 async getReport(options: object): Array | object source
import {getReport} from 'mws-advanced/lib/reports.js'Returns the contents of a report
Params:
| Name | Type | Attribute | Description |
| options | object | Options to pass to GetReport |
|
| options.ReportId | string | Report number from @see GetReportList or GeneratedReportId from @see GetReportRequestListResult |
Return:
| Array | object | Contents of the report to return (format may vary WIDELY between different reports generated, see ReportType) |
public async getReportList(options: {}): * source
import {getReportList} from 'mws-advanced/lib/reports.js'TODO: write documentation for getReportList
Params:
| Name | Type | Attribute | Description |
| options | {} |
|
Return:
| * |
public async getReportListAll(options: {}): * source
import {getReportListAll} from 'mws-advanced/lib/reports.js'TODO: write documentation for getReportListAll (or see comment on getReportListByNextToken)
Params:
| Name | Type | Attribute | Description |
| options | {} |
|
Return:
| * |
public async getReportListByNextToken(options: *): * source
import {getReportListByNextToken} from 'mws-advanced/lib/reports.js'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 |
| options | * |
Return:
| * |
public async getReportRequestList(options: object, ReportRequestIdList: string[], ReportTypeList: string[], ReportProcessingStatusList: string[], MaxCount: number, RequestedFromDate: Date, RequestedToDate: Date): GetReportRequestListResult[] source
import {getReportRequestList} from 'mws-advanced/lib/reports.js'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 init(config: object): mws-simple source
import {init} from 'mws-advanced/lib/callEndpoint.js'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 async listFinancialEvents(options: object): object source
import {listFinancialEvents} from 'mws-advanced/lib/list-financial-events.js'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 async listInventorySupply(options: object): {nextToken: string, supplyList: object[]} source
import {listInventorySupply} from 'mws-advanced/lib/list-inventory-supply.js'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 async listOrderItems(AmazonOrderId: string): OrderItemList source
import {listOrderItems} from 'mws-advanced/lib/list-order-items.js'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 async listOrders(options: object): object source
import {listOrders} from 'mws-advanced/lib/list-orders.js'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 async requestAndDownloadReport(ReportType: *, file: *, reportParams: {}): * source
import {requestAndDownloadReport} from 'mws-advanced/lib/reports.js'TODO: Document requestAndDownloadReport
Params:
| Name | Type | Attribute | Description |
| ReportType | * | ||
| file | * | ||
| reportParams | {} |
|
Return:
| * |
public async requestReport(options: object, MarketplaceId: string[]): ReportRequestInfo source
import {requestReport} from 'mws-advanced/lib/reports.js'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 |