Returns every item category with its position in the category tree.
GET /inventory/item-categories/tree
Group: Inventory › Item Categories · Operation ID: readItemCategoryTree
Returns every item category with its position in the category tree, its parent, its ancestor path and its depth, in one request. It computes server-side the derived fields the collection cannot express: path, the ancestor names ending with the category's own, and level, its depth.
Every category appears, including a flat one that has never been placed in the tree: it comes back as a root, with parentId absent, level 0 and path its own name alone. Categories are ordered by name, not by tree position. The tree is capped at 6 levels deep, and hasChildren says whether a category has anything beneath it.
The result is an array, empty only when your tenant has no categories at all.
Open in the interactive reference
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Api-Version |
header | "v1" |
yes | The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version v1. |
Response
200 Success
Under data (readItemCategoryTreeOutput):
| Field | Type | Required | Description |
|---|---|---|---|
data |
array of object | yes | Every item category, each with its position in the tree, ordered by name. |
data[].id |
string | yes | The unique identifier for the item category. |
data[].name |
string | yes | The display name of the category, for example 'Hardware'. Not unique: two categories can share a name, so use id to address one. |
data[].description |
string | no | A free-form description of what the category covers. Absent when none was set. |
data[].parentId |
string | no | The identifier of the category this one sits under. Absent for a top-level category. See id on GET inventory/item-categories/:id. |
data[].level |
number | yes | The depth in the tree: 0 for a top-level category, 1 for its children, and so on, up to 5. |
data[].path |
array of string | yes | The ancestor names from the root down, ending with this category's own name. A root's path is its own name alone. |
data[].hasChildren |
boolean | yes | Whether any category sits beneath this one. |
Statuses
400— Invalid request or business failure401— Missing or invalid access token403— Not authorized404— Not found429— Too many requests500— Internal server error