CategoryTree (GET)#
To sort products into categories the endpoint api/categorytree
returns a fully functional category-tree.
GET api/categorytree
Hint
Every product contains a reference to its category which can then be fetched via GET api/categorytree
.
Parameters#
NAME | TYPE | DESCRIPTION |
---|---|---|
itemsPerPage |
integer | Optional - allows the restriction of results per page |
page |
integer | Optional - number of page (useful for paginated responses) |
Response#
Sometimes subCategory
could be set to null
if it would only have a very few items.
{
"@context": "/v2/api/contexts/Category",
"@id": "/v2/api/categorytree",
"@type": "hydra:Collection",
"hydra:member": [
{
"@id": "/v2/api/categorytree/12",
"@type": "Category",
"id": 12,
"code": "FA_UN",
"group": {
"de": "Fashion & Accessoires",
"en": "Fashion & Accessories"
},
"mainCategory": {
"de": "Unisex",
"en": "Unisex"
},
"subCategory": {
"de": null,
"en": null
}
}
],
"hydra:totalItems": 179,
"hydra:view": {
"@id": "/v2/api/categorytree?itemsPerPage=1&page=1",
"@type": "hydra:PartialCollectionView",
"hydra:first": "/v2/api/categorytree?itemsPerPage=1&page=1",
"hydra:last": "/v2/api/categorytree?itemsPerPage=1&page=179",
"hydra:next": "/v2/api/categorytree?itemsPerPage=1&page=2"
}
}