Skip to main content

Subscriptions

The Subscriptions API lets you read and manage recurring purchases in your store — cancel them, resume a pending cancellation, or switch a customer to a different variant of the same product.

Overview

The Subscriptions API provides endpoints to:

A subscription represents a recurring purchase made by a customer. Each record carries the customer (its owner), the current variant (price), the originating order, and the cycle and cancellation dates.

Status

Every subscription carries a status:

StatusMeaning
trialingInside the trial period
activeTrial ended, billing succeeds
past_dueLatest renewal payment failed; retries are in progress
canceledThe subscription has ended
incompleteFirst payment is still pending or requires customer authentication
incomplete_expiredThe first payment was abandoned
unpaidRetries have stopped after past_due; access typically revoked

The list endpoint's status filter accepts these values.

Cancellation

Cancelling a subscription stops billing. By default it takes effect at the end of the current billing period — the customer keeps access until current_period_end. Pass immediately: true to cut access right away. There is no pause action.

A subscription in past_due is always cancelled immediately because there is no period-end grace for an unpaid subscription.

The read response carries an is_cancelable boolean that reflects whether a cancel request would succeed for the subscription in its current state.

Change plan

POST /subscriptions/{id}/change-plan switches the subscription to a different variant of the same product. The change is transactional and prorated; the proration is invoiced immediately. If the proration payment is declined, the plan change does not take effect and the endpoint returns 422 with the decline reason.

Includes

GET /subscriptions/{id} accepts an include query parameter that expands related sections in the same call:

IncludeReturns
customerMinimal customer projection: id, email, name
variantFull product variant (same shape GET /product-variants/{id} returns)
productLean product projection: id, name, checkout_url
orderLean originating-order projection: id, status, created_at
renewalsRecorded renewal payments
upcoming_invoicePreview of the next invoice. Opt in only when you need it — see below.

Sections that are not requested are returned as null; the keys are always present so the response shape stays stable.

The upcoming_invoice include triggers a call to the payment provider. If that call fails, the field is returned as null rather than failing the whole request.