Analytics API
All analytics queries require the report.view permission; exports require report.export.
Each takes timeframe: ReportTimeframe! and optional startDate/endDate (for CUSTOM).
merchantRevenueSummary
Section titled “merchantRevenueSummary”query { merchantRevenueSummary(timeframe: MONTHLY) { gmv netRevenue fees tips discounts transactionCount averageOrderValue gmvDelta netRevenueDelta transactionCountDelta reportPeriod }}merchantRevenueTimeSeries
Section titled “merchantRevenueTimeSeries”Returns series and previousSeries of { date, gmv, count }, plus the bucket grain.
merchantPaymentMix
Section titled “merchantPaymentMix”Returns byToken, byChain, byCurrency, each a list of { key, count, total }.
merchantRefundMetrics
Section titled “merchantRefundMetrics”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.
merchantCustomerMetrics
Section titled “merchantCustomerMetrics”Returns { newCustomers, returningCustomers, repeatRate, averageCustomerValue, topCustomers { customerId, lifetimeValue, orderCount } }.
merchantPromotionMetrics
Section titled “merchantPromotionMetrics”Returns { redemptionCount, totalDiscount, byCoupon { couponId, redemptions, discount } }.
merchantSubscriptionMetrics
Section titled “merchantSubscriptionMetrics”Returns { mrr, activeSubscribers, churnRate, canceledInPeriod }. MRR counts only fixed recurring prices, normalized to monthly.
merchantTopProducts
Section titled “merchantTopProducts”Returns { products { productId, revenue, quantity }, basis }. basis is always "invoice" (invoice-based revenue only).