Skip to main content

Overview

SaaS Starter Vue includes a flexible subscription plan system that allows you to:
  • Create multiple pricing tiers
  • Attach features to plans
  • Manage tenant subscriptions
  • Track billing periods
  • Support free and paid plans
Plans are managed from the central domain and assigned to tenants during creation or upgrade.

Plan Structure

Plan Model

Plans are stored in the plans table with the following attributes:

Database Schema

Plan Properties

string
required
Display name of the plan (e.g., “Pro”, “Enterprise”)
string
required
Unique identifier for the plan (e.g., “pro”, “enterprise”)
text
Detailed description of what’s included in the plan
decimal
Plan price with 2 decimal precision (e.g., 29.99)
string
default:"USD"
Currency code (USD, EUR, GBP, etc.)
integer
Billing cycle length in days (30 for monthly, 365 for yearly)
boolean
default:"false"
Whether this is a free plan
boolean
default:"true"
Whether the plan is available for new subscriptions

Managing Plans

List Plans

View all subscription plans:
Endpoint: GET /plans

Create a Plan

Create a new subscription plan:
Endpoint: POST /plans Example Request:

Update a Plan

Modify an existing plan:
Endpoint: PUT /plans/{plan}
Changing plan pricing or features may affect existing subscribers. Consider creating a new plan version instead.

Delete a Plan

Soft delete a plan:
Endpoint: DELETE /plans/{plan}
Plans with active tenants cannot be deleted. You must migrate tenants to another plan first or use soft deletes.

Plan Features

Feature Model

Features can be attached to plans:

Feature Schema

Attaching Features to Plans

Features are attached via a pivot table with values:
The value field stores the feature limit or configuration: Example Features:

Checking Feature Access

Check if a tenant’s plan includes a feature:

Subscriptions

Subscription Model

Tenants can have multiple subscription records:

Subscription Schema

Tenant-Plan Relationship

Plan Assignment

During Tenant Creation

Plans are assigned when creating a tenant:

Guest Registration (Free Plan)

Guest registration automatically assigns the free plan:
Create at least one free plan (price = 0) for guest registration to work properly.

Trial Periods

Tenants can have trial periods before requiring payment:

Setting Trial Period

Checking Trial Status

Stripe Integration

The subscription model includes Stripe fields for payment processing:
string
Stripe subscription ID
string
Stripe subscription status (active, canceled, past_due, etc.)
string
Stripe price ID
Stripe integration requires additional setup. See the Payments documentation for details.

Plan Statistics

View plan usage statistics:

Example Plan Setup

Here’s a complete example of creating a tiered pricing structure:
1

Create Free Plan

2

Create Pro Plan

3

Create Enterprise Plan

Best Practices

  1. Version Plans - Create new plan versions instead of modifying existing ones
  2. Grandfather Existing Customers - Let existing subscribers keep their plan
  3. Clear Descriptions - Make plan differences obvious to customers
  4. Feature Limits - Use the feature system to enforce plan limitations
  5. Trial Periods - Offer trials to increase conversions
  6. Annual Discounts - Use duration_in_days: 365 for annual plans with discounts

Common Patterns

Monthly vs Annual Plans

Create both billing cycles:

Metered vs Flat Pricing

Use the quantity field in subscriptions for metered billing: