BillStack Docs

Subscriptions

List, view, cancel, and resume subscriptions

Subscription endpoints are scoped to a project:

/api/billstack/teams/{teamId}/projects/{projectId}/subscriptions

Subscriptions are created via Checkout sessions, not directly through this API. These endpoints are for managing existing subscriptions.

List Subscriptions

GET /subscriptions?activeOnly=true&customerId=pc_xxx&limit=50&offset=0
ParameterTypeDefaultDescription
activeOnlybooleantrueOnly return active/trialing subscriptions
customerIdstringFilter by BillStack customer ID
limitnumber50Max items to return
offsetnumber0Items to skip

Example:

curl "https://your-billstack.com/.../subscriptions?customerId=pc_a1b2c3d4" \
  -H "Authorization: Bearer bs_..."

Response:

{
  "subscriptions": [
    {
      "id": "ps_m3n4o5p6",
      "customerId": "pc_a1b2c3d4",
      "stripeSubscriptionId": "sub_xxx",
      "status": "active",
      "priceId": "pri_i9j0k1l2",
      "quantity": 1,
      "cancelAtPeriodEnd": false,
      "currentPeriodStart": "2026-03-01T00:00:00Z",
      "currentPeriodEnd": "2026-04-01T00:00:00Z",
      "metadata": {},
      "projectId": "proj_abc123",
      "createdAt": "2026-01-01T00:00:00Z",
      "updatedAt": "2026-03-01T00:00:00Z"
    }
  ]
}

Auth: Read access (session or API key with subscriptions:read).


Get Subscription

GET /subscriptions/{subscriptionId}
curl "https://your-billstack.com/.../subscriptions/ps_m3n4o5p6" \
  -H "Authorization: Bearer bs_..."

Response:

{
  "subscription": {
    "id": "ps_m3n4o5p6",
    "customerId": "pc_a1b2c3d4",
    "stripeSubscriptionId": "sub_xxx",
    "status": "active",
    "priceId": "pri_i9j0k1l2",
    "quantity": 1,
    "cancelAtPeriodEnd": false,
    "currentPeriodStart": "2026-03-01T00:00:00Z",
    "currentPeriodEnd": "2026-04-01T00:00:00Z",
    "metadata": {},
    "projectId": "proj_abc123",
    "createdAt": "2026-01-01T00:00:00Z"
  }
}

Auth: Read access.


Cancel at Period End

PATCH /subscriptions/{subscriptionId}
FieldTypeDescription
cancelAtPeriodEndbooleantrue to cancel at end of billing period, false to resume

Cancel:

curl -X PATCH "https://your-billstack.com/.../subscriptions/ps_m3n4o5p6" \
  -H "Authorization: Bearer bs_..." \
  -H "Content-Type: application/json" \
  -d '{ "cancelAtPeriodEnd": true }'

The subscription remains active until the current billing period ends, then transitions to canceled.

Resume:

curl -X PATCH "https://your-billstack.com/.../subscriptions/ps_m3n4o5p6" \
  -H "Authorization: Bearer bs_..." \
  -H "Content-Type: application/json" \
  -d '{ "cancelAtPeriodEnd": false }'

Reactivates a subscription that was previously set to cancel at period end. Only works if the subscription hasn't actually canceled yet.

Auth: Write access (session or API key with subscriptions:write).


Cancel Immediately

DELETE /subscriptions/{subscriptionId}
curl -X DELETE "https://your-billstack.com/.../subscriptions/ps_m3n4o5p6" \
  -H "Authorization: Bearer bs_..."

Response:

{
  "subscription": {
    "id": "ps_m3n4o5p6",
    "status": "canceled",
    "cancelAtPeriodEnd": false
  }
}

Cancels the subscription in Stripe immediately. The customer loses access right away. This cannot be undone — you would need to create a new subscription via checkout.

Auth: Write access.


Subscription Statuses

StatusDescription
activeSubscription is current and paid
trialingIn a free trial period
past_duePayment failed, retrying
canceledSubscription ended
unpaidAll retry attempts exhausted
incompleteFirst payment hasn't been confirmed
incomplete_expiredFirst payment window expired
pausedSubscription paused (if enabled in Stripe)

Subscription status changes are tracked automatically via webhooks — you don't need to poll for updates.

On this page