-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Product Feed #60
Comments
Waiting on #54. For now you could generate your own XML and use SubmitFeed. |
Okay, any ETA? And thanks for the second part, that'll do for now. |
You would have to ask @dciccale :) |
Okay, thanks. Should I close this issue? |
Made it work with that, if anyone is interested. let sku = req.query.sku;
let price = req.query.p;
if(!price || !sku)
res.send(JSON.stringify('error'))
let obj = {
"@": {
"xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
"xsi:noNamespaceSchemaLocation": "amzn-envelope.xsd"
},
Header: {
DocumentVersion: '1.01',
MerchantIdentifier: 'XXXXXXXXXX'
},
MessageType: 'Price',
Message: [{
MessageID: "1",
Price: {
SKU: sku,
StandardPrice: {
"@": {
currency: "EUR"
},
"#": price
}
}
}]
};
let options = {
declaration: {
encoding: 'iso-8859-1'
},
format: {
doubleQuotes: true
}
};
let xml = js2xml.parse('AmazonEnvelope', obj, options)
.replace(/>\s+/g, '>'); // to minify it
mws.Feeds.SubmitFeed({
FeedContent: xml,
FeedType: '_POST_PRODUCT_PRICING_DATA_'
})
.then((response) => {
console.log(response)
res.send(JSON.stringify({ sku: sku, price: price, response: response, xml: xml }, null, 2))
})
.catch((e) => {
console.log('error', e);
res.send(JSON.stringify({ sku: sku, price: price, error: e, xml: xml }, null, 2))
}) And to get the feed state mws.Feeds.GetFeedSubmissionResult({
FeedSubmissionId: "XXXXXXXX", // can be found in response.result.FeedSubmissionId
})
.then((response) => {
console.log(response)
res.send(JSON.stringify(response, null, 2))
})
.catch((e) => {
console.log('error', e);
res.send(JSON.stringify(e, null, 2))
}) Maybe that can help someone. Thanks for your help ! |
Hey, thanks for the heads up! I'll look into upgrading my code with the new mws-api version sometime this months hopefully. Good job :) |
@1Mpuls3 Product feed is still not implemented. What I wanted to say that now it can be implemented (: |
Oh right. I read too fast my bad. I guess it would be better, it would make my app definitely cleaner and maybe help other people using your implementation of the mws-api. I'll have to improve my app someday anyway, since I learnt a lot more about javascript and nodejs these last few months. But it's not urgent, or a need at this time. |
Hi,
any news on the support of product feed?
I'm mainly interested in POST_PRODUCT_PRICING_DATA and POST_INVENTORY_AVAILABILITY_DATA.
Regards,
The text was updated successfully, but these errors were encountered: