Skip to main content

trendsAnalytics

Requires permission analytics:sales:read.

Trend analytics for a period. Limited to the customers you may see.. Needs the sales analytics 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:

query TrendsAnalytics($period: AnalyticsPeriod!) {
trendsAnalytics(period: $period) {
categoryTrends {
categoryName
categoryId
growthRate
trend
}
}
}

Variables:

{
"period": "LAST_6_MONTHS"
}

Response:

{
"data": {
"trendsAnalytics": {
"categoryTrends": [
{
"categoryName": "string",
"categoryId": "string",
"growthRate": 0,
"trend": "string"
}
]
}
}
}
trendsAnalytics(
period: AnalyticsPeriod!
): TrendsAnalytics!

Arguments​

trendsAnalytics.period ● AnalyticsPeriod! non-null enum​

The reporting period to analyse.

Type​

TrendsAnalytics object​

Trends in sales.