Skip to content

fix(webadmin): subscription metrics only track 2 of 7 Stripe products #10770

Description

@beastoin

Problem

The web admin dashboard subscription routes hardcode two Stripe price IDs (STRIPE_UNLIMITED_MONTHLY_PRICE_ID, STRIPE_UNLIMITED_ANNUAL_PRICE_ID). All other products are invisible to the dashboard.

Missing products (5 of 7)

  • Omi Unlimited v2
  • Operator
  • Omi Architect
  • Omi Plus
  • Neo
  • Enterprise

Affected routes

Route Impact
revenue/route.ts MRR/ARR undercounted — only sums 2 price IDs
subscriptions/route.ts Subscription count misses 5 products
mrr-trends/route.ts Historical MRR trend chart undercounts
subscription-trends/route.ts New subscription trend misses 5 products
profitability/route.ts Per-platform MRR and conversion undercounted
app-subscriptions/route.ts Subs from missing products leak into "non-Omi" bucket

Status filter too narrow

revenue and subscriptions routes query only status: 'active'. Standard SaaS MRR should include active + past_due (Stripe is still retrying payment; subscription is intact). trialing should be excluded from MRR but shown separately.

Root cause

Code was written when Omi had one product (Unlimited monthly + annual). As new products launched, these routes were never updated.

Correct approach

  1. Query all subscriptions without price-ID filtering (stripe.subscriptions.list with status: 'active' and status: 'past_due')
  2. Group by product using item.price.product — no hardcoded product IDs
  3. Compute MRR per product: monthly as-is, annual ÷ 12 (detect via price.recurring.interval)
  4. Show trialing subscriptions as a separate pipeline metric, not in MRR
  5. New products added to Stripe appear automatically — no env var or code change needed

by AI for @beastoin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    In review

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions