This guide describes the migration from the deprecated GetCategories Trading API call to the REST Taxonomy API and Metadata API methods.
Users currently integrated with the Trading API call can use the getCategoryTree and getCategorySubtree methods of the Taxonomy API to return category hierarchy information, and the getCategoryPolicies method of the Metadata API to retrieve metadata. These methods are the REST API equivalents of the deprecated GetCategories call.
Retrieving category trees with the Taxonomy API
The getCategoryTree and getCategorySubtree methods of the Taxonomy API return taxonomy information for an eBay marketplace or specified category. These methods can be used to return taxonomy data returned by the GetCategories call.
The getCategoryTree method is used to retrieve full category taxonomy of an eBay marketplace, which is identified through the category_tree_id path parameter. This parameter is the same value as the CategorySiteID used in the GetCategories call.
If a seller wishes to retrieve a partial category taxonomy of an eBay marketplace, the getCategorySubtree method can be used. In addition to the category_tree_id path parameter, this method also requires a category_id query parameter for a category at any level. This parameter is the equivalent of the CategoryParent used in the GetCategories call. The response of this method will include metadata of the specified category and all of its descendent categories.
Note: When using the Taxonomy API methods to retrieve taxonomy information, the response payloads are similar to GetCategories but the field names of the fields are slightly different. For example, the leafCategoryTreeNode boolean is used as the leaf category indicator, as opposed to the LeafCategory boolean field. Keep this in mind when migrating to these methods.
getCategoryPolicies metadata
The getCategoryPolicies method of the Metadata API returns eBay category policy metadata for all leaf categories on the specified marketplace. This method can be used to return metadata returned by the GetCategories call.
Note: The getCategoryPolicies method in the Metadata API covers eight non-taxonomy related data points returned in GetCategories. For taxonomy-related functionality of the GetCategories call, see Retrieving category trees with the Taxonomy API.
The following table cross-references the GetCategories fields returned in the Trading API with the associated getCategoryPolicies field returned in the Metadata API:
GetCategories field | getCategoryPolicies field |
---|---|
AutoPayEnabled | autoPayEnabled |
B2BVATEnabled | b2bVatEnabled |
Expired | expired |
LSD | lsd |
ORPA | orpa |
ORRA | orra |
Virtual | virtual |
ReduceReserveAllowed | reduceReserveAllowed |