- 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.
1
Create your pricing plans
Create a plan for each pricing tier that your app offers. In our example we’ll create a “Free” and “Pro” plan, and assign them features.
- CLI
- Dashboard
Run the following command in your root directory:This will prompt you to login or create an account, and create an Then, push your changes to Autumn’s sandbox environment.
autumn.config.ts file. Paste in the code below, or view our config schema to build your own.autumn.config.ts
2
Installation
Create an Autumn Secret key, and paste it in your
.env variables. Then, install the Autumn SDK. If you’re using the CLI, this will be done for you..env
3
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 the In the Autumn dashboard, you will see your user under the customers page.
auto-enable flag.Autumn’s customer ID is the same as your internal user or org ID generated
from your auth provider. No need to store any extra IDs.
4
Stripe Payment Flow
Call This can be used for any plan changes scenario (upgrades, downgrades, one-time topups, renewals, etc).Upgrades will happen immediately, and downgrades will be scheduled for the next billing cycle.
attach when the customer wants to purchase the Pro plan. This will return a Stripe payment URL. Once they’ve paid, Autumn will grant access to “100 messages per month” defined in Step 1.Use Stripe’s test card
4242 4242 4242 4242 to make a purchase in sandbox.
You can enter any Expiry and CVV.The
redirectMode: "always" flag will always return a payment URL.New purchases redirect to Stripe Checkout to enter payment details, and subsequent charges redirect to an Autumn hosted, one-click confirmation page.You can build your own billing confirmation flows by using the previewAttach function.Track and limit usage
Enforce usage limits and feature permissions using Autumn’s
check and
track functions


