Skip to main content

customerStatistics

Requires at least one of the permissions customers:customer:list or customers:customer:read.

Returns summary counts for the customers the signed-in user may see. Needs the customers read or list permission.

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 CustomerStatistics {
customerStatistics {
activeCustomers
averageOrderValue
totalCustomers
totalSalesAmount
topCustomers {
id
name
lastOrderDate
totalAmount
totalOrders
}
}
}

Response:

{
"data": {
"customerStatistics": {
"activeCustomers": 0,
"averageOrderValue": 0,
"totalCustomers": 0,
"totalSalesAmount": 0,
"topCustomers": [
{
"id": "id",
"name": "string",
"lastOrderDate": "2025-01-15T00:00:00Z",
"totalAmount": 0,
"totalOrders": 0
}
]
}
}
}
customerStatistics: CustomerStatistics!

Type​

CustomerStatistics object​

Headline customer statistics.