M
Meza AI

💳 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

FieldTypeDescriptionRequired
subscription_idStringUnique subscription identifierYes
account_idStringCustomer accountYes
plan_idStringLinks to Plan ModelYes
typeStringSubscription typeYes
valid_fromTimestampStart dateYes
valid_untilTimestampEnd date (null if ongoing)No

Subscription Types

Meza AI recognizes these subscription types:

free

Free tier accounts

trial

Time-limited trials

paid

Paying customers

poc

Proof of concept

partner

Partner accounts

internal

Internal/test accounts

Configuration Steps

1

Navigate to Data Models

Go to ConfigurationData Models.

2

Configure Subscription Model

Click Configure on the Subscription Model card.

3

Write Query

Write SQL to retrieve subscription data with account linkage.

4

Map Fields

Map columns including subscription type.

5

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

Configure the Plans Model to define plan features and limits that subscriptions reference.

What's Next?