Skip to main content

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:
  1. Invoice is generated with line items
  2. System calculates total amount due
  3. Available credits are applied (by priority)
  4. Remaining balance charged to payment method

Unit Credits

Unit credits are consumed as usage events are ingested:
  1. Usage event is received
  2. Event is matched to a metric
  3. Credits for that metric are decremented
  4. If credits exhausted, usage is billed normally

Consumption Priority

When multiple credit grants exist, consumption follows this order:

Priority Rules

  1. Expiration date - Earliest expiring first
  2. Priority value - Lowest number first
  3. Creation date - Oldest first

Example


Automatic vs Manual Application

Automatic Application

By default, credits are automatically applied to invoices:
  1. When invoice transitions to pending status
  2. Before payment is attempted
  3. Full available balance is applied
To disable automatic application for an account:

Manual Application

When auto-apply is disabled, apply credits manually:

Tracking Consumption

Credit Ledger

Every credit transaction is recorded in the ledger:
Response:

Ledger Entry Types


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

Response:

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:

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:
  1. System automatically reverses the credit consumption
  2. Credits are returned to the original grant
  3. Ledger entry records the reversal

Next Steps

Wallets

Learn about prepaid wallets.

Credit Grants

Create and manage grants.