Skip to main content

Overview

Credits consumption alerts help you monitor wallet balances and notify your customers when their credits are running low. They are essential for:
  1. Allowing customers to track their remaining credits and plan top-ups before running out;
  2. Alerting customers when their wallet balance or ongoing balance drops below critical thresholds; and
  3. Triggering automated workflows such as auto top-ups or usage restrictions when credits reach predefined levels.
Credits consumption alerts are a premium feature. Free users cannot create wallet alerts.

Create an alert

An alert must be tied to a specific wallet. To create an alert for a particular wallet, follow these steps:
  1. Access the “Customers” section via the side menu;
  2. Select a customer from the list;
  3. Open the “Wallets” tab and select a wallet;
  4. Click on the “Alerts” tab;
  5. Click on the “Add an alert” button;
  6. Select the type of alert (e.g., Wallet Ongoing Balance);
  7. Set the progressive thresholds and code for the alert;
  8. Define the optional recurring threshold for the alert; and
  9. Click on the “Create alert” button to confirm.
Unlike usage alerts where thresholds are increasing, wallet alert thresholds must be decreasing: each new threshold must be lower than the previous one. You can define up to 20 thresholds per alert, including one optional recurring threshold.
The alert threshold code helps distinguish between different types of alert notifications. For example, some notifications may indicate a soft limit, while others may trigger a hard limit, each with different levels of urgency or action required.

Alert types

Lago supports the following credits consumption alert types. You can create one alert per type on each wallet. You can also create multiple alerts at once by sending an alerts array to the same create endpoint, or delete all alerts for a wallet in a single API call.
  • Wallet Balance Amount (wallet_balance_amount): Triggered when a wallet’s balance drops below predefined thresholds. The minimum threshold value is 0.
  • Wallet Credits Balance (wallet_credits_balance): Triggered when a wallet’s credits balance drops below predefined thresholds. Values are expressed in credits. The minimum threshold value is 0.
  • Wallet Ongoing Balance Amount (wallet_ongoing_balance_amount): Triggered when a wallet’s ongoing balance drops below predefined thresholds. Thresholds can be negative since the ongoing balance can go below zero.
  • Wallet Credits Ongoing Balance (wallet_credits_ongoing_balance): Triggered when a wallet’s ongoing credits balance drops below predefined thresholds. Values are expressed in credits. Thresholds can be negative since the ongoing balance can go below zero.

Thresholds

Decreasing thresholds

Wallet alert thresholds must be decreasing from one to another, representing gradual levels as the balance drops. You can define up to 20 thresholds per alert, each with an optional code and a value that should trigger the alert, sent as an integer or a string formatted as a BigDecimal. For example, with a starting balance of 500 credits, you might set thresholds at 100, 50, and 10 credits. As the balance decreases:
  • When the ongoing credits balance crosses 100, Lago triggers a notification;
  • When the ongoing credits balance crosses 50, Lago triggers a notification; and
  • When the ongoing credits balance crosses 10, Lago triggers a notification.

Recurring threshold

In addition to progressive thresholds, you can define an optional recurring threshold. This threshold triggers the alert repeatedly each time it is crossed, avoiding the need to create an endless list of individual thresholds.

Alert notifications

After configuring an alert, you can listen for the alert.triggered webhook message. These webhooks serve as notifications sent to your system, indicating when an alert threshold has been crossed, along with all the relevant alert details.

Limitations

  • Credits consumption alerts are a premium feature;
  • Alerts only evaluate wallet data after their creation;
  • Alert processing and credit balance updates happen close to real time;
  • Only one alert per alert type can be created on each wallet; and
  • Each alert supports up to 20 decreasing thresholds, including one optional recurring threshold.