For the complete documentation index, see llms.txt. This page is also available as Markdown.

Subscriptions

The Subscriptions API is the public surface for the recurring side of the commerce model. Subscriptions are stored locally and (when the tenant has a billing integration) mirrored into the connected billing system; this API speaks to the local row and delegates lifecycle effects (proration, mid-cycle credits, dunning) to the active billing adapter.

The endpoints fall into three groups:

  • Discovery / readGET /subscriptions, GET /subscriptions/{id}, GET /accounts/{id}/subscriptions for portals and dashboards.

  • CreatePOST /subscriptions for net-new sign-ups; bind to a contactId or organizationId.

  • Lifecyclecancel, change-plan, renew. Each runs through the policy / business-rule engine before being applied. Use the matching Preview endpoints first if the customer-facing UI needs to show effective dates, proration, or retention requirements before committing.

All writes require the commerce scope; reads require read. Every state change writes an audit log entry (subscription.create / subscription.update / subscription.cancel / subscription.change_plan / subscription.renew) and emits an event for subscribed webhooks.

Endpoints

GET /api/v1/accounts/{id}/subscriptions

List subscriptions for an account via the billing adapter

get
/accounts/{id}/subscriptions
Authorizations
X-API-KeystringRequired

Scoped API key. Scopes: read, commerce, admin.

Path parameters
idstringRequired
Query parameters
limitinteger · min: 1 · max: 100Optional

Max items to return (1–100, default 20)

Default: 20
offsetintegerOptional

Number of items to skip (default 0)

Default: 0
sortstringOptional

Field to sort by

sortDirstring · enumOptional

Sort direction

Default: ascPossible values:
Responses
200

Paginated list of subscriptions

get/accounts/{id}/subscriptions

No content

Returns every subscription owned by the given account, sourced from the active billing adapter (fetchSubscriptions). Use this for customer-portal "your subscriptions" lists where you want the adapter as the source of truth (status, current term, next billing date).

Requires the read scope.

GET /api/v1/subscriptions

List all subscriptions for the tenant

get
/subscriptions
Authorizations
X-API-KeystringRequired

Scoped API key. Scopes: read, commerce, admin.

Query parameters
limitinteger · min: 1 · max: 100Optional

Max items to return (1–100, default 20)

Default: 20
offsetintegerOptional

Number of items to skip (default 0)

Default: 0
sortstringOptional

Field to sort by

sortDirstring · enumOptional

Sort direction

Default: ascPossible values:
statusstringOptional

Filter by status

Responses
200

Paginated list of subscriptions

get/subscriptions

No content

Tenant-wide list of every local subscription row, intended for back-office reconciliation. For account-scoped portal views prefer GET /accounts/{id}/subscriptions, which goes through the billing adapter and reflects the source-of-truth status.

Requires the read scope.

POST /api/v1/subscriptions

Create a new subscription

post
/subscriptions
Authorizations
X-API-KeystringRequired

Scoped API key. Scopes: read, commerce, admin.

Header parameters
Idempotency-KeystringOptional

Idempotency key to safely retry without creating duplicates

Body
productIdstringRequired
contactIdstringOptional
organizationIdstringOptional
priceCentsintegerOptional
currencystringOptional
billingIntervalstringOptional
externalIdstringOptional
Responses
201

Subscription created

No content

post/subscriptions

No content

Creates a new subscription for (productId, contactId | organizationId). Provide priceCents / currency / billingInterval to override the catalog defaults — useful for negotiated deals — otherwise the values are resolved from the product's catalog plan.

When the tenant has an active billing integration, supply externalId to record the corresponding subscription id in the connected system; the platform will use it to correlate future webhook events from the adapter.

Requires the commerce scope. Returns 201 and a nextActions hint pointing at POST /payments (for the first invoice).

GET /api/v1/subscriptions/{id}

Get subscription details

get
/subscriptions/{id}
Authorizations
X-API-KeystringRequired

Scoped API key. Scopes: read, commerce, admin.

Path parameters
idstringRequired
Responses
200

Subscription details

No content

get/subscriptions/{id}
200

Subscription details

No content

Returns the full local subscription row plus its current adapter-side status when an integration is configured. Returns 404 when the id is not owned by the calling tenant.

Requires the read scope.

POST /api/v1/subscriptions/{id}/cancel

Cancel a subscription

post
/subscriptions/{id}/cancel
Authorizations
X-API-KeystringRequired

Scoped API key. Scopes: read, commerce, admin.

Path parameters
idstringRequired
Responses
200

Subscription cancelled

No content

post/subscriptions/{id}/cancel
200

Subscription cancelled

No content

Cancels the subscription. The effective date and refund / credit behavior are determined by the matching cancellation business rule (see POST /preview/cancellation to compute it ahead of time). The platform then forwards the cancel call to the active billing adapter.

If a retention save flow is enabled for the tenant, this endpoint can also accept an inline feedback object captured from the cancellation form; that record is written to cancellation_feedback for analytics regardless of whether the cancel proceeds.

Requires the commerce scope. Writes subscription.cancel to the audit log.

POST /api/v1/subscriptions/{id}/change-plan

Change the plan for a subscription (update product, price, interval)

post
/subscriptions/{id}/change-plan
Authorizations
X-API-KeystringRequired

Scoped API key. Scopes: read, commerce, admin.

Path parameters
idstringRequired
Body
productIdstringOptional
priceCentsintegerOptional
billingIntervalstringOptional
Responses
200

Plan changed

No content

post/subscriptions/{id}/change-plan
200

Plan changed

No content

Moves the subscription to a different product / price / billing interval. Proration, effective date, and any required co-term behavior come from the matching plan-change business rule — preview them with POST /preview/plan-change before committing.

When connected to a billing adapter, the change is forwarded to the adapter's amendment / subscription-update flow; the platform record is updated only after the adapter confirms.

Requires the commerce scope. Writes subscription.change_plan to the audit log.

POST /api/v1/subscriptions/{id}/renew

Renew a subscription

post
/subscriptions/{id}/renew
Authorizations
X-API-KeystringRequired

Scoped API key. Scopes: read, commerce, admin.

Path parameters
idstringRequired
Responses
200

Subscription renewed

No content

post/subscriptions/{id}/renew
200

Subscription renewed

No content

Forces an immediate renewal of the subscription's current term — useful for renew-on-demand UIs and for back-office "extend the customer for another year" actions. Without an explicit call, renewal happens automatically on the term boundary.

Requires the commerce scope. Writes subscription.renew to the audit log.

Last updated

Was this helpful?