Get Started

Revenue Data Structures

All data structures used in the Revenue API endpoint.

View API:Revenue API

Event Type

Type of revenue event

Event Type

string

Type of revenue event

purchasesubscription_purchasetrial_conversionrenewalrefundcancellationexpirationtrial_start

Paginated Revenue

Paginated revenue response

Paginated Revenue

object

Paginated revenue response

pageintegerrequired

Current page number (1-indexed)

limitintegerrequired

Number of items per page

totalintegerrequired

Total number of items across all pages

totalPagesintegerrequired

Total number of pages

hasNextbooleanrequired

Whether there is a next page

hasPrevbooleanrequired

Whether there is a previous page

previousSummaryanyrequired

Revenue summary statistics for the previous period (only present if prevSince/prevUntil were provided in the request)

Revenue Event

A single revenue transaction event

Revenue Event

object

A single revenue transaction event

idstringrequired

Unique event identifier

workspaceIdstringrequired

Workspace identifier

integrationIdstring | null

Integration identifier if event came from an integration

eventTypeEventTyperequired
amountCentsintegerrequired

Transaction amount in cents

currencystringrequired

Currency code (ISO 4217)

Example: "USD"

externalIdstring | null

External transaction ID from the provider

metadataobject | null

Additional metadata associated with the event

occurredAtstring (date-time)required

ISO 8601 timestamp when the event occurred

createdAtstring (date-time)required

ISO 8601 timestamp when the event was recorded

providerIntegrationProvider

Revenue Series Bucket

Time series data point for revenue analytics

Revenue Series Bucket

object

Time series data point for revenue analytics

bucketTsstring (date-time)required

ISO 8601 timestamp for the start of the time bucket

currencystringrequired

Original currency for this bucket (before conversion)

Example: "USD"

revenueCentsintegerrequired

Total positive revenue in cents (purchases + subscriptions + renewals)

purchasesCentsintegerrequired

One-time purchase revenue in cents

renewalsCentsintegerrequired

Subscription renewal revenue in cents

trialsCentsintegerrequired

Trial conversion revenue in cents

refundsCentsintegerrequired

Refund amount in cents

newSubsCentsinteger

New subscription revenue in cents (optional)

purchaseCountintegerrequired

Number of purchases in this bucket

renewalCountintegerrequired

Number of renewals in this bucket

trialCountintegerrequired

Number of trial conversions in this bucket

trialStartCountintegerrequired

Number of trial starts in this bucket

refundCountintegerrequired

Number of refunds in this bucket

newSubsCountinteger

Number of new subscriptions in this bucket (optional)

Revenue Summary

Aggregated revenue statistics

Revenue Summary

object

Aggregated revenue statistics

currencystringrequired

Base currency for all amounts (converted to this currency)

Example: "USD"

grossRevenueCentsintegerrequired

Total gross revenue in cents (before refunds)

netRevenueCentsintegerrequired

Total net revenue in cents (after refunds)

refundCentsintegerrequired

Total refunds in cents

recurringNetCentsintegerrequired

Total recurring revenue (subscriptions + renewals) in cents

purchaseCountintegerrequired

Number of one-time purchases

subscriptionPurchaseCountintegerrequired

Number of subscription purchases

renewalCountintegerrequired

Number of subscription renewals

refundCountintegerrequired

Number of refunds

cancellationCountintegerrequired

Number of cancellations

positiveChargeCountintegerrequired

Total number of positive charge events

trialCountintegerrequired

Number of trial starts

trialConversionCountintegerrequired

Number of trial conversions

trialConversionRatenumber (double)required

Trial conversion rate as a decimal (0-1). Formula: trialConversionCount / trialCount

Example: 0.8

cancellationRatenumber (double)required

Cancellation rate as a decimal (0-1). Formula: cancellationCount / (renewalCount + subscriptionPurchaseCount)

Example: 0.02

refundRatenumber (double)required

Refund rate as a decimal (0-1). Formula: refundCents / grossRevenueCents

Example: 0.05

mrrCentsintegerrequired

Monthly Run Rate in cents. Formula: (netRevenueCents / spanDays) * 30

averageOrderValueCentsintegerrequired

Average order value in cents. Formula: netRevenueCents / positiveChargeCount

uniqueCancelledSubsintegerrequired

Count of unique subscriptions that were cancelled. Uses subscription_id (Stripe) or original_transaction_id (RevenueCat/Superwall) to deduplicate.

uniqueActiveSubsintegerrequired

Count of unique subscriptions with any subscription-related activity (renewals, purchases, trial conversions, or cancellations). Used as denominator for cancellation rate. Uses subscription_id (Stripe) or original_transaction_id (RevenueCat/Superwall) to deduplicate.

type EventType = "purchase" | "subscription_purchase" | "trial_conversion" | "renewal" | "refund" | "cancellation" | "expiration" | "trial_start";

interface PaginatedRevenue {
  /** Array of revenue events */
  items: RevenueEvent[];
  /** Current page number (1-indexed) */
  page: number;
  /** Number of items per page */
  limit: number;
  /** Total number of items across all pages */
  total: number;
  /** Total number of pages */
  totalPages: number;
  /** Whether there is a next page */
  hasNext: boolean;
  /** Whether there is a previous page */
  hasPrev: boolean;
  /** Revenue summary statistics for the current period */
  summary: RevenueSummary;
  /** Revenue summary statistics for the previous period (only present if prevSince/prevUntil were provided in the request) */
  previousSummary: unknown;
  /** Time series data (only included if includeSeries=true) */
  series?: RevenueSeriesBucket[];
}

interface RevenueEvent {
  /** Unique event identifier */
  id: string;
  /** Workspace identifier */
  workspaceId: string;
  /** Integration identifier if event came from an integration */
  integrationId?: string;
  eventType: EventType;
  /** Transaction amount in cents */
  amountCents: number;
  /** Currency code (ISO 4217) */
  currency: string;
  /** External transaction ID from the provider */
  externalId?: string;
  /** Additional metadata associated with the event */
  metadata?: object;
  /** ISO 8601 timestamp when the event occurred */
  occurredAt: string;
  /** ISO 8601 timestamp when the event was recorded */
  createdAt: string;
  provider?: IntegrationProvider;
}

interface RevenueSeriesBucket {
  /** ISO 8601 timestamp for the start of the time bucket */
  bucketTs: string;
  /** Original currency for this bucket (before conversion) */
  currency: string;
  /** Total positive revenue in cents (purchases + subscriptions + renewals) */
  revenueCents: number;
  /** One-time purchase revenue in cents */
  purchasesCents: number;
  /** Subscription renewal revenue in cents */
  renewalsCents: number;
  /** Trial conversion revenue in cents */
  trialsCents: number;
  /** Refund amount in cents */
  refundsCents: number;
  /** New subscription revenue in cents (optional) */
  newSubsCents?: number;
  /** Number of purchases in this bucket */
  purchaseCount: number;
  /** Number of renewals in this bucket */
  renewalCount: number;
  /** Number of trial conversions in this bucket */
  trialCount: number;
  /** Number of trial starts in this bucket */
  trialStartCount: number;
  /** Number of refunds in this bucket */
  refundCount: number;
  /** Number of new subscriptions in this bucket (optional) */
  newSubsCount?: number;
}

interface RevenueSummary {
  /** Base currency for all amounts (converted to this currency) */
  currency: string;
  /** Total gross revenue in cents (before refunds) */
  grossRevenueCents: number;
  /** Total net revenue in cents (after refunds) */
  netRevenueCents: number;
  /** Total refunds in cents */
  refundCents: number;
  /** Total recurring revenue (subscriptions + renewals) in cents */
  recurringNetCents: number;
  /** Number of one-time purchases */
  purchaseCount: number;
  /** Number of subscription purchases */
  subscriptionPurchaseCount: number;
  /** Number of subscription renewals */
  renewalCount: number;
  /** Number of refunds */
  refundCount: number;
  /** Number of cancellations */
  cancellationCount: number;
  /** Total number of positive charge events */
  positiveChargeCount: number;
  /** Number of trial starts */
  trialCount: number;
  /** Number of trial conversions */
  trialConversionCount: number;
  /** Trial conversion rate as a decimal (0-1). Formula: trialConversionCount / trialCount */
  trialConversionRate: number;
  /** Cancellation rate as a decimal (0-1). Formula: cancellationCount / (renewalCount + subscriptionPurchaseCount) */
  cancellationRate: number;
  /** Refund rate as a decimal (0-1). Formula: refundCents / grossRevenueCents */
  refundRate: number;
  /** Monthly Run Rate in cents. Formula: (netRevenueCents / spanDays) * 30 */
  mrrCents: number;
  /** Average order value in cents. Formula: netRevenueCents / positiveChargeCount */
  averageOrderValueCents: number;
  /** Count of unique subscriptions that were cancelled. Uses subscription_id (Stripe) or original_transaction_id (RevenueCat/Superwall) to deduplicate. */
  uniqueCancelledSubs: number;
  /** Count of unique subscriptions with any subscription-related activity (renewals, purchases, trial conversions, or cancellations). Used as denominator for cancellation rate. Uses subscription_id (Stripe) or original_transaction_id (RevenueCat/Superwall) to deduplicate. */
  uniqueActiveSubs: number;
}

type IntegrationProvider = "revenuecat" | "stripe" | "app_store_connect" | "shopify" | "google_play_console" | "whop" | "paddle" | "woocommerce" | "superwall";