# Stripe MRR Reconciliation & Churn Audit Kit

Stop wondering why your Stripe dashboard, spreadsheet and database show three different MRR numbers. Explicit rules for prorations, annual normalization, VAT, dunning and coupons, plus a zero-dependency TypeScript normalizer.

Source: https://founder2.com/packs/stripe-mrr-reconciliation

---

<!-- file: RECONCILIATION_RULES.md -->

## RECONCILIATION_RULES.md

# Stripe MRR Reconciliation Rules

Two SaaS dashboards rarely show the exact same MRR because Stripe documents API fields, not accounting choices. Pick one explicit rule per edge case, write it down here, and keep your code aligned to it.

## 1. Subscription status inclusion
- Include: `active` and `past_due` (only inside your grace window, typically 7–14 days of active dunning).
- Exclude: `trialing`, `incomplete`, `incomplete_expired`, `canceled`, `unpaid`, and `paused`.

## 2. Billing interval normalization
- Monthly: `unit_amount * quantity / interval_count`
- Yearly: `(unit_amount * quantity) / (12 * interval_count)`
- Weekly: `(unit_amount * quantity * 52) / (12 * interval_count)`
- Daily: `(unit_amount * quantity * 365) / (12 * interval_count)`

## 3. Discounts and coupons
- Recurring `forever` or `repeating` discounts: subtract from active MRR while the discount applies.
- One-time `once` coupon on an annual invoice: amortize across 12 months (or explicitly exclude and document the choice).

## 4. Prorations and one-off invoice items
- Never count proration line items as recurring MRR. They reflect mid-cycle adjustments, not steady-state monthly commitment.
- Never count one-time setup fees or usage overages in base MRR; track metered usage separately as variable recurring revenue.

## 5. Taxes and multi-currency FX
- Always strip VAT/GST/sales tax (use `subtotal_excluding_tax` or pre-tax price amounts). Tax is pass-through liability, not revenue.
- Normalize non-USD subscriptions to your reporting currency using a fixed monthly FX snapshot so exchange-rate drift does not look like expansion or contraction.

## 6. Voluntary vs. involuntary churn
- Log `cancellation_details.reason` on every canceled subscription so involuntary failed-card churn is tracked separately from voluntary product churn.

---

<!-- file: edge-cases.csv -->

## edge-cases.csv

```csv
edge_case,stripe_object,naive_bug,recommended_rule,mrr_impact_direction
Annual plan billed upfront,subscription.items.price.recurring.interval=year,Counting full annual cash in Month 1 MRR,Divide net annual amount by 12,Overstates MRR by 12x if wrong
Mid-cycle upgrade proration,invoice.lines.proration=true,Adding proration charge into MRR,Ignore proration line; read new steady-state subscription item,Inflates expansion MRR
Failed renewal in dunning,subscription.status=past_due,Counting delinquent accounts forever,Include up to 14 days in dunning then exclude as involuntary churn,Masks churn for 30+ days
Tax-inclusive EU pricing,invoice.tax / price.tax_behavior=inclusive,Counting VAT as SaaS MRR,Strip tax before computing MRR and LTV,Overstates MRR by 19%-25%
100% off founder/beta coupon,subscription.discount.coupon.percent_off=100,Counting list price instead of net price,Multiply by (1 - percent_off/100) while coupon is active,Invents phantom MRR
Scheduled cancel at period end,subscription.cancel_at_period_end=true,Dropping MRR immediately vs at period end,Keep in active MRR until period end and flag in Pending Churn,Timing mismatch vs Stripe UI
Multi-currency EUR/GBP plans,subscription.currency,Mixing raw cents across currencies,Convert to base currency with fixed monthly FX table,Creates fake expansion/contraction
```

---

<!-- file: mrr-recompute.ts -->

## mrr-recompute.ts

```ts
/**
 * Deterministic Stripe subscription MRR normalizer (zero external dependencies).
 * Feed normalized subscription items from Stripe's /v1/subscriptions endpoint.
 * Source: https://founder2.com/packs/stripe-mrr-reconciliation
 */

export type BillingInterval = "day" | "week" | "month" | "year";

export interface NormalizedSubItem {
  subscriptionId: string;
  customerId: string;
  status: "active" | "past_due" | "trialing" | "canceled" | "paused" | "unpaid" | "incomplete";
  daysPastDue?: number;
  unitAmountCents: number;
  quantity: number;
  interval: BillingInterval;
  intervalCount: number;
  /** Discount percentage currently active (0-100). */
  percentOff?: number;
  /** Tax rate baked into unitAmountCents when tax_behavior === "inclusive" (e.g. 20 for 20% VAT). */
  inclusiveTaxPct?: number;
  /** FX multiplier to convert subscription currency into reporting currency (1.0 for USD->USD). */
  fxToBase?: number;
}

const MONTHS_PER_INTERVAL: Record<BillingInterval, number> = {
  month: 1,
  year: 12,
  week: 12 / 52,
  day: 12 / 365,
};

export function itemMonthlyCents(item: NormalizedSubItem, maxPastDueDays = 14): number {
  if (item.status !== "active") {
    if (item.status !== "past_due") return 0;
    if ((item.daysPastDue ?? 0) > maxPastDueDays) return 0;
  }

  const gross = item.unitAmountCents * Math.max(0, item.quantity);
  const netOfDiscount = gross * (1 - Math.min(100, Math.max(0, item.percentOff ?? 0)) / 100);
  const taxRate = Math.max(0, item.inclusiveTaxPct ?? 0) / 100;
  const exTax = taxRate > 0 ? netOfDiscount / (1 + taxRate) : netOfDiscount;
  const periodMonths = MONTHS_PER_INTERVAL[item.interval] * Math.max(1, item.intervalCount);
  const monthlyLocal = exTax / periodMonths;
  return Math.round(monthlyLocal * (item.fxToBase ?? 1));
}

export function summarizeMrr(items: NormalizedSubItem[], maxPastDueDays = 14) {
  let totalMrrCents = 0;
  const activeCustomers = new Set<string>();
  let excludedPastDue = 0;

  for (const item of items) {
    const cents = itemMonthlyCents(item, maxPastDueDays);
    if (cents > 0) {
      totalMrrCents += cents;
      activeCustomers.add(item.customerId);
    } else if (item.status === "past_due" && (item.daysPastDue ?? 0) > maxPastDueDays) {
      excludedPastDue += 1;
    }
  }

  return {
    mrrUsd: Number((totalMrrCents / 100).toFixed(2)),
    arrUsd: Number(((totalMrrCents * 12) / 100).toFixed(2)),
    payingCustomers: activeCustomers.size,
    arpaUsd: activeCustomers.size > 0 ? Number((totalMrrCents / 100 / activeCustomers.size).toFixed(2)) : 0,
    excludedPastDue,
  };
}
```

---

<!-- file: cohort-retention.csv -->

## cohort-retention.csv

```csv
month,starting_mrr,new_mrr,expansion_mrr,contraction_mrr,churned_mrr,ending_mrr,monthly_nrr_pct,monthly_grr_pct,quick_ratio
2026-08,12000,2400,600,150,450,14400,100.0%,95.0%,5.00
2026-09,14400,2600,720,200,520,17000,100.0%,95.0%,4.61
2026-10,17000,2900,850,180,610,19960,100.4%,95.4%,4.75
2026-11,19960,3100,1100,210,640,23310,101.3%,95.7%,4.94
```

---

<!-- file: skills/stripe-mrr-audit/SKILL.md -->

## skills/stripe-mrr-audit/SKILL.md

---
name: stripe-mrr-audit
description: Audit a SaaS billing codebase or Stripe export for MRR calculation bugs: proration inflation, annual normalization, VAT inclusion, past_due dunning masks, coupon discounts, and NRR/GRR cohort math.
---

# Stripe MRR & Churn Audit Skill

Use this skill when inspecting billing sync code, MRR dashboards, or subscription analytics queries against Stripe data.

## Audit Checklist
1. Verify annual and weekly intervals divide into monthly equivalents cleanly (never count upfront annual invoice cash as Month 1 MRR).
2. Confirm proration invoice items (`proration === true`) and one-off setup charges are excluded from recurring MRR.
3. Confirm tax-inclusive prices strip VAT/GST before computing MRR, gross profit, and LTV.
4. Check `past_due` handling: cap inclusion at a strict grace window (7–14 days) and separate involuntary card-failure churn from voluntary cancellations.
5. Verify NRR excludes New Logo MRR (`(start + expansion - contraction - churn) / start`) and GRR excludes both New and Expansion MRR.
6. Flag any discrepancy against the Stripe Billing dashboard with the exact subscription IDs responsible.
