Skip to main content
Flexprice provides four types of threshold alerts so you can stay ahead of credit exhaustion, budget overruns, and usage limits. Alerts can monitor wallet balances (how much prepaid credit remains) or usage (how much has been consumed during a billing cycle) — and both can be scoped either to the overall customer or to a specific feature. All four alert types share the same three-level model (infowarningcritical) and deliver webhook notifications on every state transition, giving you a single consistent pattern to build on.

Alert Types at a Glance


Alert Levels and States

Every alert configuration supports up to three independent threshold levels:

Conditions

Each threshold is paired with a condition that controls which direction triggers the alert:

Threshold Ordering Rules

For below conditions (monitoring depletion):
For above conditions (monitoring accumulation):
A Warning threshold requires a Critical threshold. You cannot configure Warning without Critical. Info can be set independently.

State Transitions

Alerts transition automatically as values change. Webhooks fire on every state change — including recovery back to ok.
State transitions can skip levels. For example, a sudden large debit may move a wallet directly from ok to in_alarm, bypassing info and warning.

1. Low Wallet Balance Alert

Monitor the prepaid wallet balance of a customer. This alert fires when the overall credit balance crosses a configured threshold — ideal for preventing service interruptions caused by depleted prepaid credits.

When to Use

  • Customer has a prepaid wallet shared across all their features
  • You want to notify customers (or trigger auto top-up) before credits run out
  • You need to monitor overall credit health across a billing cycle

Configuration

Configure thresholds when creating or updating a wallet via the API:
Example scenario: A customer starts with $1,000 in prepaid credits.

Webhook Payload

Event type: wallet.alert

Webhook Fields

Use Cases

  • Prepaid SaaS — alert at 200,200, 100, $0 so customers can top up before service is affected
  • API credit products — send in-app notification at info, email at warning, pause at in_alarm
  • Combined with auto top-up — use warning as the trigger for automated wallet recharge

2. Low Feature Wallet Balance Alert

Monitor the balance of a feature-specific wallet. Each feature can have its own prepaid allocation; this alert fires when that feature’s balance crosses a threshold — independently of the customer’s overall wallet.

When to Use

  • Different features have separate credit allocations
  • You want independent spend monitoring per service (e.g. “Compute Credits” separate from “Storage Credits”)
  • You need to notify on a per-feature basis rather than at the aggregate customer level

Configuration

Configure thresholds on the feature’s alert settings:
Example scenario: A feature wallet for “Compute Credits” is loaded with $500.

Webhook Payload

Event type: feature.wallet_balance.alert

Webhook Fields

Use Cases

  • Per-feature credit allocations — independently monitor separate feature budgets without cross-contamination
  • Storage vs compute — alert on compute credits independently from storage credits
  • Tenant isolation — set different depletion thresholds per feature based on criticality

3. Total Usage Alert

Monitor cumulative usage spend for a customer across their active billing cycle. Unlike wallet balance alerts (which track remaining credits), usage alerts track how much has been consumed — making them ideal for enforcing soft spend caps or budget limits.

When to Use

  • Customer has a monthly or annual spend budget
  • You want to warn customers before they exceed a contracted usage limit
  • You need to enforce soft or hard caps on total billing cycle spend

Configuration

Configure thresholds on the customer’s usage alert settings:
Example scenario: A customer has a $5,000 monthly spend budget.

Webhook Payload

Event type: customer.usage.alert

Webhook Fields

Use Cases

  • Spend caps for enterprise customers — alert at 50%, 80%, and 100% of a contracted spend limit
  • Proactive customer communication — send automated emails at info, outreach at warning, and sales escalation at in_alarm
  • Soft vs hard limits — use warning to notify and in_alarm to enforce a hard stop via the API

4. Feature-Level Usage Alert

Monitor cumulative usage of a specific feature within a billing cycle. This gives you granular visibility into per-feature consumption — independent of the customer’s overall usage — so you can track individual API endpoints, compute resources, or storage usage separately.

When to Use

  • Different features have separate usage budgets or rate limits
  • You want feature-specific alerts without noise from unrelated usage
  • You need to alert on physical units (e.g. API calls, GB, minutes) rather than monetary amounts

Configuration

Configure thresholds on the feature’s usage alert settings:
Example scenario: A customer has a contract for up to 1,000,000 API calls per month.

Webhook Payload

Event type: feature.usage.alert

Webhook Fields

Use Cases

  • API rate limits — alert at 25%, 75%, and 100% of a contracted call volume; enforce hard cap at in_alarm
  • Compute or storage quotas — independent thresholds per resource type without aggregate noise
  • Tiered upsell — route warning webhooks to your CRM to trigger upsell outreach before the customer hits their limit

Webhook Delivery

All four alert types are delivered as webhooks. Flexprice supports two delivery modes: Webhooks fire on every state transition — both when crossing a threshold and when recovering to ok. You will not receive repeated webhooks if the alert state does not change. See Webhooks for endpoint setup, signature verification, and retry configuration.

Choosing the Right Alert Type


Best Practices

Set thresholds that allow time to react — for below conditions, set warning at 2–5× the critical value. For above conditions, set warning at 80% and critical at 100% of the limit.
Handle recovery webhooks — when a value recovers (e.g. after a top-up or billing cycle reset), Flexprice sends alert_status: ok. Use this to automatically re-enable services or dismiss in-app banners.
Make webhook handlers idempotent — under retry scenarios, the same state transition may be delivered more than once. Use the combination of the entity ID (wallet or feature) + alert_status as an idempotency key.
Combine wallet and usage alerts — wallet alerts track remaining prepaid credit; usage alerts track what has been spent. Using both gives you complete visibility from both directions.
Use feature-level alerts for independent budgets — if a customer’s features have separate allocations, feature-scoped alerts avoid false alarms from unrelated activity.
Test in staging first — configure alert thresholds in a staging environment with test events before enabling in production to verify your webhook handler responds correctly at each level.