> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scrubbe.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Plans, Billing, and Subscription Management

> View available Scrubbe plans, start a Stripe checkout session, manage active subscriptions, and cancel when needed through the API.

Scrubbe offers a range of plans to fit teams of every size, from individual developers exploring the platform to large enterprises with advanced incident management needs. This page explains how to view plans, subscribe, and manage your subscription through the API.

## Available plans

Retrieve the full list of plans and their features at any time. This endpoint is public and does not require authentication.

```http theme={null}
GET /api/v1/pricing/plans
```

```bash cURL theme={null}
curl --request GET \
  --url https://api.scrubbe.com/api/v1/pricing/plans
```

Scrubbe offers four plan tiers:

<CardGroup cols={2}>
  <Card title="Free" icon="circle">
    Get started at no cost. Includes core incident tracking with limited team seats and API access. No credit card required.
  </Card>

  <Card title="Starter" icon="rocket">
    For small teams managing a growing number of incidents. Includes additional seats, SLA tracking, and email notifications.
  </Card>

  <Card title="Professional" icon="briefcase">
    For teams that need advanced automation, Slack integration, postmortems, and full API access with higher rate limits.
  </Card>

  <Card title="Enterprise" icon="building">
    For organizations that require custom SLAs, dedicated support, SSO, and volume pricing. Contact sales to get a custom quote.
  </Card>
</CardGroup>

<Note>The **Free** plan never expires and does not require a payment method. You can upgrade to a paid plan at any time from your account settings or through the checkout flow below.</Note>

## Start a checkout session

To subscribe to a paid plan, create a Stripe checkout session. Scrubbe uses Stripe to handle all payment processing securely. You will receive a checkout URL to redirect your user to.

```http theme={null}
POST /api/v1/pricing/checkout/create-session
```

<CodeGroup>
  ```json Request body theme={null}
  {
    "planId": "PLAN_ID",
    "successUrl": "https://app.yourcompany.com/billing/success",
    "cancelUrl": "https://app.yourcompany.com/billing/cancel"
  }
  ```

  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.scrubbe.com/api/v1/pricing/checkout/create-session \
    --header 'Authorization: Bearer YOUR_TOKEN' \
    --header 'Content-Type: application/json' \
    --data '{
      "planId": "PLAN_ID",
      "successUrl": "https://app.yourcompany.com/billing/success",
      "cancelUrl": "https://app.yourcompany.com/billing/cancel"
    }'
  ```
</CodeGroup>

The response includes a `url` field. Redirect your user to that URL to complete payment on Stripe's hosted checkout page. Once the user completes checkout, Stripe redirects them to your `successUrl`.

<Tip>Use the `GET /api/v1/pricing/plans` response to get the correct `planId` for the plan your user selected before creating a checkout session.</Tip>

## Create a subscription directly

If you are managing subscriptions programmatically — for example, from a server-side integration — you can create a subscription directly without a Stripe checkout session.

```http theme={null}
POST /api/v1/pricing/subscriptions
```

```json Request body theme={null}
{
  "planId": "PLAN_ID",
  "userId": "USER_ID"
}
```

## View your subscriptions

### Current user subscriptions

Retrieve the subscriptions associated with the currently authenticated user:

```http theme={null}
GET /api/v1/pricing/customers
```

```bash cURL theme={null}
curl --request GET \
  --url https://api.scrubbe.com/api/v1/pricing/customers \
  --header 'Authorization: Bearer YOUR_TOKEN'
```

### Subscriptions for a specific user

If you are an admin retrieving subscriptions for another user, pass their user ID in the path:

```http theme={null}
GET /api/v1/pricing/customers/:userId/subscriptions
```

```bash cURL theme={null}
curl --request GET \
  --url https://api.scrubbe.com/api/v1/pricing/customers/USER_ID/subscriptions \
  --header 'Authorization: Bearer YOUR_TOKEN'
```

### Subscription statuses

A subscription can be in one of the following states:

| Status      | Description                                                                    |
| ----------- | ------------------------------------------------------------------------------ |
| `ACTIVE`    | The subscription is current and the plan features are fully available.         |
| `TRIALING`  | The subscription is in a free trial period.                                    |
| `INACTIVE`  | The subscription exists but is not currently active.                           |
| `PAST_DUE`  | A payment failed. The subscription may be suspended until payment is resolved. |
| `CANCELLED` | The subscription has been cancelled and will not renew.                        |

<Warning>If your subscription enters `PAST_DUE` status, Scrubbe may restrict access to paid features until the outstanding payment is resolved. Update your payment method in your billing settings or through Stripe's customer portal.</Warning>

## Cancel a subscription

To cancel a subscription, send a `PATCH` request with the subscription ID. Cancellation takes effect at the end of the current billing period unless you request immediate cancellation.

```http theme={null}
PATCH /api/v1/pricing/subscriptions/:id/cancel
```

```bash cURL theme={null}
curl --request PATCH \
  --url https://api.scrubbe.com/api/v1/pricing/subscriptions/SUBSCRIPTION_ID/cancel \
  --header 'Authorization: Bearer YOUR_TOKEN' \
  --header 'Content-Type: application/json'
```

After cancellation, the subscription status changes to `CANCELLED`. Your team retains access to the plan's features until the end of the billing period. After that, the account reverts to the **Free** tier automatically.

<Note>Cancelling a subscription does not delete your account or your data. You can re-subscribe at any time using the checkout flow above.</Note>
