Learn how to track trials and create subscriptions for users of your SaaS application
When a new tenant is created in your SaaS application it will be reflected in Bunny as a Subscription.
There are 2 main types of subscription:
Trial - where a product plan has been configured to allow trials this type of subscription will be flagged as a trial. At the end of the trial it will either cancel or activate to a paid subscription.
Active - this is a paid subscription. Invoices will be generated and payments will be collected.
You should make the request to create a new subscription in Bunny immediately after a new sign-up happens on your SaaS application.
Prerequisites
Before you can start tracking your trial subscriptions you will need to complete these tasks:
Create a Plan and associated Price List in Bunny. Take note of the code that you set for the price list as you will need that in the next step.
When creating an API client you need to select the scopes that you want to allow. To create subscriptions in Bunny your API client needs the standard:read and standard:write scopes.
Make the request
Assuming that you have completed both of the prerequisite steps you should have API credentials and a Bunny SDK installed as well as having a plan, price list and code setup.
You can either use the subscriptionCreate mutation or the create subscription method on our SDKs to setup a new subscription.
For example, create a new trial subscription and provide Bunny with the unique ID of the new tenant in your SaaS application.