Skip to main content
This workflow manages the complete SaaS subscription lifecycle from team creation through active subscription, including trial periods, grace periods, and restricted access.

Overview

Taskr uses a seat-based subscription model with the following key features:
  • 30-day free trial with full feature access
  • 7-day grace period after trial ends (before restrictions)
  • Seat-based billing synced with Stripe
  • Feature restrictions when billing is not set up

Subscription States

Trial

30-day free trial with full access to all features

Grace Period

7-day window after trial ends to set up billing

Restricted

Read-only access until billing is configured

Active

Paid subscription with full feature access

Workflow Diagram

Status Timeline

Feature Restrictions by Status

Implementation Details

Trial Status Service

The core logic lives in trial-status-service.ts:

Creating a Trial Subscription

When a new team is created, a trial subscription is automatically provisioned:

Automated Status Transitions

1

Trial Expires

Cron job detects trials past their trialEndDate and transitions them to grace_period.
2

Grace Period Expires

Teams past their graceEndDate without billing setup are transitioned to restricted.
3

Billing Setup Complete

After successful Stripe Checkout, the subscription becomes active.

Middleware Enforcement

Feature restrictions are enforced via tRPC middleware:

Frontend Integration

Seat-Based Billing

Taskr uses per-seat billing where the subscription cost scales with team size.

Seat Counting

Stripe Synchronization

When a new member is added:
  1. Member record created in database
  2. Seat count incremented
  3. Stripe subscription quantity updated
  4. Prorated charge applied
When a member is removed:
  1. Member status set to inactive
  2. Seat count decremented
  3. Stripe subscription quantity updated
  4. Prorated credit applied
Daily cron ensures seat counts match between database and Stripe:

Email Notifications

Extending Trials

Sales and support can extend trials for specific teams:
Trial extensions also reset the grace period end date to maintain the 7-day buffer after the new trial end date.

Database Schema

API Endpoints

Stripe Webhook Events

Billing Setup

Configure billing and subscription settings

Team Management

Add and remove team members (affects seat count)