Skip to main content
Published: August 30 2006, 2:30:00 PMUpdated: August 02 2022, 4:57:33 AM

When I try to list a Motors Item I get the following error message even though the category is a leaf category:

<Errors>
  <
ShortMessage>Invalid category.</ShortMessage>
  <
LongMessage>The category selected is not a leaf category.</LongMessage>
  <
ErrorCode>87</ErrorCode>
  <
SeverityCode>Error</SeverityCode>
  <
ErrorClassification>RequestError</ErrorClassification>
</
Errors>

Why am I getting this error?

Summary

When you list an Item, you need to ensure that the Category is at leaf level and also that it is not virtual. 



Detailed Description

eBay Motors has some virtual categories apart from the regular categories that you see on the Site when you list an item.  The virtual categories are meant for eBay internal use and is not meant to be used in any of the API calls.  If you use a virtual category when listing an item, you will get the error message that it is not a valid category.  You can make a call to GetCategories with the DetailLevel set to ReturnAll and find out which categories are virtual and to be ignored.

Here is a sample GetCategories request to get the top parent level categories:
<?xml version="1.0" encoding="utf-8"?>
<GetCategoriesRequest xmlns="urn:ebay:apis:eBLBaseComponents">
  <CategorySiteID>100</CategorySiteID>
  <DetailLevel>ReturnAll</DetailLevel>
  <LevelLimit>
2</LevelLimit>
  <RequesterCredentials>
    <eBayAuthToken>*****</eBayAuthToken>
  </RequesterCredentials>
</GetCategoriesRequest>

GetCategories response:
<?xml version="1.0" encoding="utf-8"?>
<GetCategoriesResponse xmlns="urn:ebay:apis:eBLBaseComponents">
  <Timestamp>20060830T20:56:21.131Z</Timestamp>
  <Ack>Success</Ack>
  <Version>475</Version>
  <Build>e475_core_Bundled_3434772_R1</Build>
  <CategoryArray>
    <Category>
      <BestOfferEnabled>true</BestOfferEnabled>
      <CategoryID>6000</CategoryID>
      <CategoryLevel>1</CategoryLevel>
      <CategoryName>eBay Motors</CategoryName>
      <CategoryParentID>6000</CategoryParentID>
      <Expired>false</Expired>
      <IntlAutosFixedCat>false</IntlAutosFixedCat>
      <LeafCategory>false</LeafCategory>
      <Virtual>false</Virtual>
      <ORPA>false</ORPA>
      <LSD>true</LSD>
    </Category>
    <Category>
      <BestOfferEnabled>true</BestOfferEnabled>
      <CategoryID>6051</CategoryID>
      <CategoryLevel>2</CategoryLevel>
      <CategoryName>Cars</CategoryName>
      <CategoryParentID>6000</CategoryParentID>
      <Expired>false</Expired>
      <IntlAutosFixedCat>false</IntlAutosFixedCat>
      <LeafCategory>false</LeafCategory>
      <Virtual>true</Virtual>
      <ORPA>false</ORPA>
      <LSD>true</LSD>
    </Category>
    <Category>
      <BestOfferEnabled>true</BestOfferEnabled>
      <CategoryID>6001</CategoryID>
      <CategoryLevel>2</CategoryLevel>
      <CategoryName>Cars & Trucks</CategoryName>
      <CategoryParentID>6000</CategoryParentID>
      <Expired>false</Expired>
      <IntlAutosFixedCat>false</IntlAutosFixedCat>
      <LeafCategory>false</LeafCategory>
      <SellerGuaranteeEligible>false</SellerGuaranteeEligible>
      <Virtual>false</Virtual>
      <ORPA>false</ORPA>
      <LSD>true</LSD>
    </Category>
    ...
  </CategoryArray>
  <CategoryCount>13</CategoryCount>
  <UpdateTime>20060815T02:21:42.000Z</UpdateTime>
  <CategoryVersion>36</CategoryVersion>
  <ReservePriceInclusive>false</ReservePriceInclusive>
  <ReservePriceAllowed>true</ReservePriceAllowed>
  <MinimumReservePrice>0.0</MinimumReservePrice>
  <ReduceReserveInclusive>true</ReduceReserveInclusive>
  <ReduceReserveAllowed>false</ReduceReserveAllowed>
</GetCategoriesResponse>

From the response you can see that the first Category Cars (CategoryID 6051) is a virtual category and you should not try to list an item in it or any of its children, even if they are leaf level categories.



Additional Resources

How well did this answer your question?
Answers others found helpful