New updates and improvements to Lago.
credits
or tokens
— not just fiat currency.
This gives you more flexibility to align your pricing with how your product delivers value. You can now:Usage-based billing with group keys
Lago Data Pipeline
!Lago Data Pipeline is now in beta and available for a selected group of customers. Reach out to your account manager to get access.More than 20 data destinations are supported, including Snowflake, BigQuery, Redshift, Databricks, Athena, ClickHouse, MotherDuck, Postgres, Aurora Postgres, MySQL, Aurora MySQL, SQL Server, SingleStore, S3, S3-Compatible, GCS, ABS, and Google Sheets.Learn morefailed
wallet transaction! Now, when a wallet transaction is linked to a failed payment, its status will automatically update from pending
to failed
.
This enhancement provides a clearer view of the transaction lifecycle and simplifies debugging when needed.wallet.created
, wallet.updated
, and wallet.terminated
events.Learn more/invoices/preview
endpoint, you can generate a preview of an invoice for a potential purchase or to estimate the dry-run invoice of an active subscription.
This preview calculates the total invoice amount, itemizes each charge, and applies any relevant taxes or discounts.
By creating a preview, you can share the projected payment details without generating or finalizing an invoice.GET /wallet_transactions/{lago_id}
endpoint.View endpointCONCAT(value1, '_', value2)
((value1 * value2) / value3)
ROUND(value1 / value2)
LagoInvoices
.LagoSubscriptions
.code
external_subscription_id
timestamp_from
timestamp_to
amount_cents
was available.To use the precise fee amount, you can use the precise_amount
field.Learn morewallet_transaction.invoice_requires_successful_payment
).Learn more2. Marking external_subscription_id as mandatory for events
Events that only include external_customer_id
are no longer taken into account when aggregating usage (learn more). This change will streamline the event validation process and enable real-time billing capabilities.3. Removing deprecated API fieldsFor the sake of clarity and to preserve the quality of the API, we’ve deprecated several legacy fields (see full list).Learn morefee.created
webhook)invoice.payment_overdue
).Learn moreamount_cents
is zero for the subscription fee and there are no other fees (e.g. usage-based charges or commitment) in the invoice, the subscription fee will appear on the PDF invoiceamount_cents
is zero for the subscription fee and there are other fees in the invoice, the subscription fee will not be displayed on the PDF invoicewallet_transaction.created
)wallet_transaction.updated
)wallet.depleted_ongoing_balance
)POST /wallet_transactions
includes a new function to void credits, which are immediately deducted from the balance of the customer’s wallet.This action can also be triggered via the user interface.Learn moreinvoice.payment_dispute_lost_at
and send the webhook message invoice.payment_dispute_lost
.This feature is available via integrations with Stripe and Adyen.billable_metric
, plan
, fee
and customer_usage
. In addition, the endpoint to retrieve billable metric groups will be deprecated (see all changes).2. The external subscription ID becomes mandatory for eventsIn order to develop real-time billing capabilities, we need to streamline our validation process. We have therefore decided to make external_subscription_id
mandatory when sending events via the Lago API.Events that only include external_customer_id
will no longer be taken into account when aggregating usage (learn more).3. Deprecation of API fieldsFor the sake of clarity and to preserve the quality of the API, we are going to deprecate several legacy fields (see full list).TimelineWe will maintain the current API logic until July 9, 2024. After this date, previous versions will no longer be supported. We kindly ask our users to update their integration before that day to avoid any potential breaking change.Learn moregrouped_by
attributes that will then be used to provide information on the distribution of usage.For a customer who has sent thousands of API requests, for instance, we could display the breakdown of usage based on the workspace_id
to which each request is linked.Learn more/events/batch
endpoint. Each API call may include up to 100 events.Learn more"fees_amount_cents": 0
are no longer sent to customers by email, they are still available in the database and user interface.Learn moreinvoice.fees.amount_details
).Learn moreevents.errors
webhook message to notify users when some of the events ingested in the last hour are invalid.Possible errors include:transaction_id
already exists, etc.).external_id
of the subscription.Learn moresubscription.terminated
to confirm the termination of the initial plan (includes next_plan_code
)subscription.started
to confirm the start of the new plan (includes previous_plan_code
)plan.invoice_display_name
and charges.invoice_display_name
).Learn moreGET /customers/{external_customer_id}/past_usage
.Users must specify external_subscription_id
and can filter results by billable_metric_code
. They can also select the number of past periods for which they wish to retrieve usage data.Learn morelatest_agg
allows users to compute usage based on the last value received during the period for a billable metric.Consider the following example for the storage
metric, where usage is aggregated based on the property gb
:latest_agg
, at the end of the billing period, the total number of units used to calculate the fee will be 6, as it’s the last value received.Learn moreweighted_sum_agg
allows users to compute usage based on a custom property and the time elapsed between two events (e.g. memory consumption measured in GB-seconds).Billable metrics based on this aggregation type can be metered or recurring, and are always billed at the end of the billing period.Learn moresubscription.termination_alert
webhook).If no end date is set for a subscription, it will renew automatically.Learn moreper_transaction_min_amount
and per_transaction_max_amount
parameters.Learn moreactive
, Lago automatically sends a subscription.started
message.Learn morev0.44.1-beta
includes the new quarterly interval.When selected, all fees (i.e. subscription fee and charges) are billed every three months.Learn moreJWT
signatureHMAC
signature, which includes a shorter headerGET /api/v1/subscriptions/
returns all active subscriptions. However, you can also retrieve pending, canceled and terminated subscriptions by using the status
parameter.Learn moresum_agg
and count_unique_agg
. They can also define whether the corresponding charges should be prorated (this option is only available for the standard and volume pricing models).recurring_count_agg
have been automatically converted into count_unique_agg
metrics with the attribute "recurring": true
.pending
.You can now cancel a pending subscription through the Lago API, using the following endpoint:
DELETE /api/v1/subscriptions/{external_id}?status=pending
Learn morecustomer.checkout_url_generated
webhook message.You can redirect your customer to the corresponding page to register their payment method, which will then be used to collect payment when a new invoice is issued.Learn moretax_identification_number
attribute. When a value is available for this attribute, it is automatically displayed on the PDF version of the next invoices.billable_metric_codes
attribute of the coupon
object (see API documentation).Please refer to the guide for more information on coupons.invoice
object but will not be displayed on the PDF invoice.Invoice metadata can be managed via the user interface or the API.Learn moredocument_locale
attribute determines the language of the documents.You can contribute to Lago’s open-source project by helping us translate documents. The new language will then be added to the list of supported locales and available to the entire Lago Community.plan_codes
attribute of the coupon
object (see API documentation).Please refer to the guide for more information on coupons.forever
frequency.Coupons with the forever
frequency apply to all subscription invoices, regardless of the number of subscription invoices generated in a given period.draft
status and can be modified. Available actions include:timestamp
within the relevant billing periodfinalized
(they can no longer be edited), which triggers the invoice.created
webhook. You can also finalize invoices manually.The organization’s grace period applies to all customers by default, but it can be overwritten by the customer’s grace period.GET /api/v1/applied_coupons
to retrieve all coupons applied to a customer.compute
billable metric with two dimensions (learn more).Changes to the API include:group
parameter with one or two dimensions when creating or updating billable metricsgroup_properties
parameter when creating or updating a planlago_group_id
for fees (see invoice object)message
attribute for errors has been replaced with code
and error_details
, which provide more information about the errors. There are several codes associated with each error.For example, when creating a new billable metric, the API may return "error": "Unprocessable entity"
with the code value_is_mandatory
for the name
field (i.e. the name of the billable metric is missing).Please refer to the documentation available for each endpoint for more information on error codes.reccuring_count
aggregation is exactly what you need.This new aggregation type allows you to push events for persistent units.Consider the following example:Your customer is on a monthly plan and adds a new user to their account on September 15th, so you generate an event that corresponds to one billing unit. At the end of September, Lago will automatically create a prorated charge for this user, based on the number of days of activity (i.e. from September 15th to September 30th). This billing unit will remain valid until you generate another event to remove it. For instance, if your customer deletes the user on October 22nd, Lago will create another prorated charge for the period October 1st to October 22nd.Consult our guide to learn more about persistent units.
subscription_id
and unique_id
will be removed and replaced with external_id
(required)subscription_id
will be replaced with external_subscription_id
customer_id
will be replaced with external_id
customer_id will be replaced with
external_customer_id`billing_time
attribute to choose your preferred option. If not provided, Lago will base the subscription on calendar periods.Learn moresubscription_id
for each event or create batch eventsorganization's name
in the top-left corner of the user interface to see the app version currently in use.GET /api/v1/customers/:customer_id/current_usage
POST /api/v1/billable_metrics
PUT /api/v1/billable_metrics/:code
DELETE /api/v1/billable_metrics/:code
GET /api/v1/billable_metrics/:code
GET /api/v1/billable_metrics?per_page=2&page=1
POST /api/v1/plans
PUT /api/v1/plans/:code
DELETE /api/v1/plans/:code
GET /api/v1/plans/:code
GET /api/v1/plans?per_page=2&page=1
POST /api/v1/coupons
PUT /api/v1/coupons/:code
DELETE /api/v1/coupons/:code
GET /api/v1/coupons/:code
GET /api/v1/coupons?per_page=2&page=1
POST /api/v1/add_ons
PUT /api/v1/add_ons/:code
DELETE /api/v1/add_ons/:code
GET /api/v1/add_ons/:code
GET /api/v1/add_ons?per_page=2&page=1
GET /api/v1/customers/:customer_id/current_usage
PUT /api/v1/organizations
on
the toggle for applying charges monthlyEvents list
because it makes the event ingestion easier and more understandable.Developer
sidebar itemEvents
tab% + fixed fee
out of a usage-based features (for banking or charity industry, for instance). These fees are applied on the units to be charged (e.g. the aggregation result of your billable metric).