Subscribing to Pricing Plans
Subscribing to Pricing Plans
✅ Implemented - Plan subscription, checkout flow, and free plan activation are fully implemented in AllureLMS.
Learn how to subscribe to AllureLMS pricing plans, including plan selection, checkout flow, and subscription activation.
Overview
This guide covers:
- Understanding pricing plans
- Selecting a plan
- Checkout process
- Subscription activation
- Plan management
Prerequisites
- Admin or super_admin role
- Understanding of billing model
- (For paid plans) Payment method ready
Understanding Pricing Plans
Plan Types
AllureLMS offers different pricing plans:
- Free/Trial: Limited features, no charge
- Starter: Basic features, monthly fee
- Professional: Advanced features, monthly fee + usage
- Enterprise: Custom pricing, full features
Plan Features
Plans include:
- Monthly Fee: Base subscription fee
- Included Units: Included usage (e.g., SCORM launches)
- Overage Cost: Cost per unit over included amount
- Metering: How usage is tracked (e.g., SCORM sessions)
Viewing Available Plans
Via Web UI
- Navigate to Pricing page
- View all available plans
- Compare plan features
- Select a plan
Via API
✅ Implemented - The
/api/billing/plansendpoint is public and returns all active pricing plans.
curl -X GET https://your-domain.com/api/billing/plans
Note: This endpoint is public and does not require authentication.
Response:
{
"plans": [
{
"id": "plan-uuid",
"slug": "starter",
"name": "Starter Plan",
"description": "Plan description",
"meter": "scorm_sessions",
"monthly_fee": 99.00,
"included_units": 1000,
"overage_unit_cost": 0.10,
"metadata": {
"stripe_price_id": "price_...",
"stripe_product_id": "prod_..."
},
"is_active": true,
"created_at": "2025-01-15T10:00:00Z",
"updated_at": "2025-01-15T10:00:00Z"
}
]
}
Selecting a Plan
Via Web UI
- Navigate to Pricing page
- Review plan details
- Click Select Plan on desired plan
- Redirected to checkout
Plan Selection Considerations
- Current Usage: Review current usage to estimate needs
- Growth Projection: Plan for future growth
- Feature Requirements: Ensure plan includes needed features
- Budget: Consider monthly costs and overage
Checkout Process
Stripe Checkout
AllureLMS uses Stripe for payment processing:
- Initiate Checkout: Click "Select Plan"
- Stripe Checkout: Redirected to Stripe checkout page
- Payment: Enter payment information
- Confirmation: Payment processed
- Activation: Subscription activated automatically
Checkout via API
✅ Implemented - The
/api/billing/checkoutendpoint creates Stripe checkout sessions for paid plans and activates free plans immediately.
curl -X POST https://your-domain.com/api/billing/checkout \
-H "Authorization: Bearer <your-jwt-token>" \
-H "Content-Type: application/json" \
-d '{
"pricing_plan_slug": "starter"
}'
Requirements:
- Admin or super_admin role required
- Valid authentication token
- Plan must exist in database
Response (Paid Plans):
{
"url": "https://checkout.stripe.com/c/pay/cs_test_..."
}
Redirect user to url for Stripe checkout.
Response (Free Plans):
{
"status": "activated",
"plan": "free"
}
Free plans activate immediately without Stripe checkout.
Free Plan Activation
✅ Implemented - Free plans (monthly_fee <= 0) activate immediately without Stripe checkout.
Free plans activate immediately without Stripe:
curl -X POST https://your-domain.com/api/billing/checkout \
-H "Authorization: Bearer <your-jwt-token>" \
-H "Content-Type: application/json" \
-d '{
"pricing_plan_slug": "free"
}'
Response:
{
"status": "activated",
"plan": "free"
}
The subscription is immediately activated in the database without requiring payment.
Subscription Activation
Activation Flow
- Payment Processed: Stripe processes payment
- Webhook Received: AllureLMS receives Stripe webhook
- Subscription Created: Subscription record created
- Plan Activated: Plan features activated
- Confirmation: User redirected to success page
Checking Subscription Status
✅ Implemented - The
/api/billing/summaryendpoint returns current subscription status and usage data.
curl -X GET https://your-domain.com/api/billing/summary \
-H "Authorization: Bearer <your-jwt-token>"
Requirements:
- Admin or super_admin role required
- Valid authentication token
Response:
{
"plan": {
"slug": "starter",
"name": "Starter Plan",
"meter": "scorm_sessions",
"monthly_fee": 99.00,
"included_units": 1000,
"overage_unit_cost": 0.10
},
"status": "active",
"trialEndsAt": null,
"activatedAt": "2025-01-15T10:00:00Z",
"stripeCustomerId": "cus_...",
"stripeSubscriptionId": "sub_...",
"usage": {
"tenant_id": "tenant-uuid",
"current_period_units": 750,
"included_units": 1000,
"overage_units": 0
}
}
Note: If no subscription exists, plan will be null and status will be "trial".
Success and Cancel Pages
Success Page
After successful checkout:
- User redirected to
/billing/success - Success message displayed
- Links to billing dashboard and main dashboard
- Session ID shown for reference
Cancel Page
If checkout cancelled:
- User redirected to
/billing/cancel - Cancellation message displayed
- Options to return to pricing or dashboard
Best Practices
Plan Selection
- Assess Needs: Evaluate current and projected usage
- Compare Plans: Compare features and costs
- Consider Overage: Factor in potential overage costs
- Start Conservative: Start with lower plan, upgrade as needed
Checkout Process
- Test First: Test with free plan first
- Verify Payment: Ensure payment method is valid
- Save Receipt: Save Stripe receipt for records
- Monitor Activation: Verify subscription activates correctly
Troubleshooting
Checkout Fails
Problem: "Checkout failed" error
- Solution: Check Stripe configuration
- Check: Verify
STRIPE_SECRET_KEYis set - Try: Check browser console for errors
Subscription Not Activating
Problem: Payment processed but subscription not active
- Solution: Check Stripe webhook configuration
- Check: Verify webhook endpoint is accessible
- Try: Manually trigger webhook or contact support
Wrong Plan Activated
Problem: Different plan activated than selected
- Solution: Contact support to correct
- Check: Verify plan slug in checkout request
- Try: Cancel and re-subscribe to correct plan
Related Documentation
- Managing Subscriptions - Manage your subscription
- Usage Tracking - Track usage and overage
- Webhook Setup - Configure Stripe webhooks
- Billing Summary API - API reference
Next Steps
- Managing Subscriptions → Manage your subscription
- Usage Tracking → Track usage
- Webhook Setup → Configure webhooks
Next: Managing Subscriptions → Learn how to manage your subscription