Overview
Credit-based billing allows enterprise customers to pre-purchase usage at negotiated rates, consume services against their credit balance, and receive automated alerts and controls as balances deplete. This model provides budget predictability while maintaining usage-based flexibility.When to use credit-based billing
Credit-based billing is ideal for:- Enterprise contracts with annual or multi-year prepayment commitments
- Consumption-based pricing, where customers want budget caps and controls
- Simplified procurement, avoiding monthly variable invoices
- Trial programs providing free credits before paid conversion
- Multi-subsidiary organizations sharing credit pools across business units
Credit granting workflows
There are two primary methods for granting credits to customers:1. Recurring credit allocations (plan-based)
Credits automatically granted on a recurring schedule through credit allocations configured on the plan:- Credits have zero dollar cost basis
- Useful for monthly/quarterly credit allowances
- Automatically replenishes based on plan configuration
- Best for predictable, recurring credit grants

2. Manual credit increments (focus of this guide)
Credits are manually granted through adjustments, typically for:- Prepaid purchases, where customers buy credit packages
- One-time grants for trials, promotions, or compensation
- Variable amounts based on negotiated contracts
- Invoiced credits with a specific cost basis

Initial system configuration
Before onboarding customers with credits, configure these foundational elements that will be reused across all credit-based subscriptions.1. Create billing metrics
Define metrics that track the usage customers will consume credits against:- API calls measured in requests
- Compute time measured in minutes or hours
- Storage measured in GB-days
- Data transfer measured in GB
- Custom units specific to your service

2. Configure custom currencies (pricing units)
Custom currencies allow you to decouple credits from real-world currencies. Create pricing units like:- Credits - Generic unit for multi-service consumption
- Compute Credits - Specialized for compute services
- API Credits - Dedicated to API usage

3. Design credit-enabled plans
Create plans that consume credits rather than generating charges directly:4. Connect payment providers
For automated credit top-ups and overage billing:- Stripe integration for card and ACH payments
- Configure auto-collection settings appropriate for enterprise terms
- Disable auto-issuance for enterprise customers to control invoice delivery
5. Configure internal monitoring
Set up webhooks for credit lifecycle events:Critical webhooks
customer.credit_balance_depleted
- Trigger service restrictions when credits exhaustedcustomer.credit_balance_dropped
- Alert when approaching depletion thresholds
Monitoring webhooks
credit_balance.created
- Track new credit purchasescredit_balance.updated
- Monitor credit consumptionsubscription.usage_exceeded_threshold
- Detect unusual usage patterns
Customer onboarding workflow
Step 1: Create the customer
Requirements:- External customer ID from your system of record
- Customer name and contact information
- Billing address for invoice generation
- External ID mapped from CRM/ERP
- Billing address with valid tax information
- Payment method configured (if auto-collection enabled)
- Metadata tags for segmentation
Step 2: Configure billing settings
Edit customer billing configuration:- Payment terms: Net 30/60/90 for enterprise contracts
- Auto-collection: Usually disabled for enterprise manual payments
- Invoice delivery: Email addresses for automated delivery
- Tax settings: Exemption certificates if applicable
Step 3: Create the subscription
Add the credit-enabled plan to the customer:- Select the enterprise plan created earlier
- Set subscription start date
- Do not override prices unless negotiating custom credit ratios
Step 4: Grant initial credits
Option A: Trial credits (no charge)
For proof-of-concept or trial periods:Option B: Paid credits (invoiced)
For purchased credit packages:Ongoing credit management
Monitoring credit consumption
Track credit usage through multiple channels:- Real-time balance API: Customer balance endpoint
- Usage dashboard: Upcoming invoice API shows current period consumption
- Webhook events: Real-time notifications for balance changes
- Reports: Export credit ledger for historical analysis
Handling credit depletion
When credits approach depletion:- Automated alerts trigger at configured thresholds
- Customer notifications via email or API webhook to customer systems
- Top-up workflows for additional credit purchases
- Service controls optionally restrict access when fully depleted
Credit top-up patterns
Manual top-ups
Customer-initiated purchases through:- Self-service portal with payment method on file
- Sales-assisted process for negotiated packages
- Procurement-approved purchase orders
Automated replenishment
Configure automatic top-ups when balance drops below threshold:- Fixed credit amounts at predetermined prices
- Requires payment method and auto-collection enabled
- Useful for preventing service interruptions

Scheduled purchases
Quarterly or annual credit allocations:- Align with enterprise budget cycles
- Bulk discounts for larger commitments
- Predictable procurement processes

Advanced credit scenarios
Expiring vs non-expiring credits
Expiring credits for:- Trial programs (14-30 day expiration)
- Promotional grants (quarterly expiration)
- Use-it-or-lose-it annual allocations
- Prepaid enterprise commitments
- Long-term contracts
- Rollover agreements
Multiple credit types
Separate credit currencies for different services:- Ledgers and balances
- Consumption rates
- Expiration policies
- Top-up workflows
Invoice and payment workflows
Credit purchase invoicing
When customers purchase credits:- Line item generation showing credit quantity and unit price
- Payment terms following enterprise agreement
- Auto-collection if configured, manual otherwise
Overage handling
When usage exceeds credit balance:- Automatic conversion from credits to currency at configured rates
- Overage invoice generated at period end
- Payment collection per standard terms
- Optional restrictions until overage paid
Automation and integrations
Webhook automation
Implement these webhook handlers:Analytics and reporting
Export credit data for analysis:- Consumption patterns by customer segment
- Credit lifetime and expiration rates
- Top-up frequency and amounts
- Revenue recognition from credit purchases
Troubleshooting common issues
Credits not applying to usage
Verify:- Subscription using credit-denominated plan
- Credits granted to correct customer
- Credit currency matches plan prices
- Credits not expired
Unexpected credit consumption rates
Check:- Price configuration on plans
- Credit-to-currency conversion rates
- Adjustment rules affecting consumption
- Multiple services are consuming same pool
Invoice discrepancies
Review:- Credit purchase amounts and rates
- Overage conversion calculations
- Timing of credit grants vs usage
- Backdated adjustments affecting balance