A subscription bills a customer the same items every period, from your catalog's recurring prices. Each period is billed when it starts: charged to the customer's saved card, or invoiced to them. A failed charge is retried 3, 5 and 7 days after the billing date; if the last retry fails, the subscription is canceled.
Attributes
| Name | Type | Description |
|---|---|---|
id | string | Unique identifier, starting sub_. |
object | string | Always subscription. |
livemode | boolean | true in live mode. |
customer | string | Who it bills, cust_.... |
name | string | What the customer sees. |
status | enum | scheduled, trialing, incomplete (waiting for a card), active, past_due, paused, canceled or ended. |
currency | string | usd. |
line_items | array | What each period bills: each a recurring price and a quantity. |
amount | integer | What each period comes to, in cents, tax included. |
interval | object | The billing cycle: unit (day, week, month or year) and count. |
collection | enum | charge_automatically (the saved card) or send_invoice. |
days_until_due | integer or null | For send_invoice: 0, 7, 14 or 30. |
start_date | date | When it started, or starts. |
trial_end | date or null | When its trial ends. |
end_date | date or null | When it ends on its own. |
next_billing_date | date or null | Its next billing date. |
cancel_at_period_end | boolean | Set to cancel when the period ends. |
canceled_at | timestamp or null | When it was canceled. |
paused_at | timestamp or null | When billing was paused. |
resumes_on | date or null | When a pause ends on its own. |
created | timestamp | When it was created. |
Example
Endpoints
| Endpoint | What it does |
|---|---|
POST /v1/subscriptions | Start billing a customer on a schedule. |
GET /v1/subscriptions/{id} | Get a subscription by its ID. |
POST /v1/subscriptions/{id} | Change its name, description, items, tax or notes, from the next billing date. |
POST /v1/subscriptions/{id}/pause | Stop billing until you resume it, or until a date. |
POST /v1/subscriptions/{id}/resume | Start billing a paused subscription again. |
POST /v1/subscriptions/{id}/cancel | Cancel now, or at the end of the current period. |
POST /v1/subscriptions/{id}/keep | Take back a cancel set for the end of the period. |
GET /v1/subscriptions | List your subscriptions, newest first. |