サブスクリプション
Subscription機能は、ユーザーが選択したPlanを管理し、Application機能へのアクセスを簡単に制御するのに役立ちます。
ヒント
各PlanはRoleに基づいているため、ユーザーにPlanのRoleを割り当て、権限チェックのためにenforce APIを使用することができます。
Subscriptionは次の3つの方法で作成できます:
- 管理者による手動
- Via the Pricing flow when purchasing a product with pricing and plan information (available for all user types)
- API経由
Any user can create a subscription when purchasing a product, enabling flexible conversion from free to paid tiers. Subscription enforcement (requiring an active subscription for access) only applies to users with type = "paid-user".
Pricing、Plan、Subscription、Product、Paymentの関係は以下の通りです:

サブスクリプションのプロパティ
すべてのサブスクリプションには以下のプロパティがあります:
オーナー名前作成時間表示名説明Duration:サブスクリプションの期間。StartTime:サブスクリプションが効力を発する開始時間。EndTime:サブスクリプションが効力を発する終了時間。Pricing:関連する料金設定。Plan:関連するプラン。Payment:関連する支払い。User:このサブスクリプションを保持するユーザー。State:現在、サブスクリプションには以下の状態があります:Pending、Error、Suspended、Active、Upcoming、Expired。
