customerReports
Requires permission customers:customer:read.
Returns report data for the customers the signed-in user may see, optionally filtered. Needs the customers read 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:
- GraphQL
- cURL
query CustomerReports {
customerReports {
cohortAnalysis {
cohort
customersCount
retentionRates
revenueByPeriod
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query CustomerReports {\n customerReports {\n cohortAnalysis {\n cohort\n customersCount\n retentionRates\n revenueByPeriod\n }\n }\n}"
}
EOF
Response:
{
"data": {
"customerReports": {
"cohortAnalysis": [
{
"cohort": "string",
"customersCount": 0,
"retentionRates": [
0
],
"revenueByPeriod": [
0
]
}
]
}
}
}
customerReports(
filters: CustomerReportFiltersInput
): CustomerReportsData!
Arguments
customerReports.filters ● CustomerReportFiltersInput input
Optional filters that narrow the report.
Type
CustomerReportsData object
The customer reports.