Subscription Plans
Subscription Plans
Section titled “Subscription Plans”Plan Comparison
Section titled “Plan Comparison”| Feature | Basic | Pro | Clínica | Trial | Forever Free |
|---|---|---|---|---|---|
| Doctors | 2 | 8 | Unlimited | 8 | Unlimited |
| Staff users | 1 | 1 | Unlimited | 1 | Unlimited |
| WhatsApp chatbot | ✓ | ✓ | ✓ | ✓ | ✓ |
| Analytics dashboard | ✗ | ✓ | ✓ | ✓ | ✓ |
| Patient CSV export | ✗ | ✓ | ✓ | ✓ | ✓ |
| Patient CSV import | ✗ | ✓ | ✓ | ✓ | ✓ |
| Quick user switching | ✗ | ✗ | ✓ | ✗ | ✓ |
| ICS calendar feeds | ✓ | ✓ | ✓ | ✓ | ✓ |
| Appointment reminders | ✓ | ✓ | ✓ | ✓ | ✓ |
| Daily agenda | ✗ | ✓ | ✓ | ✓ | ✓ |
Plan Details
Section titled “Plan Details”Temporary access for evaluation. Expires after a set number of days (configured per invite code). Same features as Pro. Converts to a paid plan via the Billing page.
Entry-level paid plan. Ideal for solo practitioners. Limited to 2 doctors and 1 staff user.
Mid-tier plan. Up to 8 doctors, analytics, and patient import/export. Best for growing clinics.
Clínica
Section titled “Clínica”Top-tier plan. Unlimited doctors and staff users. Designed for multi-doctor clinics with reception teams.
Forever Free
Section titled “Forever Free”Superadmin-granted plan with permanent access and unlimited features. Used for partner clinics, demos, and beta customers. Cannot be purchased — only granted via the superadmin API.
Enforcement
Section titled “Enforcement”Plan limits are enforced server-side in Express middleware:
- Doctor limit:
checkDoctorLimitmiddleware onPOST /api/doctors - User limit:
checkUserLimitmiddleware onPOST /api/users - Feature gates:
requirePlan('pro', 'clinica', 'trial')middleware on analytics and import/export endpoints
The middleware checks the live database on every request — changing a clinic’s plan takes effect immediately without requiring a new JWT.
Upgrade Flow
Section titled “Upgrade Flow”- Clinic staff visits the Suscripción (Billing) page in the dashboard
- Clicks the plan they want → redirected to LemonSqueezy checkout (
VITE_LS_URL_*env vars) - Completes payment on LemonSqueezy
- LemonSqueezy sends
order_createdwebhook toPOST /webhooks/lemonsqueezy - Webhook handler validates signature, matches
variant_idto plan, updates clinic’ssubscription_planin the database - Next API request with the old JWT will get the updated plan (live DB check)
Subscription Expiry
Section titled “Subscription Expiry”All paid plans (Basic, Pro, Clínica) have a subscription_expires_at date. On every API request, requireActiveSubscription checks:
if subscription_plan !== 'forever_free' && subscription_expires_at < now(): return 402 Subscription ExpiredWhen expired, staff can still log in but all protected API calls return 402. They must renew via the Billing page.
Trial plans work the same way — they expire on the date set when the invite code was generated.
Manual Plan Changes (Superadmin)
Section titled “Manual Plan Changes (Superadmin)”To manually change a clinic’s plan:
curl -X PATCH https://api.clinicflow.lat/api/superadmin/clinics/{clinicId} \ -H "X-Admin-Key: {SUPER_ADMIN_KEY}" \ -H "Content-Type: application/json" \ -d '{"plan": "pro", "expiresInDays": 365}'See Superadmin Operations Guide for more.