Billing & Plans
Levelcast offers four plans. Limits are enforced both in the API (402 LIMIT_REACHED) and in the UI (cards, alerts and the PremiumUpsellModal).
Plans at a glance
| Feature | Free | Pro | Clinic | Founder |
|---|---|---|---|---|
| Price | 0€ | 1,99€/mo or 19,90€/yr | 29€ + 2€/patient | — |
| Patients | 4 | 20 | ∞ (pay per use) | ∞ |
| Rules | 5 | 50 | 50 | 50 |
| Actions per rule | 3 | 3 | 3 | 3 |
| Screens (Frames) | 2 | ∞ | ∞ | ∞ |
| Shared Links | 2 | ∞ | ∞ | ∞ |
| API Keys | 1 | ∞ | ∞ | ∞ |
| Organizations – create | 0 (join ∞) | ∞ | ∞ | ∞ |
| Retention | ∞ | ∞ | ∞ | ∞ |
| Support | Community | Priority | SLA + DPA | — |
Free can join unlimited organizations but cannot create them. Clinic includes 20 seats, then +2€ per extra patient per month.
How enforcement works
Every POST /api/v1/* checks canCreate* from billingService.ts:
const check = await canCreatePatient(userId)if (!check.allowed) return 402 { code: 'LIMIT_REACHED', limit, used, plan }Frontend mirrors with billingStore.limits (normalized from null → Infinity) and shows ApiStatCard + Alert + PremiumUpsellModal instead of toasts.
Rule execution logs
GET /api/v1/rules/:id/logs shows executions from the last 30 days, or the latest 2000 records when there is nothing recent. Old rows are kept; only reads are scoped. Each rule supports up to 3 actions (MAX_ACTIONS_PER_RULE), executed in executionOrder.
Stripe
- Checkout via
POST /api/v1/billing/checkout(plan: pro|clinic,interval: month|year,seatsfor clinic). - Mock checkout when
STRIPE_SECRET_KEY=dummy→ instanttrialingupgrade (used in CI and local dev). - Customer portal:
POST /api/v1/billing/portal→stripe.billingPortal.sessions.create. - Webhooks:
invoice.payment_failed→past_due,customer.subscription.deleted→ downgrade tofree(founder staysfounder).customer.subscription.updated/createdsyncsstatusandcurrentPeriodEnd. - Cancel:
POST /api/v1/billing/cancel→cancel_at_period_endif Stripe, otherwise immediate downgrade.
Invoices
GET /api/v1/billing/invoices proxies stripe.invoices.list({ customer, limit: 10 }) and maps {id, number, status, amount_due, hosted_invoice_url, invoice_pdf, created}. Shown in Billing → Historial de facturas.
Referrals
- Code via
GET /api/v1/billing/referral(referralCode). - Claim via
POST /api/v1/billing/referral/claim { code }. - Reward: 2 months Pro for both sides on first paid conversion, max 10/year, anti-abuse on email/IP.
Grandfather (Founder)
Users with user.createdAt < 2026-08-21 are founder (PLAN_LIMITS.founder = 50 rules, rest ∞ + isGrandfathered). Shown as FOUNDER in the sidebar (AppSidebar.vue:40).