Appearance
Packages & Plans
Subscription packages define what each lab tenant can access: user limits, analyzer integration, SMS quotas, and feature flags. Platform admins manage packages; tenants subscribe through the billing portal.
Package structure
| Field | Description |
|---|---|
| Name | Display name (e.g. Starter, Professional, Enterprise) |
| Slug | Internal identifier |
| Price | Monthly or annual amount |
| Billing cycle | Monthly, yearly |
| Trial days | Default trial length for new signups |
| Is active | Whether shown on pricing page |
| Is free | Zero-cost plan (activate without payment) |
| Sort order | Display position on pricing page |
Feature limits
Plans can enforce usage limits checked at runtime:
| Limit type | Example enforcement |
|---|---|
| Max users | Block new staff creation |
| Max invoices / month | Soft warning or hard block |
| Analyzer integration | 403 on analyzer routes if not included |
| SMS credits | Campaign send blocked when exhausted |
| Collection centers | Cap on multi-branch locations |
Limits are evaluated by IPlanFeatureService before restricted operations.
Managing packages
Platform admins use Admin Portal → Plans:
| Action | API |
|---|---|
| List plans | GET /admin/plans |
| Create plan | POST /admin/plans |
| Update plan | PUT /admin/plans/{id} |
| Deactivate | Set isActive = false |
Requires platform.plans.manage permission.
Assigning plans to tenants
| Method | Who | How |
|---|---|---|
| Self-service | Tenant owner | Plans & Checkout |
| Manual | Platform admin | Tenant detail → Billing section |
| Free activation | Tenant | POST /billing/activate-free for free-tier plans |
Subscription lifecycle
mermaid
stateDiagram-v2
[*] --> Trial: Register
Trial --> Active: Payment confirmed
Trial --> Locked: Trial expired
Active --> Locked: Subscription expired
Locked --> Active: Renew / subscribe| Status | Tenant experience |
|---|---|
| Active trial | Full access until trialEndsAt |
| Active paid | Full access until expiresAt |
| Locked | Read-only; billing routes still work |
Pricing page
Public pricing is available at /pricing in the marketing site. Plans marked isActive appear automatically. Tenants compare features and start checkout.
Usage monitoring
Tenants view current usage at Admin → Subscription or GET /billing/usage:
| Metric | Description |
|---|---|
| Users | Current vs limit |
| Invoices | Count this billing period |
| SMS | Sent vs quota |
See Usage & Limits.