Skip to main content

Overview

Analytics queries return pre-aggregated statistics for a single store. Every analytics query takes:
  • A store identifier — storeId or storeSlug (top-level argument, at least one required).
  • A required filter of type AnalyticsFilterInput!.
Many nested fields take their own arguments, most commonly granularity and currency. The time-bucket granularity uses the TimePeriodGranularity enum: DAY, WEEK, MONTH, QUARTER, YEAR, ALL_TIME.
Each analytics query returns a structured object, not scalar totals. Amount fields are returned as display strings. Select the nested fields you need — the examples below show the available shape.

Order Statistics

Order counts, dual-source revenue, and buyer metrics.
revenueByCurrency / revenueByPeriod are dual-source: pspTotalAmount is the PSP actual amount, snapshotTotalAmount is the snapshot expected amount, and mismatchCount counts payments where the two disagree.
Variables:

Payment Statistics

Success rate, failure reasons, refunds, method distribution, and tax summary.
successRate is an object ({ totalAttempts, succeeded, failed, pending, successRate }), not a scalar.

Product Statistics

Product counts, top sellers, and revenue contribution.

Trend Analysis

Period-over-period growth, cumulative revenue, and moving averages.

Distribution Analysis

Order amount percentiles, average-order-value trend, and amount buckets.

Customer Analysis

Cohort retention, LTV distribution, purchase frequency, and top customers.

Tax Analysis

Tax amounts by category, rate group, and country, plus B2B/B2C comparison.

Subscription Analysis

Billing period distribution, cancellation stats, trial conversion, and churn.

Refund Ticket Analysis

Reason distribution, review efficiency, and approval rate.

Settlement Analysis

Actual settled amounts sourced from settlement files (post-fee, post-refund). This is the ground truth for reconciliation, distinct from paymentStatistics.settlementRevenueByCurrency (a PSP projection at payment time).
settlementAnalysis time range is based on the settlement date, not created_at. Additional analytics queries are available depending on your role, including deliveryAnalysis (webhook/email delivery) and payoutAnalysis (payout tickets, scoped to the merchant). Use schema introspection to discover their full field sets.
Variables: