Usage Tracking and Overage
Usage Tracking and Overage
✅ Implemented - Usage tracking for SCORM sessions is implemented and accessible via the billing summary endpoint.
Learn how AllureLMS tracks usage, calculates overage, and manages metered billing for features like SCORM.
Overview
This guide covers:
- Understanding usage tracking
- Metered billing model
- Viewing usage data
- Overage calculations
- Usage reports
Prerequisites
- Active subscription with metered billing
- Admin or super_admin role
- Understanding of billing model
Understanding Usage Tracking
Metered Billing
AllureLMS uses metered billing for certain features:
- Base Fee: Monthly subscription fee
- Included Units: Units included in base fee
- Overage: Additional units charged separately
- Meter: What is being measured (e.g., SCORM sessions)
Current Metering
SCORM Sessions:
- Each SCORM package launch = 1 unit
- Tracked per tenant
- Reset monthly with billing cycle
Viewing Usage
Via Web UI
- Navigate to Admin → Billing
- View usage dashboard
- See current period usage
- View overage (if any)
Via API
✅ Implemented - Usage data is included in the
/api/billing/summaryresponse from thescorm_tenant_usagetable.
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",
"usage": {
"tenant_id": "tenant-uuid",
"current_period_units": 1250,
"included_units": 1000
}
}
Note: Usage data comes from the scorm_tenant_usage table and tracks SCORM session launches per tenant.
Usage Calculation
How Usage is Tracked
SCORM Sessions:
- User launches SCORM package
- Session created in SCORM API
- Usage incremented in
scorm_tenant_usagetable - Usage aggregated per billing period
Usage Aggregation
Usage is aggregated:
- Per Tenant: All users in tenant contribute to usage
- Per Period: Reset each billing cycle
- Real-time: Updated as usage occurs
Overage Calculation
Overage Formula
Overage Units = Current Period Units - Included Units
Overage Cost = Overage Units × Overage Unit Cost
Example
Plan:
- Monthly Fee: $99
- Included Units: 1,000 SCORM sessions
- Overage Cost: $0.10 per session
Usage:
- Current Period: 1,250 sessions
- Overage: 1,250 - 1,000 = 250 sessions
- Overage Cost: 250 × $0.10 = $25.00
Total Bill:
- Base Fee: $99.00
- Overage: $25.00
- Total: $124.00
Usage Reports
Current Period Usage
curl -X GET https://your-domain.com/api/billing/summary \
-H "Authorization: Bearer <your-jwt-token>"
Historical Usage
# Note: Historical usage may require additional endpoints
# Check API reference for current implementation
SCORM Usage Details
✅ Implemented - The
/api/scorm/packages/usageendpoint provides detailed SCORM usage statistics.
curl -X GET https://your-domain.com/api/scorm/packages/usage \
-H "Authorization: Bearer <your-jwt-token>"
Requirements:
- Admin or super_admin role required
- Valid authentication token
Response:
{
"usage": {
"total_sessions": 1250,
"current_period_sessions": 1250,
"by_package": [
{
"package_id": "package-uuid",
"package_title": "SCORM Package 1",
"sessions": 500
}
]
}
}
Note: This endpoint aggregates SCORM session data from the scorm_sessions table.
Managing Usage
Monitoring Usage
- Regular Checks: Check usage weekly
- Set Alerts: (If available) Set usage alerts
- Track Trends: Monitor usage trends
- Plan Ahead: Anticipate usage spikes
Reducing Usage
- Optimize Content: Use fewer SCORM packages
- Combine Activities: Combine related content
- Cache Sessions: Reuse sessions when possible
- Review Necessity: Remove unused SCORM packages
Upgrading Plans
If consistently hitting limits:
- Review usage patterns
- Calculate overage costs
- Compare to next tier pricing
- Upgrade if cost-effective
Best Practices
Usage Management
- Monitor Regularly: Check usage weekly
- Set Budgets: Set usage budgets
- Track Trends: Understand usage patterns
- Optimize: Optimize content to reduce usage
Cost Optimization
- Right-Size Plan: Choose plan matching usage
- Minimize Overage: Stay within included units
- Review Periodically: Review plan quarterly
- Factor Overage: Include overage in budget
Troubleshooting
Usage Not Tracking
Problem: Usage not updating
- Solution: Check SCORM session creation
- Check: Verify usage tracking is enabled
- Try: Review SCORM API logs
Incorrect Usage Count
Problem: Usage count seems wrong
- Solution: Review usage calculation logic
- Check: Verify session counting
- Try: Contact support for audit
Overage Not Calculated
Problem: Overage not showing
- Solution: Check billing period dates
- Check: Verify overage calculation
- Try: Wait for next billing cycle
Related Documentation
- Subscribing to Plans - Understand plans
- Managing Subscriptions - Manage subscription
- SCORM Tracking - SCORM usage details
Next Steps
- Webhook Setup → Configure billing webhooks
- Managing Subscriptions → Manage subscription
- Billing Reports → View reports
Next: Webhook Setup → Learn how to configure Stripe webhooks