@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/784d2fb4315e21076eb19c8b0e70ccdb04d67d2b/packages/api-client/src/api/getCategoryTree/index.ts#L16)