Events
Grant-level events
credits.granted— A new credits grant (block) was created.credits.grant.updated— An existing credits grant changed (e.g., amount, dates, cost).credits.grant.usage_low— A specific grant crossed one of the configured low-credits thresholds. Thresholds are configurable, allowing multiple alert levels.credits.grant.depleted— A specific grant’s balance reached zero.credits.expired— A grant reached its expiration time.
Balance-level events
credits.balance.usage_low— Aggregate balance (per customer/resource/currency) fell below one of the configured thresholds. Thresholds are configurable per customer, allowing multiple alert levels (e.g., 80%, 50%, 20%).credits.balance.depleted— Aggregate balance (per customer/resource/currency) reached zero.
Credit consumption
| Field | Data type (typical) | Notes |
|---|---|---|
environment_id | string/uuid | Environment identifier |
customer_id | string/uuid | Customer identifier |
resource_id | string/uuid | Resource identifier |
event_id | string/uuid | Usage event identifier |
feature_id | string/uuid | Metered feature identifier |
partial_cost | decimal | Portion of cost attributed to a specific grant/block |
total_cost | decimal | Total cost of the event across all grants/blocks |
credit_grant_id | string/uuid | Reference to the credit grant used |
credit_currency_id | string/uuid | Credit currency identifier |
consumption_timestamp | timestamp | When consumption was recorded |
event_timestamp | timestamp | When the underlying event occurred |
created_at | timestamp | Ingestion/row creation time |
Credit grants
| Field | Data type (typical) | Notes |
|---|---|---|
id | string/uuid | Primary identifier of the credit grant |
created_at | timestamp | Row creation time |
updated_at | timestamp | Last update time |
account_id | string/uuid | Account identifier |
environment_id | string/uuid | Environment identifier |
display_name | string | Human-readable name/label |
amount | decimal | Granted credits amount |
consumed_amount | decimal | Credits consumed from this grant |
grant_type | string/enum | Grant category/type (e.g., promo, purchase) |
priority | integer | Consumption priority among grants |
effective_at | timestamp | When the grant becomes usable |
expire_at | timestamp | When the grant expires |
additional_meta_data | json | Arbitrary metadata |
comment | string | Optional note/comment |
customer_id | string/uuid | Customer identifier |
customer_ref_id | string | External/customer reference ID |
resource_id | string/uuid | Resource identifier |
resource_ref_id | string | External/resource reference ID |
custom_currency_id | string/uuid | Reference to custom currency (if applicable) |
currency_id | string/uuid | Reference to base currency |
cost_amount | decimal | Monetary cost amount (if tracked) |
cost_currency | string | ISO currency code for cost_amount |
credit_grant_id | string/uuid | Grant identifier (if separate from id) |
Custom currencies
| Field | Data type (typical) | Notes |
|---|---|---|
id | string/uuid | Primary identifier |
created_at | timestamp | Row creation time |
updated_at | timestamp | Last update time |
account_id | string/uuid | Account identifier |
environment_id | string/uuid | Environment identifier |
display_name | string | Currency display name |
currency_id | string/uuid | Base currency reference |
symbol | string | Display symbol (e.g., “AIT”) |
description | string | Optional description |
additional_meta_data | json | Arbitrary metadata |
units_singular | string | Singular unit label (e.g., “AI Token”) |
units_plural | string | Plural unit label (e.g., “AI Tokens”) |
Notifying customers about low balance and depletion
Use credit webhooks to proactively notify customers before they run out of credits and when their balance is depleted. This helps prevent unexpected service interruptions and improves customer experience.Setting up configurable thresholds
Thresholds are configurable per customer, allowing you to set multiple alert levels (e.g., 80%, 50%, 20% remaining). When a customer’s credit balance crosses any of these thresholds, Stigg fires acredits.balance.usage_low webhook event.
Recommended notification strategy
| Threshold | Recommended action |
|---|---|
| 80% remaining | Send a gentle reminder email or in-app notification that credits are being consumed |
| 50% remaining | Display a more prominent in-app banner suggesting the customer top up soon |
| 20% remaining | Send an urgent notification and consider enabling auto top-up prompts |
| 0% remaining (depleted) | Notify the customer their credits are exhausted and prompt immediate action |
Implementation example
Use cases
- Email notifications — Send automated emails at each threshold to keep customers informed
- In-app banners — Display contextual warnings in your application UI
- Slack/Teams alerts — Notify customer success teams when high-value customers are running low
- Auto top-up triggers — Prompt customers to enable automatic recharging before they deplete
- Usage dashboards — Update real-time dashboards showing credit consumption trends
- Access enforcement — Implement hard or soft limits when credits are depleted
Best practices
- Use idempotency — The
messageIdfield ensures you don’t process the same event twice - Configure multiple thresholds — Set alerts at 80%, 50%, and 20% to give customers time to act
- Personalize messaging — Include the credit currency name and remaining balance in notifications
- Provide clear CTAs — Always include a direct link to top up or manage credits
- Track engagement — Monitor which notifications drive the most top-ups to optimize your strategy
