@plentymarkets/shop-api / getCategoryTree
Function: getCategoryTree() ​
getCategoryTree(
context
):Promise
<Data
<CategoryTreeItem
[]>>
Defined in: api/getCategoryTree/index.ts:16
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());