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

Subscriptions

A subscription is an ongoing commitment from an account to a plan.


GET /api/v1/subscriptions

List all subscriptions in this tenant.

  • Auth scope: read

Response 200

{
  "data": [
    {
      "id": "sub_01H...",
      "tenantId": "ten_01H...",
      "productId": "prod_01H...",
      "contactId": null,
      "organizationId": "org_01H...",
      "priceCents": 4900,
      "currency": "USD",
      "billingInterval": "month",
      "status": "active",
      "currentPeriodStart": "2026-04-01T00:00:00Z",
      "currentPeriodEnd": "2026-05-01T00:00:00Z",
      "createdAt": "2026-04-01T00:00:00Z"
    }
  ],
  "nextActions": [
    { "rel": "createSubscription", "method": "POST", "href": "/api/v1/subscriptions" }
  ]
}

cURL


POST /api/v1/subscriptions

Create a subscription.

  • Auth scope: commerce

Body

Field
Type
Required
Description

productId

UUID

yes

Product to subscribe to

contactId

UUID

no

Subscriber contact

organizationId

UUID

no

Account

priceCents

integer

no

Override price in cents

currency

string (≤10)

no

Defaults to USD

billingInterval

string (≤50)

no

e.g. month, year

externalId

string (≤255)

no

External billing-system reference

Response 201

cURL


GET /api/v1/subscriptions/{id}

Retrieve a subscription.

  • Auth scope: read

Response 200

Same shape as the data field returned by POST.

Errors

Status
When

404

Subscription not found in this tenant

cURL


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

Change a subscription's plan. The platform evaluates plan_change policies first; a blocking policy returns 403.

  • Auth scope: commerce

Body

Field
Type
Description

productId

UUID

New product

priceCents

integer

New price

billingInterval

string (≤50)

New interval

All fields are optional, but you should provide at least one.

Response 200

Same shape as GET. Audit-log entry: api.subscription.changePlan.

Errors

Status
When

403

A plan_change policy blocked the operation

404

Subscription not found

cURL


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

Change a charge's quantity (or includedUnits) on a subscription. Routes through the plan-dependency engine so dependent charges adjust automatically.

  • Auth scope: commerce

Body

Field
Type
Required
Description

accountId

string

yes

Billing-system account ID

chargeId

string

yes

Billing-system charge ID

newQuantity

integer ≥ 0

yes

Target quantity

editedField

quantity | includedUnits

no

Defaults to quantity

catalogChargeId

string

no

Local catalog charge ID for resolver hints

integrationId

string

no

Pin a specific integration; defaults to active

Response 200

Errors

Status
When

400

Validation failed; no billing integration; adapter lacks self-service

403

Subscription does not belong to this account

404

Subscription not found

cURL


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

Cancel a subscription. Evaluates subscription_cancel policies first.

  • Auth scope: commerce

Body

None required. Cancellation timing follows the matched cancellation business rule (immediate or at_period_end).

Response 200

Same shape as GET, with status: "cancelled".

Errors

Status
When

403

A cancellation policy blocked the operation

404

Subscription not found

cURL


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

Renew a subscription for one period. For paid subscriptions, a processing payment session is recorded; the provider's webhook finalizes it.

  • Auth scope: commerce

Response 200

paymentSessionId is null for free renewals.

Errors

Status
When

404

Subscription not found

cURL


Last updated

Was this helpful?