Credit Consumption
Credits are automatically consumed when invoices are generated or usage events occur. This guide explains the consumption mechanics and how to track credit usage.How Credits Are Consumed
Monetary Credits
Monetary credits are applied when an invoice is finalized:- Invoice is generated with line items
- System calculates total amount due
- Available credits are applied (by priority)
- Remaining balance charged to payment method
Unit Credits
Unit credits are consumed as usage events are ingested:- Usage event is received
- Event is matched to a metric
- Credits for that metric are decremented
- If credits exhausted, usage is billed normally
Consumption Priority
When multiple credit grants exist, consumption follows this order:Priority Rules
- Expiration date - Earliest expiring first
- Priority value - Lowest number first
- Creation date - Oldest first
Example
Automatic vs Manual Application
Automatic Application
By default, credits are automatically applied to invoices:- When invoice transitions to
pendingstatus - Before payment is attempted
- Full available balance is applied
Manual Application
When auto-apply is disabled, apply credits manually:Tracking Consumption
Credit Ledger
Every credit transaction is recorded in the ledger:Ledger Entry Types
| Type | Description |
|---|---|
grant | Credit grant created |
consumption | Credits used for invoice/usage |
expiration | Credits expired |
void | Grant voided |
adjustment | Manual adjustment |
Invoice Credit Display
When credits are applied to an invoice, they appear as a line item:Unit Credit Consumption
For usage-based products, unit credits are consumed in real-time:Configuration
Link credits to specific metrics:Consumption Flow
Checking Unit Balance
Pending Consumption
Some consumption is recorded as “pending” before being confirmed:When Pending Occurs
- Pre-authorization for large transactions
- Usage aggregation periods
- Invoice draft state
Confirming Pending
Pending consumption is automatically confirmed when:- Invoice is finalized
- Billing period closes
- Manual confirmation via API
Rolling Back Pending
If an invoice is voided or usage is corrected:Consumption Reports
Dashboard
View consumption analytics at Reports > Credits:- Consumption by period
- Top consumers
- Expiration forecasts
- Grant utilization rates
API Export
Webhooks
Monitor consumption with webhooks:| Event | Description |
|---|---|
credits.consumed | Credits applied to invoice/usage |
credits.balance_low | Balance below threshold |
credits.balance_depleted | Balance reached zero |
Balance Threshold Configuration
Set alerts when balance falls below a threshold:Common Scenarios
Partial Credit Application
Apply only part of available credits:Credit Refund
If an invoice is voided after credits were applied:- System automatically reverses the credit consumption
- Credits are returned to the original grant
- Ledger entry records the reversal