The subscription object
List subscriptions
Response
Get subscription
Response
Create subscription
How to handle proration. One of:
create_prorations, always_invoice, none.Simple subscription
Response
Multi-phase subscription (trial then paid)
Create a subscription with a trial phase followed by a paid phase:Error responses
Customer not found
Price not found
Missing phases
Update subscription
Response
Delete subscription
204 No Content on successful deletion.
Proration behavior values
Subscription phases
Subscriptions support multiple phases to handle complex billing scenarios:- Trial phases: Free or discounted periods at the start of a subscription.
- Promotional phases: Temporary discounts or special pricing.
- Plan changes: Scheduled upgrades or downgrades.
- Ongoing phases: Indefinite billing with no end date.
Phase rules
All recurring items within a phase must have the same interval (e.g., all monthly). Phases cannot overlap and must be sequential without gaps.
- Phases must have at least one item.
- All recurring items within a phase must have the same interval.
- Phases cannot overlap.
- Phases must be sequential without gaps (if an end date is specified).
- Only one phase can be active at any time.
Billing cycle anchor
Thebilling_cycle_anchor determines when recurring invoices are generated:
- If set, invoices are generated relative to this date.
- If not set, invoices are generated relative to the subscription start date.
- Useful for aligning billing to specific dates (e.g., 1st of the month).
Automatic invoice generation
When a subscription is created:- An initial invoice may be generated based on proration behavior.
- Recurring invoices are automatically generated on billing dates.
- The
next_billing_datefield shows when the next invoice will be created.
Integration example
Sandbox support
The API respects sandbox scoping. If your API token is associated with a sandbox, you can only access subscriptions created in that sandbox. Subscriptions created in sandbox mode will be isolated from production data.