A subscription is created when a plan is assigned to a customer. You can assign a plan to a customer at any time (i.e. when the customer record is created or later on).
Dashboard
API
To assign a plan to a customer through the user interface:
Access the “Customers” section via the side menu;
Select a customer from the list;
In the “Overview” tab, click “Add a plan” on the right;
Select a plan (that you can override if needed - see below);
Give a name to the subscription (name that will be displayed on the invoice - optional);
Give an id to the subscription (define your own subscription identifier - optional);
Set a subscription start date (start date of the subscription - see below);
Set a subscription end date (end date of the subscription - see below - optional);
Define a PO number to be used on invoices generated from this subscription;
Choose whether the subscription should be renewed at the beginning of the period or on its anniversary date (see below); and
When a subscription is active, Lago will automatically generate invoices for the customer according to the plan model. It will also start monitoring the customer’s consumption, which means that you can start pushing events related to this subscription.
The subscription date displayed in the app is based on the organization’s timezone.
Want to hold activation until the first payment clears, so you never open AR for an unpaid subscription? See Activation rules.
Bill your customers on calendar dates or on the anniversary date of the subscription (the day they signed up).
Calendar billing period
Anniversary billing period
By default, subscriptions are based on calendar periods. Therefore, if you assign a monthly plan to a customer on July 14th:
The first invoice will be generated for the period July 14th to July 31st;
The next invoice will be generated for the period August 1st to August 31st; and
All future invoices will be generated for full calendar months.
When a subscription starts during the month, the subscription fee will be calculated on a pro rata basis according to the number of days.Consider the following example:
Your customer signs up for the Premium plan, $50 monthly, on August 10th. There are 22 days left until the end of the month, including August 10th. Therefore, the subscription fee for August is:
22 days x $50 / 31 days = $35.48
Calendar billing cadence
Another option is to use the anniversary date of the subscription to define a custom billing period.For example:
Your customer signs up for the Premium plan on August 10th.
If you choose to align the billing cycle with the anniversary date of the subscription, the customer will be billed every 10th of the month.
The first billing period will run from August 10th to September 9th.
If the plan includes a subscription fee to be paid in advance, it will be considered as already paid for the current period. The next invoice will include the usage-based charges for the current period and the subscription fee for the next period (see example 1 below); and
If the plan includes a subscription fee to be paid in arrears, it will be included in the next invoice, together with the usage-based charges for the current period (see example 2 below).
Example 1: Start date in the past and subscription fee to be paid in advance
Illustration for start date in the past and subscription fee in advance
Example 2: Start date in the past and subscription fee to be paid in arrears
Illustration for start date in the past and subscription fee in arrears
If the start date of the subscription is in the future, the subscription is considered pending.The invoicing process varies depending on the plan model and billing cycle:
If the plan includes a subscription fee to be paid in advance, when the subscription becomes active, Lago will automatically generate an invoice for the subscription fee. Usage-based charges will be included in the next invoice, generated at the end of the billing period (see example 3 below); and
If the plan includes a subscription fee to be paid in arrears, when the subscription becomes active, there will be no invoice. The subscription fee and usage-based charges will be included in the invoice generated at the end of the billing period (see example 4 below).
Example 3: Start date in the future and subscription fee to be paid in advance
Illustration for start date in the future and subscription fee in advance
Example 4: Start date in the future and subscription fee to be paid in arrears
Illustration for start date in the future and subscription fee in arrears
By default, if no subscription end date is specified, the subscription will automatically renew at the end of the period.However, if you define an end date, the subscription will terminate on that date without renewal. This is valuable for contracts with specific termination dates.Keep in mind, 45 days and 15 days before the subscription ends, a webhook alert, called subscription.termination_alert, will remind you. You then have two choices:
Allow the subscription to continue until the end date and finalize it; or
Adjust the subscription end date if the contract has been renegotiated.
Ensure that the subscription end date is set to a date later than the subscription start date.
Dashboard
API
Here is how you can define a subscription end date from the UI:
Access the “Customers” section via the side menu;
Select a customer from the list;
In the “Overview” tab, click “Add a plan” on the right;
Set a subscription start date;
Set a subscription end date;
Choose between calendar or anniversary billing;
Click “Add plan” to confirm.
Use the ending_at field on the subscriptions endpoint.
You may create several subscriptions for a customer by assigning them multiple plans. This can be particularly useful if your application allows customers to create different projects or workspaces (e.g. Free plan for Workspace 1, Free plan for Workspace 2, Premium plan for Workspace 3, etc.).
When assigning multiple plans to a customer, you must specify the external_subscription_id for each event or create batch events.
It is possible to subscribe a customer to multiple plans using different billing cycles (e.g. a subscription based on calendar dates and another based on the anniversary date).We recommend that you give each subscription a name when assigning multiple plans to a customer. The subscription names will make it easier to differentiate each plan and will also be displayed on the invoices.
When a customer is subscribed to multiple plans, Lago can either group all subscription charges into a single consolidated invoice or issue a separate invoice for each subscription.By default, Lago consolidates subscriptions into a single invoice when they are billed on the same day and share all of the following:
The same payment method;
The same currency;
The same billing entity; and
The same PO number (purchase_order_number).
This reduces the number of invoices your customers receive and simplifies payment reconciliation. In the example below, a customer is subscribed to three plans, two billed monthly and one billed yearly, and Lago groups all charges that fall on the same billing date into a single invoice:
Month 1
Month 2
Month 3
Month 4
(…)
Month 13
Plan A (monthly)
$40
$40
$40
$40
(…)
$40
Plan B (monthly)
$60
$60
$60
$60
(…)
$60
Plan C (yearly)
$500
-
-
-
(…)
$500
Total invoice
$600
$100
$100
$100
(…)
$600
To keep a specific subscription on its own invoice, for example to bill a different cost center, track a contract independently, or simplify internal reporting, disable consolidation for that subscription. Set the consolidate_invoice field to false on the subscription, either from the dashboard or via the API. Lago then issues a standalone invoice for that subscription, even when other subscriptions for the same customer are billed on the same day.
The consolidate_invoice setting applies at the subscription level, so you can mix consolidated and standalone subscriptions for the same customer. You can update this setting at any time.
PREMIUM FEATURE ✨This feature is only available to users with a premium license. Please
contact us to get access to Lago Cloud and Lago
Self-Hosted Premium.
When you assign a plan to a customer, you can customize parts of it for that subscription.
You keep one plan structure for every customer, and adjust prices per customer where you need to.
Dashboard
API
To perform plan overrides, assign a plan to a customer and you’ll be able to make modifications to the following elements:
Subscription invoice display name
Subscription fee
Plan currency
Plan trial period
Plan taxes
Charges properties (please note that the charge model cannot be modified)
Fixed charges are also overridden under plan_overrides, using the fixed_charges array. Sending only units (and apply_units_immediately if needed) updates the quantity without creating a plan override. Passing a price or properties creates one. See Update a fixed charge via the API.
An overridden plan stays linked to the initial plan, but it does not appear in the plans list.
To open it, click the subscription in the customer details view.All invoices generated from this subscription are based on the overridden plan, not the initial plan.
Coupons restricted to a plan code apply to both the initial plan and its overrides.By default, changes made to the initial plan do not reach subscriptions linked to an overridden plan. To propagate them, update the plan with cascade_updates set to true. See Editing plans.
You can delete a plan that is linked to existing subscriptions.If you do so, the subscriptions associated with this plan will be immediately terminated. This action may trigger the generation of invoices and/or credit notes.
After deleting a plan, you can create a new one using the same code.