Skip to main content

customerCategories

Requires a customer (portal or buyer app) session.

Returns the category tree of the catalogue with a count of products under each category. Categories with no products are left out.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

query CustomerCategories {
customerCategories {
id
code
name
description
imageUrl
level
children {
id
code
name
description
imageUrl
level
}
}
}

Response:

{
"data": {
"customerCategories": [
{
"id": "id",
"code": "string",
"name": "string",
"description": "string",
"imageUrl": "string",
"level": 0,
"children": [
{
"id": "id",
"code": "string",
"name": "string",
"description": "string",
"imageUrl": "string",
"level": 0
}
]
}
]
}
}
customerCategories(
brandId: ID
): [CustomerCategory!]!

Arguments​

customerCategories.brandId ● ID scalar​

Count only this brand's products, so the tree lists just the categories the brand sells in.

Type​

CustomerCategory object​

A category a customer can shop.