/api/v1/product-category/tree
Returns the full category tree for the organisation in a single call, suitable for rendering navigation menus during server-side rendering. Root categories appear in items; their descendants are nested under children up to maxDepth levels deep. Deleted, inactive, and internal categories are excluded. Within each level items are ordered by position.
This endpoint requires a valid API key passed as a query parameter or Bearer token.
Get your API keyParameters
2 query parameters
apiKeystringrequiredYour BizKitHub API key (passed as GET parameter).
Key format: A 32-character string matching: ^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$
Prefixes: PROD (production key), DEV_ (individual developer), ROOT (system key with no limits). Learn more
maxDepthstring | integerMaximum tree depth, counted inclusively from the root. 1 returns only roots, 2 returns roots and their direct children (default), up to 10. Nodes at the maximum depth always have children: [].
2Example Request
JavaScript fetch
const response = await fetch("https://api.bizkithub.com/api/v1/product-category/tree?apiKey=PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE&maxDepth=2", {
method: "GET",
headers: {
"Content-Type": "application/json"
}
});
const data = await response.json();
console.log(data);Example Response
{
"items": [
{
"id": "cat_lighting",
"name": "Lighting",
"slug": "lighting",
"description": "example_description",
"b2b": false,
"children": []
}
]
}cURL
Command line example
curl -X GET "https://api.bizkithub.com/api/v1/product-category/tree?apiKey=PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE&maxDepth=2" \
-H "Content-Type: application/json"Need an API key?
All BizKitHub API endpoints require authentication via API key.