Multi-phase subscriptions with automatic invoice generation.
The subscription system enables flexible, time-based billing for customers with support for multi-phase pricing, recurring and one-time charges, prorated billing, and automatic invoice generation.
All recurring items within a single subscription phase must have consistent billing intervals. This prevents ambiguity in invoice generation and billing calculations.
Subscriptions automatically transition between phases based on date ranges:
Copy
Phase 1: Trial Period (Day 1-30)├── Basic Plan -- $0/month (overridden from $29/month)└── Setup Fee -- $10 (one-time)Phase 2: Discounted Period (Day 31-365)├── Basic Plan -- $19/month (overridden from $29/month)└── Premium Feature Add-on -- $5/monthPhase 3: Regular Pricing (Day 366+)├── Basic Plan -- $29/month (standard pricing)└── Premium Feature Add-on -- $5/month
At any given time, the subscription has one active phase — the phase whose date range includes the current time. The active phase determines current billing amounts and drives invoice generation.
Phase 1: Discovery and planning (Month 1)├── Discovery Workshop -- $5,000 (one-time)├── Stakeholder Interviews -- $2,000 (one-time)├── Strategic Planning -- $150/hour x 40 hours└── Project Management -- $1,500/monthPhase 2: Implementation (Months 2-4)├── Development Work -- $175/hour x 160 hours/month├── Weekly Progress Meetings -- Included├── Project Management -- $2,500/month└── Cloud Infrastructure -- $500/monthPhase 3: Launch and stabilization (Month 5)├── Launch Support -- $10,000 (one-time)├── On-call Support -- $200/hour (as needed)├── Performance Optimization -- $5,000 (one-time)└── Training Sessions -- $1,000 per session x 4Phase 4: Maintenance and support (Month 6+)├── Monthly Retainer -- $5,000/month (includes 20 hours)├── Additional Hours -- $150/hour (beyond retainer)├── Quarterly Reviews -- Included└── Priority Support SLA -- Included
Subscription box with introductory offer
Copy
Phase 1 (Months 1-3): New subscriber special├── Monthly Box -- $9.99/month (overridden from $39.99)├── Shipping -- FREE (overridden from $5.99)├── Welcome Gift -- $20 value (one-time)└── Exclusive Member Forum -- IncludedPhase 2 (Months 4-12): Regular pricing with loyalty perks├── Monthly Box -- $39.99/month├── Shipping -- $5.99/month├── Quarterly Bonus Item -- $15 value (every 3 months)└── Member Forum -- IncludedPhase 3 (Month 13+): VIP status├── Monthly Box -- $39.99/month├── Shipping -- FREE (reward for loyalty)├── Quarterly Bonus Item -- $25 value├── Early Access -- New products 48hrs early└── VIP Concierge Service -- Included
Enterprise software with usage-based scaling
Copy
Phase 1: Startup plan (0-10 employees)├── Platform License -- $299/month├── Users Included -- Up to 10├── Data Storage -- 100GB included├── API Calls -- 10,000/month included└── Support -- Business hours emailPhase 2: Growth plan (11-50 employees)├── Platform License -- $999/month├── Users Included -- Up to 50├── Data Storage -- 500GB included├── API Calls -- 100,000/month included├── Custom Integrations -- 2 included└── Support -- Priority phone and emailPhase 3: Scale plan (51-200 employees)├── Platform License -- $2,999/month├── Users Included -- Up to 200├── Data Storage -- 2TB included├── API Calls -- 1,000,000/month included├── Custom Integrations -- 5 included├── Advanced Analytics -- Included└── Support -- 24/7 with 1-hour SLAPhase 4: Enterprise (201+ employees)├── Platform License -- Custom negotiated base├── Users -- Unlimited├── Data Storage -- Unlimited├── API Calls -- Unlimited├── Custom Integrations -- Unlimited├── Professional Services -- 40 hours/month included└── Support -- Dedicated team with 15-minute SLA
Always use Time.zone.parse() or Time.current for phase boundaries, not Date.parse() or Date.today. Datetime precision prevents ambiguity in phase transitions.
Sequential phases — ensure the end_date of one phase exactly matches the start_date of the next
Clear transition points — define specific datetimes for phase transitions, considering time zones
Consistent intervals — all recurring items within a phase must have the same interval type and count
Value progression — each phase should provide clear value changes to justify pricing changes
Test your phases — validate that phases connect properly and intervals are consistent before deploying to production
Grace periods — consider buffer time between phases for major pricing increases (but ensure no gaps in datetime terms)
Communication — notify customers before phase transitions that affect pricing
Price override validation — price overrides can be $0.00 (free trials) but not negative
Last phase open-ended — the final phase can have end_date: nil for ongoing subscriptions