Boto Method for Amazon MWS GetLowestPricedOffersForSKU

Boto provides access to most Amazon MWS APIs, but not to GetLowestPricedOffersForSKU. I tried to hack one, but it generates an Invalid MarketplaceId error.

Boto has code for a very similarly structured API - GetLowestOfferListingsForSKU:

 @requires(['MarketplaceId', 'SellerSKUList']) @structured_lists('SellerSKUList.SellerSKU') @api_action('Products', 20, 5, 'GetLowestOfferListingsForSKU') def get_lowest_offer_listings_for_sku(self, request, response, **kw): """Returns the lowest price offer listings for a specific product by item condition and SellerSKUs. """ return self._post_request(request, kw, response) 

So, I changed @api_action to change the MWS operation to GetLowestPricedOffersForSKU:

 ### MINE ### @requires(['MarketplaceId', 'SellerSKUList']) @structured_lists('SellerSKUList.SellerSKU') @api_action('Products', 20, 5, 'GetLowestPricedOffersForSKU') def get_lowest_priced_offers_for_sku(self, request, response, **kw): return self._post_request(request, kw, response) 

I call this method as follows:

 conn = connection.MWSConnection( aws_access_key_id=ACCESS_KEY, aws_secret_access_key=SECRET_KEY, Merchant=ACCOUNT_ID ) response = conn.get_lowest_priced_offers_for_sku( MarketplaceId=marketplace_id, SellerSKUList=sku_list, ItemCondition=condition ) 

When I call get_lowest_priced_offers_for_sku , I get an Invalid MarketplaceId error. If the only change I make is to call get_lowest_offer_listings_for_sku - leaving each variable the same - the code works and returns a valid response object. This works great:

 response = conn.get_lowest_offer_listings_for_sku( MarketplaceId=marketplace_id, SellerSKUList=sku_list, ItemCondition=condition ) 

What do I need to do to access Amazon MWS GetLowestPricedOffersForSKU via boto?

+5
source share
1 answer

Not sure, and I am also a python programmer, but in the AmazonMWS PHP API I use the code below, where I use setMarketplaceId ()

 $request = new MarketplaceWebServiceProducts_Model_GetLowestPricedOffersForSKURequest(); $request->setSellerId($this->seller_id); $request->setMarketplaceId($this->marketplace_id); $request->setItemCondition("New"); 
0
source

Source: https://habr.com/ru/post/1241908/


All Articles