Foreword
Each Lago account is associated with a single environment. It is not possible to have your test environment and production environment in the same account. Two workarounds:- Create two accounts to get access to two environments, one that could be called “Company Staging” and another one that could be called “Company Production”; or
- Leverage our two hosting solutions to use Lago Cloud as a test environment and Lago Open Source as a production environment (or vice versa).
In the future, you will be able to get access to a test environment and a
production environment with the same Lago account.
1. Define a billable metric
To define a billable metric through the user interface:- In the side menu, select “Billable metrics”;
- Click “Add a billable metric” in the upper right corner;
- Fill in the form (learn more about billable metrics); and
- Click “Add billable metric” to save.
2. Create a plan (with charges)
To create a plan through the user interface:- In the side menu, select “Plans”;
- Click “Add a plan” in the upper right corner;
- Fill in the form (learn more about plans); and
- Click “Add plan” to save.
3. Create a customer
To create a customer through the user interface:- In the side menu, select “Customers”;
- Click “Add a customer” in the upper right corner;
- Fill in the form in the pop-up window (learn more about customers); and
- Click “Add customer” to save.
4. Start a subscription
To start a subscription, you need to assign a plan to an existing customer. To do so through the user interface:- In the side menu, select “Customers”;
- Select a customer from the list;
- On the right-hand side, click “Add a plan”;
- Select the plan you would like to assign to your customer; and
- Click “Add plan” to confirm.
5. Send usage-based events
Lago automatically aggregates the events your backend sends according to the billable metrics you defined (learn more about ingesting usage):6. Invoice your customers
At the end of the billing period, Lago automatically generates an invoice for each customer and notifies your application with a webhook. To define the URL that receives them:- In the side menu, select “Developers”;
- Open the “Webhooks” tab;
- Click “Add a webhook”;
- Enter the name and the URL of your application; and
- Click “Add webhook” to confirm.