Boto method for Amazon MWS GetLowestPricedOffersForSKU
Asked Answered
L

2

6

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?

Lewallen answered 30/1, 2016 at 22:33 Comment(0)
V
0

Not sure and neither I am python programmer, but In PHP AmazonMWS API I use code below where I use setMarketplaceId()

$request = new MarketplaceWebServiceProducts_Model_GetLowestPricedOffersForSKURequest();
$request->setSellerId($this->seller_id);
$request->setMarketplaceId($this->marketplace_id);
$request->setItemCondition("New");
Valiant answered 3/2, 2016 at 11:49 Comment(0)
T
0

Boto2 doesnt support GetLowestPricedOffersForSKU as you can see from the documentation http://docs.pythonboto.org/en/latest/ref/mws.html

Turnstone answered 2/6, 2018 at 12:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.