let mws = require(‘mws-simple’)({
accessKeyId: ourAmazonController.awsAccessKeyId,
secretAccessKey: ourAmazonController.secret,
merchantId: ourAmazonController.sellerId
});
var ourFeedContent = `
<?xml version="1.0" ?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>M_SELLER_354577</MerchantIdentifier>
</Header>
<MessageType>Product</MessageType>
<PurgeAndReplace>true</PurgeAndReplace>
<Message>
<MessageID>1</MessageID>
<OperationType>Update</OperationType>
<Product>
<SKU>JDLtestJDL</SKU>
<ProductTaxCode>A_GEN_TAX</ProductTaxCode>
<LaunchDate>2025-07-26T00:00:01</LaunchDate>
<DescriptionData>
<Title>Lyric 500 tc Queen Flat Sheet, Ivory</Title>
<Brand>Test Brand</Brand>
<Description>
This is a test product and is not for purchase.
</Description>
<BulletPoint>test bullet 1</BulletPoint>
<BulletPoint>test bullet 2</BulletPoint>
<Manufacturer>test manufacturer</Manufacturer>
<SearchTerms>test search term</SearchTerms>
<ItemType>test item type</ItemType>
<IsGiftWrapAvailable>false</IsGiftWrapAvailable>
<IsGiftMessageAvailable>false</IsGiftMessageAvailable>
</DescriptionData>
<ProductData>
<Home>
<Parentage>variation-parent</Parentage>
<VariationData>
<VariationTheme>Size-Color</VariationTheme>
</VariationData>
<Material>cotton</Material>
<ThreadCount>500</ThreadCount>
</Home>
</ProductData>
</Product>
</Message>
<Message>
</AmazonEnvelope>
`
;
let submitFeed = {
feedContent: ourFeedContent,
query: {
Action: 'SubmitFeed',
FeedType: '_POST_PRODUCT_DATA_',
'MarketplaceIdList.Id.1': ourAmazonController.marketplaceId,
Version: '2009-01-01'
}
};
mws.request(submitFeed, function(e, result) {
});
Future = Npm.require('fibers/future');
var myFuture = new Future();
mws.request(submitFeed, function(error, results) {
if ( error ) {
myFuture.return(error);
} else {
myFuture.return(results);
}
//consoleLogObject("results", results);
});
return myFuture.wait(); // wait for the mws http call to return