- A Free plan that gives users 5 chat messages per month for free
- A Pro plan that gives users 100 chat messages per month for $20 per month.
Create your pricing plans
Create a plan for each tier that your app offers. In our example we’ll create a “Free” and “Pro” plan.- Dashboard
- CLI
Create your Autumn account, and the Free and Pro plans in the Plans tab.


Free Plan
Free Plan
- On the Plans page, click Create Plan.
- Name the plan (eg, “Free”) and select plan type
Free - Toggle the
auto-enableflag, so that the plan is assigned whenever customers are created - In the plan editor, click Add Feature to Plan, and create a
Metered,Consumablefeature for “messages” - Configure the plan to grant
5messages, and set the interval toper month - Click Save
Your Free plan should look like this

Pro Plan
Pro Plan
- On the Plans page, click Create Plan.
- Name the plan (eg, “Pro”) and select plan type
Paid,Recurring, and set the price to$20per month - In the plan editor, click Add Feature to Plan, and add the
messagesfeature that you created in the Free plan - Configure the plan to grant
100messages, and set the interval toper month - Click Save
Your Pro plan should look like this

Installation
Create an Autumn Secret key, and paste it in your.env variables. Then, install the Autumn SDK..env
Create an Autumn customer
When the customer signs up, create an Autumn customer for them. Autumn will automatically enable the Free plan, since you marked it with theauto-enable flag.Autumn’s customer ID is the same as your internal user or org ID generated from your auth provider, so you can use the same ID for everything.
Stripe Payment Flow
Callbilling.attach to attach the Pro plan to the customer. Redirect the customer to the returned paymentUrl to complete payment or confirm the plan change.Use Stripe’s test card
4242 4242 4242 4242 to make a purchase in sandbox. You can enter any Expiry and CVV.Default behavior: For new subscriptions,
paymentUrl points to Stripe Checkout. For plan changes (upgrades/downgrades), it points to Autumn Checkout where customers can review prorations before confirming.Build your own UI: If you want to handle the checkout for plan changes yourself:- Call previewAttach to get line items and pricing details
- Call
attachwithredirectMode: "if_required"— this charges the customer automatically if they have a payment method on file
Track and limit usage
Enforce usage limits and feature permissions using Autumn’s
check and track functions


