> ## 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.

# Trial Periods

> Offer free trials before billing begins on a subscription.

Fluxrate supports free trial periods on subscriptions. During the trial:

* Subscription status is `TRIAL`
* No invoices are generated
* Usage is still tracked (for billing after the trial ends)

## Configuring Trials

### On the Plan

Set `trial_days` when creating a plan to apply a default trial to all subscriptions:

```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",
    "type": "HYBRID",
    "billing_interval": "month",
    "currency": "USD",
    "trial_days": 14
  }'
```

### On the Subscription

Override the trial period per subscription using `trial_end_date`:

```bash theme={null}
curl -X POST https://api.fluxrate.co/api/v1/subscriptions \
  -H "Content-Type: application/json" \
  -H "Cookie: access_token=<token>" \
  -d '{
    "customer_id": "<customer_id>",
    "plan_id": "<plan_id>",
    "billing_interval": "month",
    "start_date": "2025-01-01T00:00:00Z",
    "trial_end_date": "2025-01-15T00:00:00Z"
  }'
```

## Trial End Behavior

When `trial_end_date` passes, the invoice worker automatically:

1. Transitions the subscription to `ACTIVE`
2. Sets `current_period_start = trial_end_date`
3. Begins normal billing

<Tip>
  Usage during the trial is tracked but not billed. The first invoice covers only the period after the trial ends.
</Tip>
