我试过在ebay论坛上问这个,但我还没有回复。出于某种原因,我无法再使用API列出产品。
它过去在工作。我仍然发送以下标题:
$headers = array(
'X-EBAY-API-SITEID:'.$this->siteId,
'X-EBAY-API-COMPATIBILITY-LEVEL:'.$this->version,
'X-EBAY-API-CALL-NAME:'.$action,
);
当我添加'action'是'AddItem'时,版本设置为'989'。我发送的示例请求如下所示:
<?xml version="1.0" encoding="utf-8"?>
<AddItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken>[[removed]]</eBayAuthToken>
</RequesterCredentials>
<ErrorLanguage>en_US</ErrorLanguage>
<WarningLevel>High</WarningLevel>
<Item>
<Title>dewalt battery test</Title>
<Description>this is a test battery</Description>
<PrimaryCategory>
<CategoryID>27029</CategoryID>
</PrimaryCategory>
<StartPrice>65</StartPrice>
<Country>US</Country>
<Currency>USD</Currency>
<ConditionID>1000</ConditionID>
<DispatchTimeMax>2</DispatchTimeMax>
<ListingDuration>Days_7</ListingDuration>
<ListingType>FixedPriceItem</ListingType>
<PictureDetails/>
<Quantity>1</Quantity>
<PostalCode>47714</PostalCode>
<ReturnPolicy>
<ReturnsAcceptedOption>ReturnsAccepted</ReturnsAcceptedOption>
<RefundOption>MoneyBack</RefundOption>
<ReturnsWithinOption>Days_30</ReturnsWithinOption>
<Description>If you are not satisfied, return the book for refund.</Description>
<ShippingCostPaidByOption>Buyer</ShippingCostPaidByOption>
</ReturnPolicy>
<ShippingDetails>
<ShippingType>Flat</ShippingType>
<ShippingServiceOptions>
<ShippingServicePriority>1</ShippingServicePriority>
<ShippingService>USPSPriority</ShippingService>
<ShippingServiceCost>2.50</ShippingServiceCost>
<ShippingServiceAdditionalCost>2.50</ShippingServiceAdditionalCost>
</ShippingServiceOptions>
</ShippingDetails>
<Site>US</Site>
<UUID>[[removed]]</UUID>
<PaymentMethods>PayPal</PaymentMethods>
<PayPalEmailAddress>[[removed]]</PayPalEmailAddress>
</Item>
</AddItemRequest>
我得到的回答看起来像这样:
<?xml version="1.0" encoding="UTF-8"?>
<AddItemResponse xmlns="urn:ebay:apis:eBLBaseComponents">
<Timestamp>2017-05-11T00:34:05.364Z</Timestamp>
<Ack>Failure</Ack>
<Errors>
<ShortMessage>Category is not valid.</ShortMessage>
<LongMessage>The category is not valid, select another category.</LongMessage>
<ErrorCode>107</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Errors>
<ShortMessage>Condition is not applicable.</ShortMessage>
<LongMessage>Condition is not applicable for this category. The condition value submitted has been dropped.</LongMessage>
<ErrorCode>21917121</ErrorCode>
<SeverityCode>Warning</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Version>1011</Version>
<Build>E1011_UNI_API5_18405133_R1</Build>
</AddItemResponse>
我之前已经收到了警告,但仍然可以列出。这是所有类别第一次失败。仅仅是为了测试,我甚至尝试获取类别列表,并且只从我知道的API中提取叶子类别,例如以下内容:
[BestOfferEnabled] => true
[AutoPayEnabled] => true
[CategoryID] => 183073
[CategoryLevel] => 3
[CategoryName] => Other Virtual Reality Accs
[CategoryParentID] => 183067
[LeafCategory] => true
非常感谢任何见解。我正在使用的帐户似乎没有任何限制,也没有暂停,这是我想到的第一件事。这个“无效类别”是否可以表示不同的问题?切换类别似乎并没有解决它。
我找不到一个有用的类别,但是,我尝试过的一些列表包括以下内容:20374 - &gt;其他手动工具,21555 - &gt;男女通用鞋,19488 - &gt; Baby Books,21027 - &gt;水过滤
答案 0 :(得分:0)
类别 20374 - 其他手工工具暂时改为20357.我可以通过在TradingAPI(link)上调用GetCategoryMappings来找到它。这是我发现出现的地方
请记住,离开旧类别映射的时间越长,您就必须回拨CategoryVersion
属性(对于此结果,我必须追溯到v68)。
希望这有帮助!
幸