【问题标题】:Boto method for Amazon MWS GetLowestPricedOffersForSKU亚马逊 MWS GetLowestPricedOffersForSKU 的 Boto 方法
【发布时间】:2016-05-08 13:49:31
【问题描述】:

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 Operation改为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 amazon-web-services boto amazon-mws


    【解决方案1】:

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

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

    【讨论】:

      【解决方案2】:

      Boto2 不支持GetLowestPricedOffersForSKU,您可以从文档http://docs.pythonboto.org/en/latest/ref/mws.html 中看到

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-11-13
        • 2012-02-12
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多