我正在从meteor运行此代码。我现在打电话给
import { mws } from 'mws-nodejs';
import Future from 'fibers/future';
const getASINDetails = (asin) => {
let future = new Future();
console.log("getting ASIN.....", asin);
mws.products.GetMatchingProduct(
{
"SellerId" : sellerID,
"AWSAccessKeyId" : AWSAccessKeyId,
"SecretKey" : SecretKey,
"MWSAuthorizationToken" : MWSAuthToken,
"AmazonServicesURL": "mws.amazonservices.com"
}, {
MarketplaceId: MarketplaceId,
ASINList: {
'ASINList.ASIN.1': asin
}
}, true, function (err, data) {
console.log("do something with the data");
}
);
return future.wait();
};
如果我想从mws调用SubmitFeed()。
我无法弄清楚在amazonenvelope中执行函数传递的正确语法:
let sXML = `<?xml version="1.0" ?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amznenvelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>MERCHANT_IDENTIFIER</MerchantIdentifier>
</Header>
<MessageType>Product</MessageType>
<PurgeAndReplace>false</PurgeAndReplace>
<Message>
<MessageID>1</MessageID>
<OperationType>PartialUpdate</OperationType>
<Product>
<SKU>UNIQUE-TO-ME-1234</SKU>
<StandardProductID>
<Type>ASIN</Type>
<Value>B000A0S46M</Value>
</StandardProductID>
<Condition>
<ConditionType>New</ConditionType>
</Condition>
</Product>
</Message>
</AmazonEnvelope>`;
我在想代码应该是这样的? 但不知道,因为我无法弄清楚他们的API ...
如何调用SubmitFeed()并传递XML?
另外,我如何知道是否可以从mws.product
获取提交供稿提前致谢。