categorySummary
Requires permission categories:category:list.
Returns category statistics for your organization: counts of total, active, inactive, root, parent and child categories and those with or without active products, the tree depth, recent and most used categories, and the category tree. Requires permission to list categories.
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:
- GraphQL
- cURL
query CategorySummary {
categorySummary {
activeCategories
categoriesWithProducts
categoriesWithoutProducts
childCategories
inactiveCategories
lastUpdated
categoryTree {
id
code
name
createdAt
childrenCount
deletedAt
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query CategorySummary {\n categorySummary {\n activeCategories\n categoriesWithProducts\n categoriesWithoutProducts\n childCategories\n inactiveCategories\n lastUpdated\n categoryTree {\n id\n code\n name\n createdAt\n childrenCount\n deletedAt\n }\n }\n}"
}
EOF
Response:
{
"data": {
"categorySummary": {
"activeCategories": 0,
"categoriesWithProducts": 0,
"categoriesWithoutProducts": 0,
"childCategories": 0,
"inactiveCategories": 0,
"lastUpdated": "2025-01-15T00:00:00Z",
"categoryTree": [
{
"id": "id",
"code": "string",
"name": "string",
"createdAt": "2025-01-15T00:00:00Z",
"childrenCount": 0,
"deletedAt": "2025-01-15T00:00:00Z"
}
]
}
}
}
categorySummary: CategorySummary!
Type
CategorySummary object
Headline category figures.