Skip to content

Billing & Subscription Overview

EaseLab operates on a software-as-a-service subscription model. Laboratories pay for platform access, feature tiers, and usage limits separately from patient billing (invoices for tests) managed in the tenant portal.

Two billing contexts

mermaid
flowchart TB
    subgraph SaaS["Lab → EaseLab (SaaS)"]
        PLAN[Subscription plan]
        PAY[Payment gateway]
        SUB[Subscription status]
    end
    subgraph Patient["Lab → Patient"]
        INV[Invoices]
        RCPT[Receipts]
        REF[Referrals]
    end
    PLAN --> SUB
    SUB -->|locked| RO[Read-only mode]
    INV --> RCPT
ContextWhere managedPurpose
SaaS subscription/billing/*, /admin/subscriptionPlatform access
Patient invoices/invoicesClinical services revenue

This section documents SaaS billing only.

Subscription routes

RouteScreen
/billing/plansCompare and select plans
/billing/checkout/:planIdPayment checkout
/billing/historyPast payments and invoices
/billing/returnPayment provider return handler
/admin/subscriptionUsage and limits dashboard

Tenant payment states

StatusMeaning
TrialFree evaluation period
CurrentActive paid subscription
OverduePeriod ended, grace may apply
UnpaidTrial ended without conversion
CancelledChurned account

Platform admins can also lock tenants from the admin portal.

Trial and conversion

mermaid
stateDiagram-v2
    [*] --> Trial: Registration
    Trial --> Current: Subscribe / activate plan
    Trial --> Unpaid: Trial expires
    Current --> Overdue: Renewal fails
    Overdue --> Current: Payment success
    Unpaid --> Current: Subscribe
    Current --> Cancelled: Cancel

When trial expires without subscription:

  • IsLocked = true
  • Read-only mode engages
  • Billing routes remain accessible for checkout

Plan tiers

Plans define feature flags and quotas (see Usage & Limits):

Feature examplePlan gating
Analyzer integrationHigher tiers
User seatsPer-plan cap
SMS volumeMonthly quota
Collection centersBranch limit
Storage / backupsRetention days

Compare plans on /billing/plans before checkout.

Payment flow

  1. Owner selects plan.
  2. Checkout collects payment method (Payment Methods).
  3. Gateway processes charge.
  4. Webhook confirms subscription activation.
  5. Lock cleared — full write access restored.

Development environments may use /billing/dev-pay for simulated payments.

Billing contact

Keep billing email current in Account Settings — renewal failures trigger read-only mode.

UI indicators

ComponentBehavior
Trial bannerCountdown to trial end
Read-only bannerLock reason + subscribe CTA
Subscription adminUsage meters vs limits

Exempt API paths during lock

These remain writable or accessible for recovery:

  • /auth, /billing, /tenant
  • /public patient endpoints
  • Payment webhooks

Laboratory mutations (POST/PUT/PATCH/DELETE on clinical routes) return 403 with TENANT_READONLY.

Platform vs tenant billing

ActorPortal
Lab ownerLab portal /billing/*
EaseLab operationsAdmin portal tenant billing

Platform staff adjust plans, credits, and locks via Platform Administration.

Ease Lab — Cloud Pathology Lab Management