亚马逊MWS GetLowestPricedOffersForSKU的Boto方法

2024-10-03 13:30:17 发布

您现在位置:Python中文网/ 问答频道 /正文

Boto提供了对大多数amazonmws api的访问,但对GetLowestPricedOffersForSKU却没有。我试图破解一个,但它产生了一个Invalid MarketplaceId错误。在

Boto有一个结构非常相似的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)

所以我修改了@api_action,将MWS操作更改为GetLowestPricedOffersForSKU:

^{pr2}$

我将此方法称为:

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
)

当我调用get_lowest_priced_offers_for_sku时,我得到一个Invalid MarketplaceId错误。如果我所做的唯一更改是调用get_lowest_offer_listings_for_sku——让每个变量都相同——那么代码工程会找到并返回一个有效的响应对象。这很好用:

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

要通过boto访问Amazon MWS GetLowestPricedOffersForSKU需要做什么?在


Tags: apiidforgetresponserequestconncondition
2条回答

我不确定,我也不是python程序员,但在PHP amazonws-API中,我使用下面的代码使用setMarketplaceId()

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

正如您从文档http://docs.pythonboto.org/en/latest/ref/mws.html中看到的那样,Boto2不支持GetLowestPricedOffersForSKU

相关问题 更多 >