BizKitHub
DokumentacjaEksplorator APIProduct Category/api/v1/product-category/tree
getProduct CategoryPubliczne API v1

/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.

productCategorygetApiV1Product-categoryTree

Parametry

2 w query

Parametry query

· 2
apiKeystringWymagane

Your 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

PrzykładPRODPGrFxpGEtrOZfuWhnoJohUYBXuOE
maxDepthstring | integerOpcjonalne

Maximum 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: [].

Zakres: 1–10Domyślnie: 2
Przykład2

Schemat odpowiedzi

1 udokumentowany kod statusu

200SukcesProduct category tree.
itemsobject[]Wymagane

Root categories with nested descendants up to maxDepth levels.

Każdy element tablicy:
idstringWymagane

Category code (unique identifier).

Przykładcat_lighting
namestringWymagane

Display name of the category.

PrzykładLighting
slugstringWymagane

URL-friendly slug.

Przykładlighting
descriptionstringOpcjonalne

HTML description formatted for frontend display (only present when filled in admin).

b2bbooleanWymagane

Whether the category is B2B-only.

childrenany[]Wymagane

Direct child categories. Always present as an array (empty when no children or at maxDepth).

Przykład odpowiedzi

application/json
{
  "items": [
    {
      "id": "cat_lighting",
      "name": "Lighting",
      "slug": "lighting",
      "description": "example_description",
      "b2b": false,
      "children": []
    }
  ]
}

Przykład żądania

GET /api/v1/product-category/tree

get
curl -X GET "https://api.bizkithub.com/api/v1/product-category/tree?apiKey=PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE&maxDepth=2" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY"

Potrzebujesz klucza API?

Wszystkie publiczne endpointy BizKitHub API uwierzytelniają się kluczem API.

Uzyskaj klucz API