Boto 提供对大多数亚马逊 MWS 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:
### 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)
我调用这个方法如下:
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 访问亚马逊 MWS GetLowestPricedOffersForSKU?
最佳答案
不确定,我也不是 python 程序员,但在 PHP AmazonMWS API 中,我在下面使用 setMarketplaceId() 的地方使用了代码
$request = new MarketplaceWebServiceProducts_Model_GetLowestPricedOffersForSKURequest();
$request->setSellerId($this->seller_id);
$request->setMarketplaceId($this->marketplace_id);
$request->setItemCondition("New");
关于python - 亚马逊 MWS GetLowestPricedOffersForSKU 的 Boto 方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35108032/