Quickstart
Implement pricing & billing in under 5 minutes
In this quick tutorial, we’ll set up pricing and billing for an AI chatbot product. This product has a Pro tier, which comes with 50 chat messages and access to Pro Analytics.
Step 1: Define product features
We can define the chatbot’s features in the Autumn dashboard. We’ll create two features:
-
“Chat messages”: a
metered
feature, as access is dependent on its usage -
“Pro Analytics”: a
boolean
feature, as it’s a simple on-off toggle depending on the tier
Creating a boolean feature just needs a name and ID. Metered features rely on reporting usage events (see Step 5) so we can keep track of how much allowance each customer has left. We need to define the name of the event we’ll be sending from our application.
Step 2: Create a product
Next, let’s create a product. We’ll call it “Pro Tier”, and under Entitlements, we’ll add our 50 chat messages per month and Pro Analytics. We’ll then add a pricing of $99 per month.
Step 3: Create a customer
Now we need to create our first customer. You can do this either via the API or dashboard. The best part… you can use your own, internal customer IDs!
Step 4: Attach a product on purchase
When this customer purchases Pro Tier, we’ll attach our Pro product to the customer. Once again, you can do this via Dashboard or API. This step will involve billing the customer, so if you haven’t set up your Stripe credentials yet, you will be prompted to do so.
If a customer needs to make a card payment, this will return a Stripe checkout URL. If we have the card already on file, we’ll automatically handle billing.
Our design philosophy is that you shouldn’t have to handle upgrades, downgrades, or 258 webhook statuses. So whenever you want to assign a product to a customer, all you need to do is call this endpoint—Autumn will handle all this for you!
Step 5: Check access and send usage events
Finally from your application, whenever a customer tries to use one of your features, first check if they’re entitled by calling the endpoint below. If it’s a usage-based feature, make sure to send us the events.