
订阅模式在SaaS、媒体、电商等领域广泛应用,主要分为按月、季度、年订阅三种形式。以下是典型案例:
Netflix 采用按月订阅,提供不同套餐(基础/标准/高级),利用自动续费减少用户流失。年订阅通常提供折扣,例如“年付省15%”。
Adobe Creative Cloud 提供月付和年付选项,年订阅可节省约20%。季度订阅较少见,但适合短期项目需求。
The New York Times 新闻类订阅强调年费优惠,首年折扣高达50%,后续自动恢复原价,利用价格锚定效应。
from django.db import models
class SubscriptionPlan(models.Model):
name = models.CharField(max_length=100) # 如"基础版"
duration = models.CharField(
max_length=10,
choices=[('month', '月'), ('quarter', '季'), ('year', '年')]
)
price = models.DecimalField(max_digits=6, decimal_places=2)
stripe_price_id = models.CharField(max_length=100) # 支付系统ID
def __str__(self):
return f"{self.name} ({self.get_duration_display()})"def calculate_prorated_price(old_plan, new_plan, days_used):
"""
计算从月订阅升级到年订阅的差价
old_plan: 当前订阅计划对象
new_plan: 目标订阅计划对象
days_used: 当前周期已使用天数
"""
daily_rate = float(old_plan.price) / 30
credit = daily_rate * days_used
return float(new_plan.price) - creditimport stripe
stripe.api_key = "your_api_key"
def create_subscription(customer_id, price_id):
subscription = stripe.Subscription.create(
customer=customer_id,
items=[{'price': price_id}],
payment_behavior='default_incomplete',
expand=['latest_invoice.payment_intent']
)
return subscription折扣策略
年订阅价格通常满足:12*月价 > 年价 > 9*月价,确保用户感知到优惠。季度订阅定价建议为:3*月价 > 季价 > 2.5*月价。
续费提醒 在订阅到期前7天、3天、当天发送邮件/SMS提醒:
from datetime import timedelta
def send_reminder(subscription):
expiry_date = subscription.end_date
reminders = [
(expiry_date - timedelta(days=7), "7天后到期"),
(expiry_date - timedelta(days=3), "3天后到期"),
(expiry_date, "今天到期")
]
for date, msg in reminders:
if timezone.now().date() == date:
send_email(subscription.user, msg)取消订阅流程 提供暂停而非立即终止选项,保留用户数据3-6个月,降低流失率。代码实现需包含挽留优惠:
def cancel_subscription(user):
plan = user.subscription.plan
if plan.duration == 'year' and user.subscription.active_days < 30:
offer_discount(20) # 未满30天提供20%折扣挽留MRR (月经常性收入)
def calculate_mrr():
monthly = Subscription.objects.filter(plan__duration='month').count()
yearly = Subscription.objects.filter(plan__duration='year').count()
return monthly*monthly_price + yearly*(yearly_price/12)Churn Rate (流失率)
def churn_rate(start_date, end_date):
lost_users = User.objects.filter(
subscription__end_date__range=(start_date, end_date),
subscription__auto_renew=False
).count()
total_users = User.objects.filter(subscription__isnull=False).count()
return (lost_users / total_users) * 100LTV (用户生命周期价值) 公式:
其中ARPA(每用户平均收入)计算:
def arpa():
return Subscription.objects.aggregate(
avg_revenue=models.Avg('plan__price')
)['avg_revenue']