Create a subscription plan
Create a new subscription plan with one or more pricing variations.
A subscription plan defines the billing structure for subscriptions. Each plan can have multiple variations (e.g., monthly vs. yearly), and each variation can have multiple billing phases (e.g., trial period followed by regular billing).
How subscription plans work
A subscription plan consists of three hierarchical levels:
- Plan: The top-level container with a name (e.g., "Pro Plan")
- Variations: Different pricing options within the same plan (e.g., monthly vs. yearly)
- Phases: Sequential billing stages within each variation (e.g., trial → regular billing)
Understanding phases
Phases execute in sequence based on their ordinal value (1, 2, 3, etc.):
- Each phase has a
cycle_duration(e.g.,P1Mfor monthly) - Each phase has a
cycle_countthat determines how many cycles before moving to the next phase - If
cycle_countisnullor omitted, the phase continues indefinitely - When a phase completes its cycles, the subscription moves to the phase with the next
ordinal - If the last phase completes its cycles and no next phase exists, the subscription is automatically stopped
Example
A plan with a 7-day trial followed by monthly billing:
- Phase 1 (
ordinal=1):cycle_duration=P7D,cycle_count=1,amount=0 - Phase 2 (
ordinal=2):cycle_duration=P1M,cycle_count=null,amount=9900
After 1 week (1 cycle), the subscription moves from phase 1 to phase 2 and bills monthly indefinitely.
Request
Response
Subscription plan created successfully