Open fr3shn3ss opened 4 years ago
@bhushankumarl any ideas? Thanks.
@fr3shn3ss Can you send me an actual error?
@bhushankumarl thanks. I just tested again. 4 asins work fine, but 5 throws this error
no proxy set (HTTP_PROXY) { Version: '2011-10-01', Action: 'GetMyFeesEstimate', SellerId: 'XXXXXXXXXXXXXXXXXXXXXXX', MWSAuthToken: 'XXXXXXXXXXXXXXXXXXXXXXX', 'FeesEstimateRequestList.FeesEstimateRequest.1.MarketplaceId': 'ATVPDKIKX0DER', 'FeesEstimateRequestList.FeesEstimateRequest.1.IdType': 'ASIN', 'FeesEstimateRequestList.FeesEstimateRequest.1.IdValue': '0735201439', 'FeesEstimateRequestList.FeesEstimateRequest.1.IsAmazonFulfilled': 'true', 'FeesEstimateRequestList.FeesEstimateRequest.1.Identifier': 'Hello', 'FeesEstimateRequestList.FeesEstimateRequest.1.PriceToEstimateFees.ListingPrice.CurrencyCode': 'USD', 'FeesEstimateRequestList.FeesEstimateRequest.1.PriceToEstimateFees.ListingPrice.Amount': '10', 'FeesEstimateRequestList.FeesEstimateRequest.1.PriceToEstimateFees.Shipping.CurrencyCode': 'USD', 'FeesEstimateRequestList.FeesEstimateRequest.1.PriceToEstimateFees.Shipping.Amount': '0', 'FeesEstimateRequestList.FeesEstimateRequest.1.PriceToEstimateFees.Points.PointsNumber': '0', 'FeesEstimateRequestList.FeesEstimateRequest.2.MarketplaceId': 'ATVPDKIKX0DER', 'FeesEstimateRequestList.FeesEstimateRequest.2.IdType': 'ASIN', 'FeesEstimateRequestList.FeesEstimateRequest.2.IdValue': '0571198775', 'FeesEstimateRequestList.FeesEstimateRequest.2.IsAmazonFulfilled': 'true', 'FeesEstimateRequestList.FeesEstimateRequest.2.Identifier': 'Hello', 'FeesEstimateRequestList.FeesEstimateRequest.2.PriceToEstimateFees.ListingPrice.CurrencyCode': 'USD', 'FeesEstimateRequestList.FeesEstimateRequest.2.PriceToEstimateFees.ListingPrice.Amount': '10', 'FeesEstimateRequestList.FeesEstimateRequest.2.PriceToEstimateFees.Shipping.CurrencyCode': 'USD', 'FeesEstimateRequestList.FeesEstimateRequest.2.PriceToEstimateFees.Shipping.Amount': '0', 'FeesEstimateRequestList.FeesEstimateRequest.2.PriceToEstimateFees.Points.PointsNumber': '0', 'FeesEstimateRequestList.FeesEstimateRequest.3.MarketplaceId': 'ATVPDKIKX0DER', 'FeesEstimateRequestList.FeesEstimateRequest.3.IdType': 'ASIN', 'FeesEstimateRequestList.FeesEstimateRequest.3.IdValue': '8186685596', 'FeesEstimateRequestList.FeesEstimateRequest.3.IsAmazonFulfilled': 'true', 'FeesEstimateRequestList.FeesEstimateRequest.3.Identifier': 'Hello', 'FeesEstimateRequestList.FeesEstimateRequest.3.PriceToEstimateFees.ListingPrice.CurrencyCode': 'USD', 'FeesEstimateRequestList.FeesEstimateRequest.3.PriceToEstimateFees.ListingPrice.Amount': '10', 'FeesEstimateRequestList.FeesEstimateRequest.3.PriceToEstimateFees.Shipping.CurrencyCode': 'USD', 'FeesEstimateRequestList.FeesEstimateRequest.3.PriceToEstimateFees.Shipping.Amount': '0', 'FeesEstimateRequestList.FeesEstimateRequest.3.PriceToEstimateFees.Points.PointsNumber': '0', 'FeesEstimateRequestList.FeesEstimateRequest.4.MarketplaceId': 'ATVPDKIKX0DER', 'FeesEstimateRequestList.FeesEstimateRequest.4.IdType': 'ASIN', 'FeesEstimateRequestList.FeesEstimateRequest.4.IdValue': '1401309747', 'FeesEstimateRequestList.FeesEstimateRequest.4.IsAmazonFulfilled': 'true', 'FeesEstimateRequestList.FeesEstimateRequest.4.Identifier': 'Hello', 'FeesEstimateRequestList.FeesEstimateRequest.4.PriceToEstimateFees.ListingPrice.CurrencyCode': 'USD', 'FeesEstimateRequestList.FeesEstimateRequest.4.PriceToEstimateFees.ListingPrice.Amount': '10', 'FeesEstimateRequestList.FeesEstimateRequest.4.PriceToEstimateFees.Shipping.CurrencyCode': 'USD', 'FeesEstimateRequestList.FeesEstimateRequest.4.PriceToEstimateFees.Shipping.Amount': '0', 'FeesEstimateRequestList.FeesEstimateRequest.4.PriceToEstimateFees.Points.PointsNumber': '0', 'FeesEstimateRequestList.FeesEstimateRequest.5.MarketplaceId': 'ATVPDKIKX0DER', 'FeesEstimateRequestList.FeesEstimateRequest.5.IdType': 'ASIN', 'FeesEstimateRequestList.FeesEstimateRequest.5.IdValue': '0974721719', 'FeesEstimateRequestList.FeesEstimateRequest.5.IsAmazonFulfilled': 'true', 'FeesEstimateRequestList.FeesEstimateRequest.5.Identifier': 'Hello', 'FeesEstimateRequestList.FeesEstimateRequest.5.PriceToEstimateFees.ListingPrice.CurrencyCode': 'USD', 'FeesEstimateRequestList.FeesEstimateRequest.5.PriceToEstimateFees.ListingPrice.Amount': '10', 'FeesEstimateRequestList.FeesEstimateRequest.5.PriceToEstimateFees.Shipping.CurrencyCode': 'USD', 'FeesEstimateRequestList.FeesEstimateRequest.5.PriceToEstimateFees.Shipping.Amount': '0', 'FeesEstimateRequestList.FeesEstimateRequest.5.PriceToEstimateFees.Points.PointsNumber': '0' } { [Error] Type: 'AmazonMwsAPIError', Code: 'GenericError', Message: 'Invalid XML received from the AmazonMws API', StatusCode: 400 }
@fr3shn3ss Thank you for sharing. I will be check soon.
@bhushankumarl the issue is also reported here . https://github.com/bhushankumarl/amazon-mws/issues/74#issuecomment-487236200
Thanks :)
Did you ever figure this out? I have the same issue. I can only get up to 4 ASINs using
Last time I checked, that was still an issue. My app is now make one call for each ASIN so I don't need it anymore. I think you need to either fix it yourself or switch to a different library
I too have issues even with 1 ASIN, for me the error is ""Error occurred from AmazonMws API", i checked everything looks good and test the same data on scratchpad as well.
Changed the file /amazon-mws/lib/resources/FulfillmentInboundShipment.js from this :
'use strict';
var AmazonMwsResource = require('../AmazonMwsResource');
var amazonMwsMethod = AmazonMwsResource.method;
module.exports = AmazonMwsResource.extend({
path: 'FulfillmentInboundShipment',
search: amazonMwsMethod({
method: 'GET'
})
});
To This:
'use strict';
var AmazonMwsResource = require('../AmazonMwsResource');
var amazonMwsMethod = AmazonMwsResource.method;
module.exports = AmazonMwsResource.extend({
path: 'FulfillmentInboundShipment',
search: amazonMwsMethod({
useBody: false,
method: 'POST'
}),
searchFor: amazonMwsMethod({
useBody: true,
method: 'POST'
})
});
used searchFor to create inbound shipment plan and it worked.
The general problem is this lib. used GET method for some some APIs that support POST method and when the request data goes beyond the URL size limit supported by Amazon, the API starts responding with 400 - bad request.
Hope this helps someone.
It won't work for >4 ASINs. <4 works great though. Scratchpad works for >4.
Here is my code: //asinList is an array of ASINs var GetMyFeesEstimate = async function (asinList) { var obj = { 'Version': '2011-10-01', 'Action': 'GetMyFeesEstimate', 'SellerId': SellerId, 'MWSAuthToken': MWSAuthToken, 'FeesEstimateRequestList.FeesEstimateRequest.1.MarketplaceId': 'ATVPDKIKX0DER', 'FeesEstimateRequestList.FeesEstimateRequest.1.IdType': 'ASIN' }
};