The subscription object
string
Unique identifier with
sub_ prefix (e.g., sub_abc123def456).string
The customer’s ID associated with this subscription.
string
How proration is handled:
create_prorations, always_invoice, or none.string
The anchor date for billing cycles (ISO 8601).
string
When the subscription started (ISO 8601).
string
When the subscription ends.
null for ongoing subscriptions.string
When the next invoice will be generated (ISO 8601).
string
The total recurring amount for the subscription.
array
Array of subscription phases.
string
When the subscription was created (ISO 8601).
string
When the subscription was last updated (ISO 8601).
List subscriptions
integer
default:"1"
Page number for pagination. Results are returned 25 items per page.
Response
Get subscription
string
required
The subscription’s ID (e.g.,
sub_abc123def456).Response
Create subscription
string
required
The customer’s ID. Must belong to your account.
string
default:"create_prorations"
How to handle proration. One of:
create_prorations, always_invoice, none.string
The anchor date for billing cycles (ISO 8601 format).
array
required
Array of phase objects. Must include at least one phase.
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
string
required
The subscription’s ID.
string
How to handle proration. One of:
create_prorations, always_invoice, none.string
The anchor date for billing cycles (ISO 8601 format).
Response
Delete subscription
string
required
The subscription’s ID.
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.