💳 Subscription Model
Track customer subscriptions and billing information.
Overview
The Subscription Model tracks actual subscriptions linked to customer accounts. This includes plan details, subscription type (free, trial, paid), validity periods, and billing dimensions.
Use subscription data to understand customer lifecycle stages, identify trial conversions, and spot accounts approaching renewal.
Key Fields
| Field | Type | Description | Required |
|---|---|---|---|
subscription_id | String | Unique subscription identifier | Yes |
account_id | String | Customer account | Yes |
plan_id | String | Links to Plan Model | Yes |
type | String | Subscription type | Yes |
valid_from | Timestamp | Start date | Yes |
valid_until | Timestamp | End date (null if ongoing) | No |
Subscription Types
Meza AI recognizes these subscription types:
freeFree tier accounts
trialTime-limited trials
paidPaying customers
pocProof of concept
partnerPartner accounts
internalInternal/test accounts
Configuration Steps
Navigate to Data Models
Go to Configuration → Data Models.
Configure Subscription Model
Click Configure on the Subscription Model card.
Write Query
Write SQL to retrieve subscription data with account linkage.
Map Fields
Map columns including subscription type.
Save Model
Test and save the model.
Example SQL Query
SELECT
id AS subscription_id,
account_id,
plan_id,
CASE
WHEN trial_ends_at > NOW() THEN 'trial'
WHEN plan_id IS NULL THEN 'free'
ELSE 'paid'
END AS type,
started_at AS valid_from,
canceled_at AS valid_until,
-- Optional
mrr,
billing_cycle
FROM subscriptions
WHERE status != 'deleted'Subscription Metrics
Once configured, Meza AI calculates:
- Current Subscription Type — Active subscription status
- Days Until Renewal — Time until subscription ends
- Trial Days Remaining — For trial accounts
- Subscription Age — How long they've been a customer
✅ Tip