Learn how to manage the category tree in the Neomode API
Hierarchy:
Lori uses a multi-level category structure, allowing the catalog to be organized hierarchically.
The link structure between levels is established through the parentId
field, as described below:
First level
The main category has the parentId=null
attribute, making it the first level of the category tree.
Other levels
Have the parentId={GUID}
attribute filled with the ID of the parent category. A subcategory can, in turn, be the parent of other subcategories.
Example JSON List simplified
{
"parentId": null,
"id": "00000000-0000-0000-0000-000000000000",
"code": "1",
"name": "Level 1",
"isActive": true,
"children": [
{
"parentId": "00000000-0000-0000-0000-000000000000",
"code": "2",
"name": "Level 2",
"isActive": true
}
]
}
Category Tree creation flow
To register the category tree levels
The category structure is hierarchical and should be created level by level.
- With a valid token – Authenticate
- Send the first level of the category tree – PUT Upsert Batch Categories
- Retrieve the ID of the created category – GET Category Tree
- Send the second level, using the
parentId
of the upper-level category – PUT Categories Batch
