Skip to main content
Published: April 22 2015, 11:51:00 PMUpdated: July 25 2022, 5:43:18 AM

How can I determine which Leaf Categories support the BestOffer feature?

You can use a combination of the GetCategoryFeatures call and the GetCategories call to determine which Leaf level categories support Best Offer.

GetCategoryFeatures behavior:


One important concept to keep in mind is that GetCategoryFeatures does not return every single leaf and parent category that exists in the Category tree. It only returns key data points ( leaf and parent node categories) that are different from the SiteDefault, or different from the parent ID setting. For example, if the SiteDefault is BestOfferEnabled = FALSE, only categories with a BestOfferEnabled = TRUE will be returned in GetCategoryFeatures. Secondly, if all of the leaf categories under a parent have the same value for BestOfferEnabled, then only the parent category will be returned in GetCategoryFeatures. In this case, the property of the parent category is inherited for all lower level child categories down to the leaf categories.

For example, if you are listing in the Video Games category - ID 1249, you would use the following logic:

1. Call GetCategoryFeatures with DetailLevel set to ReturnAll, ViewAllNodes set to True and the CategoryID specified, in order to retrieve a list of all categories under the specified CategoryID. In the response below, you can see that the SiteDefaults.BestOfferEnabled flag is set to false and CategoryID 1249 has a value of BestOfferEnabled = true.

<?xml version="1.0" encoding="utf-8"?>
<GetCategoryFeaturesRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<Version>467</Version>
<DetailLevel>ReturnAll</DetailLevel>
<RequesterCredentials>
<eBayAuthToken>x</eBayAuthToken>
</RequesterCredentials>
<CategoryID>1249</CategoryID>
<ViewAllNodes>true</ViewAllNodes>
<FeatureID>BestOfferEnabled</FeatureID>
</GetCategoryFeaturesRequest>

<?xml version="1.0" encoding="utf-8"?>
<GetCategoryFeaturesResponse xmlns="urn:ebay:apis:eBLBaseComponents">
<Timestamp>2006-07-21T17:26:09.452Z</Timestamp>
<Ack>Success</Ack>
<Version>469</Version>
<Build>e469_core_Bundled_3210255_R1</Build>
<CategoryVersion>228</CategoryVersion>
<UpdateTime>2006-07-21T09:36:14.000Z</UpdateTime>
<Category>
<CategoryID>1249</CategoryID>
<BestOfferEnabled>true</BestOfferEnabled>
</Category>
<SiteDefaults>
<BestOfferEnabled>false</BestOfferEnabled>
</SiteDefaults>
<FeatureDefinitions>
<BestOfferEnabled/>
</FeatureDefinitions>
</GetCategoryFeaturesResponse>

2. Based on the Response above, you know that category 1249 accepts BestOffers. Since no other CategoryIDs ( Child Categories of 1249 ) are returned in the response, you also know that all Child categories under 1249 also accept BestOffers. That is, their BestOfferEnabled setting is inherited from category 1249.

3. By calling GetCategories with CategoryParentID set to 1249, you can retrieve a list of all Child categories under 1249, and set their corresponding Best Offer flags in your database.

*Note 1: At times, GetCategoryFeatures, may return some redundant leaf categories, that actually have the same flag value as their parent. These redundancies should be ignored. They are not incorrect, and can be confusing at times.

*Note 2: Do not count on the BestOffer flag data returned from GetCategories. This data is currently returned due to backwards compatibility reasons, but will soon stop being returned in GetCategories.

See the API documentation for more information about this call: 

http://developer.ebay.com/Devzone/XML/docs/Reference/ebay/GetCategoryFeatures.html

 

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

Got thoughts? Click the feedback button – your insights help us improve!