Managing Subscriptions
Managing Subscriptions
✅ Implemented - Customer portal access and subscription management via Stripe Customer Portal are fully implemented in AllureLMS.
Learn how to manage your AllureLMS subscription, including plan changes, cancellations, and the customer portal.
Overview
This guide covers:
- Accessing the customer portal
- Changing plans
- Canceling subscriptions
- Updating payment methods
- Viewing billing history
Prerequisites
- Active subscription
- Admin or super_admin role
- Access to billing dashboard
Customer Portal
Accessing the Portal
The Stripe Customer Portal provides self-service subscription management.
Via Web UI:
- Navigate to Admin → Billing
- Click Manage Billing
- Redirected to Stripe Customer Portal
Via API:
✅ Implemented - The
/api/billing/portalendpoint creates Stripe Customer Portal sessions for subscription management.
curl -X POST https://your-domain.com/api/billing/portal \
-H "Authorization: Bearer <your-jwt-token>"
Requirements:
- Admin or super_admin role required
- Active subscription with Stripe customer ID
- Valid authentication token
Response:
{
"url": "https://billing.stripe.com/session/..."
}
Redirect user to url for Stripe Customer Portal.
Error Response (No Subscription):
{
"error": "No active subscription found. Please subscribe to a plan first."
}
Portal Features
The customer portal allows you to:
- Update payment method
- Change subscription plan
- View billing history
- Download invoices
- Cancel subscription
Changing Plans
Upgrade/Downgrade
Via Customer Portal:
- Access customer portal
- Click Change Plan
- Select new plan
- Confirm change
- Plan change takes effect immediately or at next billing cycle
Via API (Direct):
# Note: Direct plan changes may require Stripe API integration
# Check API reference for current implementation
Plan Change Effects
Upgrade:
- Immediate access to new features
- Prorated billing for remainder of period
- Higher included units available immediately
Downgrade:
- Takes effect at next billing cycle
- Current period continues with current plan
- Usage limits apply after downgrade
Canceling Subscriptions
Via Customer Portal
- Access customer portal
- Navigate to Subscription
- Click Cancel Subscription
- Confirm cancellation
- Subscription remains active until period end
Cancellation Effects
- Immediate: Subscription marked as "canceled"
- Access: Features remain until period end
- Billing: No further charges after period end
- Data: All data retained
- Reactivation: Can reactivate before period end
Reactivating Subscription
- Access customer portal
- Click Reactivate Subscription
- Subscription reactivated immediately
- Billing resumes
Updating Payment Methods
Via Customer Portal
- Access customer portal
- Navigate to Payment Methods
- Click Add Payment Method or Update
- Enter new payment information
- Save changes
Payment Method Requirements
- Valid credit/debit card
- Billing address
- Card expiration date
- CVV code
Viewing Billing History
Via Customer Portal
- Access customer portal
- Navigate to Billing History
- View past invoices
- Download PDF invoices
Via API
# Note: Billing history may be available via Stripe API
# Check API reference for current implementation
Subscription Status
Status Types
- trial: Free trial period
- active: Active paid subscription
- canceled: Canceled but active until period end
- past_due: Payment failed, retrying
- unpaid: Payment failed, access may be restricted
Checking Status
curl -X GET https://your-domain.com/api/billing/summary \
-H "Authorization: Bearer <your-jwt-token>"
Response includes:
{
"status": "active",
"trial_ends_at": null,
"activated_at": "2025-01-15T10:00:00Z"
}
Best Practices
Subscription Management
- Monitor Usage: Track usage to avoid overage
- Review Regularly: Review subscription quarterly
- Plan Ahead: Upgrade before hitting limits
- Keep Updated: Keep payment method current
Plan Changes
- Assess First: Evaluate if plan change is needed
- Check Timing: Consider billing cycle timing
- Understand Effects: Know what changes with plan
- Test Features: Test new features after upgrade
Troubleshooting
Can't Access Portal
Problem: "Failed to create portal session"
- Solution: Check Stripe configuration
- Check: Verify
STRIPE_SECRET_KEYis set - Try: Ensure Stripe customer ID exists
Plan Change Fails
Problem: "Plan change failed" error
- Solution: Check Stripe subscription status
- Check: Verify payment method is valid
- Try: Contact support
Payment Method Update Fails
Problem: "Payment method update failed"
- Solution: Verify card information is correct
- Check: Ensure card is not expired
- Try: Use different payment method
Related Documentation
- Subscribing to Plans - Subscribe to plans
- Usage Tracking - Track usage
- Webhook Setup - Configure webhooks
Next Steps
- Usage Tracking → Track your usage
- Webhook Setup → Configure webhooks
- Billing Reports → View billing reports
Next: Usage Tracking → Learn how to track usage and overage