Creating a Subscription
Subscription Fields
| Field | Required | Description |
|---|---|---|
customer_id | ✅ | Customer to subscribe |
plan_id | ✅ | Plan to subscribe to |
billing_interval | ✅ | day, week, month, or year |
start_date | ✅ | When the subscription begins |
trial_end_date | Override the plan’s default trial end date |
Subscription States
| Status | Description |
|---|---|
TRIAL | Free trial period; no invoices generated |
ACTIVE | Normal billing; invoices generated each period |
PAST_DUE | A bill wasn’t paid; access may be restricted |
PAUSED | Billing temporarily stopped |
CANCELED | Subscription ended; no future invoices |
Billing Period
Each subscription has:current_period_start— Start of the active billing windowcurrent_period_end— When the next invoice will be generated
current_period_end <= now, it:
- Generates an invoice
- Advances the period to the next interval
Viewing a Subscription
Listing Subscriptions
status and/or customer_id.