Skip to main content

purchaseAnalytics

Requires permission analytics:organization:read.

Purchase analytics for a period: total purchases and orders, average order value, growth, orders by status, purchases by period and category, and top suppliers and products. Needs the purchase orders feature on your plan. Org-wide purchase spend: needs the organization 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 PurchaseAnalytics($period: AnalyticsPeriod!) {
purchaseAnalytics(period: $period) {
averageOrderValue
ordersGrowth
purchasesGrowth
totalOrders
totalPurchases
ordersByStatus {
status
count
value
}
}
}

Variables:

{
"period": "LAST_6_MONTHS"
}

Response:

{
"data": {
"purchaseAnalytics": {
"averageOrderValue": 0,
"ordersGrowth": 0,
"purchasesGrowth": 0,
"totalOrders": 0,
"totalPurchases": 0,
"ordersByStatus": [
{
"status": "string",
"count": 0,
"value": 0
}
]
}
}
}
purchaseAnalytics(
period: AnalyticsPeriod!
): PurchaseAnalytics!

Arguments​

purchaseAnalytics.period ● AnalyticsPeriod! non-null enum​

The period to report on.

Type​

PurchaseAnalytics object​

Purchasing figures for the period.