Boto provides access to most Amazon MWS APIs, but not for 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 modified the @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 every variable identical -- the code works find and return a valid response object. This works just fine:
response = conn.get_lowest_offer_listings_for_sku(
MarketplaceId=marketplace_id, SellerSKUList=sku_list, ItemCondition=condition
)
What do I need to do to access the Amazon MWS GetLowestPricedOffersForSKU via boto?