@plentymarkets/shop-api / getCategoryTree
Function: getCategoryTree() ​
getCategoryTree(
context
):Promise
<Data
<CategoryTreeItem
[]>>
getCategoryTree - method for retriving the list with the categories and subcategories ready to be consumed by tree navigation
Parameters ​
• context: PlentysystemsIntegrationContext
Returns ​
Promise
<Data
<CategoryTreeItem
[]>>
Remarks ​
calls /rest/storefront/categories and returns a list of CategoryTreeItems, subcategories are set in children prop.
Example ​
ts
const { data, error } = await useAsyncData(() => sdk.plentysystems.getCategoryTree());
## Defined in
[api/getCategoryTree/index.ts:16](https://github.com/plentymarkets/plentymarkets-sdk/blob/0468b09f567d89b1324bf1fe3c0cdd0380ec4a98/packages/api-client/src/api/getCategoryTree/index.ts#L16)