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

# Plans Overview

> Plans define the pricing structure your customers subscribe to — from flat fees to usage-based and hybrid models.

A **Plan** is the core billing product in Fluxrate. It packages together:

* **Features** — what capabilities the plan unlocks
* **Charges** — how much and how the customer is billed

Customers subscribe to plans, and Fluxrate automatically manages the billing cycle.

## Plan Types

<CardGroup cols={3}>
  <Card title="Fixed" icon="tag" href="/guide/plans/fixed-pricing">
    Flat recurring fee. Simple and predictable. Great for SaaS subscriptions.
  </Card>

  <Card title="Usage-based" icon="chart-bar" href="/guide/plans/usage-based-pricing">
    Charge based on consumption. Pay-as-you-go. Great for APIs and infrastructure.
  </Card>

  <Card title="Hybrid" icon="layer-group" href="/guide/plans/hybrid-pricing">
    Base fee + usage charges. Best of both worlds for modern SaaS.
  </Card>
</CardGroup>

## Creating a Plan

<Tabs>
  <Tab title="Dashboard">
    1. Navigate to **Plans** in the sidebar
    2. Click **Create Plan**
    3. Choose the plan type, billing interval, and currency
    4. Add charges and features
    5. Save the plan
  </Tab>

  <Tab title="API">
    ```bash theme={null}
    curl -X POST https://api.fluxrate.co/api/v1/plans \
      -H "Content-Type: application/json" \
      -H "Cookie: access_token=<token>" \
      -d '{
        "name": "Pro",
        "lookup_id": "pro",
        "description": "For growing teams",
        "type": "HYBRID",
        "billing_interval": "month",
        "currency": "USD",
        "trial_days": 14
      }'
    ```
  </Tab>
</Tabs>

### Plan Fields

| Field              | Required | Description                                         |
| ------------------ | -------- | --------------------------------------------------- |
| `name`             | ✅        | Display name for the plan                           |
| `lookup_id`        | ✅        | Unique slug identifier within your org              |
| `type`             | ✅        | `FIXED`, `USAGE`, or `HYBRID`                       |
| `billing_interval` | ✅        | `day`, `week`, `month`, or `year`                   |
| `currency`         | ✅        | ISO 4217 currency code (e.g., `USD`, `EUR`, `INR`)  |
| `trial_days`       |          | Length of free trial period in days                 |
| `description`      |          | Human-readable plan description                     |
| `is_active`        |          | Whether the plan is available for new subscriptions |

## Billing Intervals

Plans support four billing cadences:

| Interval | Description                  |
| -------- | ---------------------------- |
| `day`    | Billed daily                 |
| `week`   | Billed weekly                |
| `month`  | Billed monthly (most common) |
| `year`   | Billed annually              |

## Plan Lifecycle

```
Active → Deactivated (no new subscriptions)
```

A plan cannot be **deleted** if it has active subscriptions. You must first cancel or migrate all subscriptions before deleting.

<Warning>
  Once a plan has active subscriptions, changes to pricing may affect existing customers. Consider creating a new plan version instead.
</Warning>

## Plan Structure Example

Here's how a complete "Pro" plan might look:

```
Pro Plan ($49/month + usage)
├── Features
│   ├── API Calls (meter) → 50,000 calls/month limit
│   ├── Analytics Dashboard (switch) → enabled
│   └── Max Team Members (custom) → "10"
└── Charges
    ├── Base Fee → $49/month (FIXED)
    └── API Call Charge → $0.001/call (USAGE, linked to api_calls meter)
```
