Retrieving the category trees

GET {{api-url}}/category/{{tenant}}/category-trees?showUnpublished=false

Retrieves the category trees.


Required scopes

  • category.category_read_unpublished Note: Only required if the response should contain unpublished categories.

Request Params

KeyDatatypeRequiredDescription
showUnpublishedbooleanIf set to true, not published categories are retrieved as well.
Possible values:
  • true
  • false Note: To get unpublished categories you need to have category.category_read_unpublished scope. |

HEADERS

KeyDatatypeRequiredDescription
X-Versionstring(Required) To use this endpoint you have to add X-Version header with proper value to your request.

Note: The header value has to match following regular expression: ^v[1-9][0-9]?$ | | Accept | string | | |

RESPONSES

status: OK

[{"id":"38118","localizedName":{"en":"ProductRoot"},"code":"productroot","localizedSlug":{"en":"productroot"},"localizedDescription":{"en":"ProductRoot"},"position":55555,"published":true,"subcategories":[{"id":"38119","parentId":"38118","localizedName":{"en":"Fruits \u0026 Vegetables"},"code":"fruits-\u0026-vegetables","localizedSlug":{"en":"fruits-\u0026-vegetables"},"localizedDescription":{"en":"Fresh and tasty fruits and vegetables."},"position":0,"published":true,"subcategories":[{"id":"38120","parentId":"38119","localizedName":{"en":"Fruit"},"code":"fruit","localizedSlug":{"en":"fruit"},"position":0,"published":true}]}]}]