# Free Accounts

You can offer a free plan to your users' simply by adding a new plan object inside `stripe.plans` in your config file.&#x20;

{% hint style="warning" %}
You can name the plan whatever you like, but the id must be set to `free`
{% endhint %}

```javascript
  {
    "id": "free",
    "name": "Hobby",
    "price": 0,
    "interval": 'month',
    "currency": { "name": "usd", "symbol": "$" }
  }
```

This will bypass the payment and create a user on a free pla&#x6E;**.** You can then restrict features in your app, if required, based on the user's plan.

## Upgrading From Free to Paid

Users on the free plan can upgrade to a paid plan in `account/billing`\
\
If a user is on the free plan and selects a paid plan, the server will return a `402 Payment Required` response, which will redirect the user to a payment form.

{% hint style="info" %}
You can return a 402 status anywhere in your application to force the user to upgrade to a paid plan.
{% endhint %}

Once the payment has been processed, a new Stripe customer and subscription is created for the user.

The user's plan will be updated in client context so they can immediately access the features for that plan on the front end.

## Downgrading to Free

When a user downgrades from a paid to free plan in the billing view, their Stripe subscription will automatically be cancelled at the end of their current billing cycle. They will remain on their paid plan and be able to access the features they paid for until the subscription is cancelled.&#x20;

The cancellation will be handled by a Stripe [webhook](/gravity-server/rest-api/webhooks.md) for `customer.subscription.deleted`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.usegravity.app/gravity-server/free-accounts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
