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">

<?xml version="1.0" encoding="utf-8"?>
<GetCategoryFeaturesResponse xmlns="urn:ebay:apis:eBLBaseComponents">

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:


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