ModulesDecision memoUpdated 2026-03-02

Subscription Management

Full lifecycle management for tenant subscriptions with multi-currency pricing, promotional discounts, upgrade/downgrade impact analysis, trials, expiry handling, and comprehensive analytics export.

Buyer-readyFounder-grade detailModules

Subscriptions are the bridge between tenants and editions. They define which plan a tenant is on, when it starts and expires, and how the system behaves when the subscription lifecycle changes. With built-in multi-currency pricing and promotional discount tracking, SCRIPE provides everything you need for monetization.

Subscription Lifecycle

Every subscription follows a well-defined state machine. The system automatically enforces valid transitions and emits domain events at each stage for audit and integration purposes.

Subscription Status Lifecycle
Pending
Start trial
Trial
Convert
Active
Suspend
Suspended
Expired
Cancelled

Subscription Types

TypeDurationUse Case
StandardFixed period with expiry dateRegular commercial subscriptions
TrialShort-term evaluation periodFree trials that auto-convert or expire
Add-onSupplementary to main subscriptionAdditional feature packs (e.g., extra storage)

Key Operations

  • Assign Subscription

    Link a tenant to an edition with start date, duration, currency, optional promo code, and auto-renewal configuration.

  • Upgrade Plan

    Move a tenant to a higher edition. New features are available immediately and the subscription period can be adjusted.

  • Downgrade Plan

    Move to a lower edition. The system provides a full impact analysis showing which features will be lost before confirming.

  • Impact Analysis

    Before any downgrade, the API returns a detailed analysis of affected features and current usage — preventing surprise data loss.

Expiry Behavior

PolicyBehaviorUse Case
Grace PeriodFeatures remain active for N days after expiryGive customers time to renew
Immediate BlockFeatures disabled the moment subscription expiresStrict quota enforcement
Fallback EditionAutomatically downgrade to the default (free) editionFreemium models with paid upgrades

Enterprise Subscription Management

  • Immutable Renewal Audit Trail

    Renewals create NEW subscription rows instead of overwriting existing records. Each billing cycle preserves locked-in pricing for precise MRR trends, churn analysis, and financial audit compliance.

  • Intelligent Promotion Expiry

    Time-bound promotions are automatically tracked via PromotionExpiresAt. Expired promotions are stripped on renewal — new pricing takes effect seamlessly without admin intervention.

  • Race-Condition Protection

    Optimistic concurrency stamps on every subscription prevent mid-air collisions between parallel operations. Enterprise-grade data integrity without performance penalties.

  • Pipeline-Level Validation

    All 8 subscription commands are guarded by FluentValidation validators with fully localized error messages in English and Arabic. Invalid requests are rejected before business logic executes.

  • Cross-Module Admin Integration

    Subscription lifecycle events automatically cascade to Identity management. When suspended, all tenant admins are deactivated. On resume, only subscription-suspended admins are reactivated.

API Endpoints

MethodEndpointDescriptionAuth
GET/api/subscriptionsList all subscriptions🔒 Required
POST/api/subscriptions/assignAssign subscription to tenant🔒 Required
PUT/api/subscriptions/{id}/upgradeUpgrade subscription edition🔒 Required
PUT/api/subscriptions/{id}/downgradeDowngrade subscription edition🔒 Required
GET/api/subscriptions/{id}/downgrade-impactAnalyze downgrade impact🔒 Required
PUT/api/subscriptions/{id}/suspendSuspend subscription🔒 Required
PUT/api/subscriptions/{id}/reactivateReactivate subscription🔒 Required
PUT/api/subscriptions/{id}/cancelCancel subscription🔒 Required