eBay Trading APIVersion 1363
 

GetCategoriesRequestType ( AbstractRequestType )

Retrieves the latest eBay category hierarchy for a given eBay site. Information returned for each category includes the category name and the unique ID for the category (unique within the eBay site for which categories are retrieved). A category ID is a required input when you list most items.

Call that uses GetCategoriesRequestType:

Fields

CategoryParent ( string ) [0..*]
This field is used if the user wishes to retrieve category hierarchy information on one or more specific eBay categories, and optionally, one or more levels of each category's children (if a category has one or more levels of children). For example, if you wanted to view the entire category hierarchy under the Home & Garden L1 category, you would include this field and set its value to 11700. As long as the LevelLimit field is omitted, all of Home & Garden's child categories are returned. If you only wanted to see the next level (L2s) of Home & Garden categories, you would include the LevelLimit field and set its value to 2, allowing the L1 category (Home & Garden) and all of its L2 categories to appear in the response.

If you wanted to see all of the Category IDs for the eBay site's L1 categories, you could omit the CategoryParent field but include the LevelLimit field and set its value to 1.

Note: Numerous Category IDs may be specified under multiple CategoryParent fields in a GetCategories request, but if multiple CategoryParent fields are used, the specified Category IDs should all be at the same level (L1, L2, L3, etc.).
See the Field Index to learn which calls use CategoryParent.

CategorySiteID ( string ) [0..1]
This field is used if the user wants to retrieve category data for another eBay site (other than the one specified in the X-EBAY-API-SITEID request header).

If this field is omitted, the categories from the site specified in the required X-EBAY-API-SITEID request header are returned. If this field is included, the site specified in this field overrides the site ID in the request header.
See the Field Index to learn which calls use CategorySiteID.

LevelLimit ( int ) [0..1]
This field is used if the user wants to control the maximum depth of the category hierarchy to retrieve, or in other words, how many levels of eBay categories that are returned in the response. If this field is omitted, every eBay category from the root on down will be returned, or, if a CategoryParent category is specified, the specified category and all of its children (down to the leaf categories) are returned.

If the CategoryParent is not used, but the LevelLimit field is used and set to 1, only the top-level categories (also known as L1 categories) are returned in the response.
See the Field Index to learn which calls use LevelLimit.

ViewAllNodes ( boolean ) [0..1]
This flag controls whether all eBay categories (that satisfy input filters) are returned, or only leaf categories (you can only list items in leaf categories) are returned. The default value is 'true', so if this field is omitted, all eBay categories will be returned. If you only want to retrieve leaf categories, include this flag and set it to false.
See the Field Index to learn which calls use ViewAllNodes.