Skip to main content
Line item spend alerts monitor the usage-based spend of a single line item on a subscription, independently of the subscription’s total. Use this when one specific charge (for example, a particular metered API) needs its own budget, separate from the rest of the subscription.

Configuring via the Dashboard

1

Open the contract's charges

In the dashboard, subscriptions are called contracts and their line items are charges. Open the contract and go to the Charges tab.
2

Open the charge's details

Find the usage charge to monitor, click its ⋯ menu, and select View details.
Charge menu with View details
3

Add alerts

In the Alerts section of the charge’s details, click Add alerts. The section appears on usage charges.
Charge details with the Alerts section and the Add alerts button
4

Configure thresholds

Keep Alerts on turned on and choose whether thresholds are measured as Absolute amounts or a Percentage. Turn on each level you want (Info, Warning, Critical), keep Rises above selected, and enter the threshold, then click Add alerts. Spend alerts support only Rises above, so a level set to Falls below is rejected when you save. At least one level must be set while alerts are on, and a percentage can’t exceed 100.
Add alerts dialog with warning and critical thresholds

Configuring via API

entity_id must be a line item that belongs to the subscription identified by parent_entity_id. The API rejects a line item ID from a different subscription.

Alert Behavior

Flexprice recalculates this line item’s usage-based spend on every usage event affecting the subscription and sends a webhook only when the alert state changes.
Usage on a different line item in the same subscription does not affect this alert. It only tracks the one line item it’s configured on.

Managing Alert Settings

Viewing current configuration

1

Open the charge's details

Open the contract, go to the Charges tab, click the charge’s ⋯ menu, and select View details.
2

Read the Alerts section

The Alerts section lists each level with its condition and threshold. While the charge’s alerts are switched off, the section lists none and shows Add alerts.

Changing thresholds

1

Edit the alerts

In the charge’s details, click Edit in the Alerts section.
2

Adjust values

Change Measured as or any level’s threshold, keeping Rises above selected. This form shows only the levels already set; to add or drop one, see Removing a threshold.
3

Save

Click Save alerts.

Removing a threshold

The Edit form has no switch per level, so you remove a level by turning the alerts off and adding them again.
1

Turn the alerts off

Click Edit in the charge’s Alerts section, turn off Alerts on, and click Save alerts.
2

Add the alerts again

Click Add alerts in the same section. The form reopens on the stored thresholds, with a switch per level.
3

Turn off the level

Turn off the switch next to the level you want to drop, and click Add alerts. The level is cleared from the setting. The same steps add a level: turn its switch on instead.
Through the API, send the remaining config to PUT /v1/alerts/setting/:id. An update replaces the whole config, so a threshold left out is cleared.

Disabling alerts

1

Edit the alerts

In the charge’s details, click Edit in the Alerts section.
2

Turn off Alerts on

Turn off Alerts on (or set alert_enabled to false through the API).
3

Save

Click Save alerts. The section then lists no alerts, but the thresholds are kept: Add alerts reopens them.

Webhooks

Use Cases

  • Per-charge budgets: Alert on a specific metered charge (e.g. a particular API or compute meter) without noise from the rest of the subscription
  • High-cost line items: Set tighter thresholds on line items with the highest per-unit cost or the most usage variance
  • Customer-specific overrides: Combine with per-subscription price overrides to alert on a customer’s negotiated rate independently