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

  1. Navigate to Pricing page
  2. View all available plans
  3. Compare plan features
  4. Select a plan

Via API

Implemented - The /api/billing/plans endpoint 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

  1. Navigate to Pricing page
  2. Review plan details
  3. Click Select Plan on desired plan
  4. 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:

  1. Initiate Checkout: Click "Select Plan"
  2. Stripe Checkout: Redirected to Stripe checkout page
  3. Payment: Enter payment information
  4. Confirmation: Payment processed
  5. Activation: Subscription activated automatically

Checkout via API

Implemented - The /api/billing/checkout endpoint 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

  1. Payment Processed: Stripe processes payment
  2. Webhook Received: AllureLMS receives Stripe webhook
  3. Subscription Created: Subscription record created
  4. Plan Activated: Plan features activated
  5. Confirmation: User redirected to success page

Checking Subscription Status

Implemented - The /api/billing/summary endpoint 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

  1. Assess Needs: Evaluate current and projected usage
  2. Compare Plans: Compare features and costs
  3. Consider Overage: Factor in potential overage costs
  4. Start Conservative: Start with lower plan, upgrade as needed

Checkout Process

  1. Test First: Test with free plan first
  2. Verify Payment: Ensure payment method is valid
  3. Save Receipt: Save Stripe receipt for records
  4. Monitor Activation: Verify subscription activates correctly

Troubleshooting

Checkout Fails

Problem: "Checkout failed" error

  • Solution: Check Stripe configuration
  • Check: Verify STRIPE_SECRET_KEY is 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


Next Steps


Next: Managing Subscriptions → Learn how to manage your subscription