Skip to content

Analytics API

All analytics queries require the report.view permission; exports require report.export. Each takes timeframe: ReportTimeframe! and optional startDate/endDate (for CUSTOM).

query {
merchantRevenueSummary(timeframe: MONTHLY) {
gmv netRevenue fees tips discounts transactionCount averageOrderValue
gmvDelta netRevenueDelta transactionCountDelta reportPeriod
}
}

Returns series and previousSeries of { date, gmv, count }, plus the bucket grain.

Returns byToken, byChain, byCurrency, each a list of { key, count, total }.

Returns { refundCount, totalRefunded, averageRefund, refundRate, refundRateDelta }.

exportRevenueSummaryCSV / exportRevenueSummaryPDF

Section titled “exportRevenueSummaryCSV / exportRevenueSummaryPDF”

Return CsvExportResult { downloadUrl, rowCount, generatedAt }. downloadUrl is a base64 data URL. Each call writes an analytics.exported audit event.

Returns { newCustomers, returningCustomers, repeatRate, averageCustomerValue, topCustomers { customerId, lifetimeValue, orderCount } }.

Returns { redemptionCount, totalDiscount, byCoupon { couponId, redemptions, discount } }.

Returns { mrr, activeSubscribers, churnRate, canceledInPeriod }. MRR counts only fixed recurring prices, normalized to monthly.

Returns { products { productId, revenue, quantity }, basis }. basis is always "invoice" (invoice-based revenue only).