![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
mws-sdk-async
Advanced tools
A simple class based approach to work with Amazon's Merchant Web Services APIs.
This package is in alpha phase and does not have full support for all MWS APIs. Use at your own risk.
The MWS library is notoriously difficult to work with especically with a language like javascript, that doesn't natively support xml.
This library is the product of working for an ecommerce company that sells on Amazon as a key part of the business.
You can get access to each available service by destructuring it off of the main body.
const { Orders, Products } = require('mws-sdk-async');
Each API is a a constructor that take accepts a configuration object that follows this format.
const config = {
mwsHost, // -- optional, defaults to mws.amazonservices.com
marketplaceId, // -- required, used as the default in each call unless specifically provided
sellerId, // -- required
authToken, // -- required
accessKeyId, // -- required
secretKey // -- required
};
const api = new Orders(config);
Alternately, you may use environment variabes to set up your configuration. The constructor will look for the following environment variables.
process.env.MWS_HOST // defaults to mws.amazonservices.com
process.env.MWS_MARKETPLACE_ID // required
process.env.MWS_SELLER_ID // required
process.env.MWS_AUTH_TOKEN // required
process.env.MWS_ACCESS_KEY // required
process.env.MWS_SECRET_KEY // required
Base documentation http://docs.developer.amazonservices.com/en_US/orders-2013-09-01/index.html
Throttling: Max request quota: 6, restore rate: 1 request per minute
let orders = await mws.listOrders({
CreatedAfter, // optional (see note below), ISO formatted date
CreatedBefore, // optional (see note below), ISO formatted date
LastUpdatedAfter, // optional (see note below), ISO formatted date
LastUpdatedBefore, // optional (see note below), ISO formatted date
OrderStatus, // optional, *array* containing 1 or more order status
MarketplaceId, // optional, an *array* of marketplaces -- defaults to the one you specified in your configuration
FulfillmentChannel, // optional, an *array* containing one or both of: AFN (fulfilled by amazon) or MFN (fulfilled by merchant)
PaymentMethod, // optional
BuyerEmail, // optional
SellerOrderId, // optional
MaxResultsPerPage, // optional
TFMShipmentStatus // optional, only available in china
});
Note on requests:
Dates: You must either specific a CreatedAfter and CreatedBefore timestamp or a LastUpdatedAfter/LastUpdatedBefore timestamp, but not both.
ISO Format: ISO Format in MWS
Order Status enumeration:
Response
{
NextToken,
Orders: [
{
LatestShipDate,
OrderType,
PurchaseDate,
AmazonOrderId,
BuyerEmail,
IsReplacementOrder,
LastUpdateDate,
NumberOfItemsShipped,
ShipServiceLevel,
OrderStatus,
SalesChannel,
ShippedByAmazonTFM,
IsBusinessOrder,
LatestDeliveryDate,
NumberOfItemsUnshipped,
PaymentMethodDetails: { PaymentMethodDetail }
BuyerName,
EarliestDeliveryDate,
OrderTotal: {
CurrencyCode,
Amount
},
IsPremiumOrder,
EarliestShipDate,
MarketplaceId,
FulfillmentChannel,
PaymentMethod,
ShippingAddress: {
City,
AddressType,
PostalCode,
StateOrRegion,
Phone,
CountryCode,
Name,
AddressLine1,
AddressLine2
},
IsPrime,
ShipmentServiceLevelCategory,
SellerOrderId
},
...
]
}
Throttling: Max request quota: 6, restore rate: 1 request per minute -- Shared with ListOrders
let orders = await mws.listOrdersByNextToken(NextToken);
Response: Same as ListOrders
Throttling: Max request quote: 30, restore rate: 2 requests per second
let items = await mws.listOrderItems(AmazonOrderId);
Response
{
AmazonOrderId,
OrderItems: [
{
QuantityOrdered,
Title,
ShippingTax: {
CurrencyCode,
Amount
},
PromotionDiscount: {
CurrencyCode,
Amount
},
ConditionId,
IsGift,
ASIN,
SellerSKU,
OrderItemId,
ProductInfo: {
CurrencyCode,
Amount
},
GiftWrapTax: {
CurrencyCode,
Amount
},
QuantityShipped,
ShippingPrice,
GiftWrapPrice,
ConditionSubtypeId,
ItemPrice: {
CurrencyCode,
Amount
},
ItemTax: {
CurrencyCode,
Amount
},
ShippingDiscount: {
CurrencyCode,
Amount
}
}
]
}
Base Products Documentation: https://developer.amazonservices.com/gp/mws/api.html/146-8039497-2146729?ie=UTF8&group=products§ion=products&version=latest
Usage
let response = await mws.getServiceStatus();
Response
{
Status: 'GREEN', // or 'RED'
Timestamp
}
Usage
getCompetitivePriceForSKUs accepts an array of Amazon Seller SKUs present within your amazon store.
** Note: The sku list must contain at least 1 sku and can not contain more than 20 skus.
let response = await MWS.getCompetitivePriceForSKUs([ 'sku1', 'sku2', ... ]);
[
{
SellerSKU,
Product: {
Identifiers: {
MarketplaceASIN: {
MarketplaceId,
ASIN
}
SKUIdentifier: {
MarketplaceId,
SellerId,
SellerSKU
}
},
CompetitivePricing: [
{
CompetitivePriceId,
Condition,
Subcondition,
LandedPrice: {
CurrencyCode,
Amount
},
ListingPrice: {
CurrencyCode,
Amount
},
Shipping: {
CurrencyCode,
Amount
}
}
]
}
}
]
FAQs
A simple class based approach to work with Amazon's Merchant Web Services APIs.
The npm package mws-sdk-async receives a total of 0 weekly downloads. As such, mws-sdk-async popularity was classified as not popular.
We found that mws-sdk-async demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.