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