Subscriptions
Recurring billing with automatic lifecycle management.
Subscriptions are under active development and not yet available in the v1 API. The portal endpoints for viewing and managing subscriptions are available now for customers who have subscriptions created internally.
Subscriptions handle recurring billing for your customers. Access automatically schedules reminders, renewals, and expiry based on the billing interval.
Subscription Object
A subscription has the following fields:
| Field | Type | Description |
|---|---|---|
id | string | Unique subscription ID (prefixed sub_) |
status | string | active, past_due, canceled |
billing_interval | string | Monthly or Yearly |
amount | number | Recurring amount in minor units (santim) |
current_period_start | string | ISO 8601 start of the current billing period |
current_period_end | string | ISO 8601 end of the current billing period |
next_billing_date | string | ISO 8601 date of the next renewal |
auto_renew | boolean | Whether the subscription renews automatically |
cancel_at_period_end | boolean | true once a cancel was requested; it ends at current_period_end |
canceled_at | string | null | When the subscription was canceled (or the cancel was requested) |
Subscription Lifecycle
active → past_due → canceled (renewal unpaid)
active → canceled (cancel requested, at period end)Access drives each period from the dates stored on the subscription:
- Invoice: 3 days before
current_period_end, Access issues the next period's invoice and emails it to the customer with payment instructions. - Reminder: 1 day before, if still unpaid, the customer gets a reminder.
- Renewal: paying the invoice moves the subscription to the next period. If it's still unpaid at
current_period_end, the subscription becomespast_dueand the customer is told it will be canceled in 1 day. - Cancellation: still unpaid 1 day after going past due, the subscription is
canceledand the invoice is voided.
Canceling (through the API or the customer portal) keeps the subscription active until current_period_end, sets cancel_at_period_end and auto_renew: false, and voids any open invoice for the next period. It becomes canceled when the period ends. A cancel can't be undone.
Webhook Events
| Event | When |
|---|---|
invoice.created | Next period's invoice issued (3 days before period end) |
invoice.upcoming | Reminder sent (1 day before period end) |
invoice.paid | Invoice paid; the subscription moved to the next period |
invoice.payment_failed | A payment reference couldn't be verified; the invoice stays payable |
invoice.voided | Invoice voided by a cancellation |
customer.subscription.updated | Went past_due, or a cancel was requested |
customer.subscription.canceled | Subscription ended (unpaid, or a requested cancel at period end) |
Customer Portal
Send customers to the hosted Customer Portal to manage their subscription themselves:
- See the subscription, its price and when it renews
- Pay the open invoice and browse past ones
- Cancel, saying why (it ends at the end of the current period)
A cancellation from the portal sends customer.subscription.updated with reason: "cancel_requested" and the customer's cancellation_details (reason and feedback). See Webhooks.
To build your own UI instead, including changing the billing interval and turning auto-renewal off, use the Customer Portal API.
How is this guide?