Skip to main content

Welcome to Lago

Lago is an open-source Stripe Billing alternative.

This library will allow you to build an entire billing logic from scratch, even the most complex one. Lago is a real-time event-based library made for usage-based billing, subscription-based billing, and all the nuances of pricing in between.

You can decide to use Lago in its self-hosted version or in its cloud version (fully hosted by Lago), currently available on a per request basis. Request access to Lago Cloud here.

Four-step billing workflow

1. Event ingestion

Events provide information about your customers' consumption, with the highest level of granularity. Any product feature for which you want to charge your customers should correspond to a specific event. An event can be triggered by an action or can be sent periodically. Lago is able to ingest events at scale while preventing duplicates.

2. Metrics aggregation

The aggregation process consists in converting events into billable metrics. There are four aggregation types:

AggregationDescription
COUNTCounts the number of times an incoming event occurs
SUMCalculates the sum of a predefined property for incoming events
MAXReturns the maximum value of a predefined property for incoming events
COUNT DISTINCTReturns the number of unique values of a predefined property for incoming events

3. Pricing

Creating plans allows you to define how much your customers should pay for using your product. You can then combine plans and billable metrics to implement any billing model (i.e. subscription-based, usage-based, or hybrid). Billable metrics may be priced differently depending on the associated plan.

4. Invoicing

An invoice is generated for each customer at the end of the billing period, as defined in the corresponding plan. Invoices include fees, taxes and customer information.

Next steps

Before you can start defining usage metrics and pricing plans, you must deploy Lago locally.