Credits & Wallets
Credits provide a flexible way to offer prepaid balances, promotional incentives, and consumption-based pricing to your customers. Alguna’s credit system supports both monetary credits (USD, EUR, etc.) and unit-based credits (API calls, tokens, seats).Managing Credits via Dashboard
View Customer Credits
- Navigate to Customers → [Customer Name]
- Click the Credits tab
- View:
- Current balance by type (monetary, units)
- Active credit grants
- Expiring credits
- Transaction history
Grant Credits to a Customer
- Navigate to Customers → [Customer Name] → Credits
- Click Grant Credits
- Fill in the grant details:
- Type: Monetary or Units
- Amount: Credit value (e.g., $100 or 1,000 API calls)
- Currency/Metric: USD, EUR, or metric code for units
- Expiration: When credits expire (optional)
- Priority: Lower number = used first
- Reason: Internal note (e.g., “Welcome credit”, “Service compensation”)
- Click Grant
View Credit Transactions
- Navigate to Customers → [Customer Name] → Credits
- Click Transactions or History
- Filter by:
- Date range
- Transaction type (grant, consumption, expiration)
- Credit grant
- Export transactions if needed
Void Credits
- Find the credit grant in the customer’s credits tab
- Click the ⋮ menu → Void
- Enter reason for voiding
- Confirm
Key Concepts
Credit Grants
A credit grant is an allocation of credits to a customer account. Each grant has:- Amount: The number of credits or monetary value
- Type:
monetary(currency-based) orunits(quantity-based) - Expiration date: Optional date when unused credits expire
- Priority: Order in which credits are consumed (lowest first)
Credit Ledger
The credit ledger tracks all credit transactions for an account:- Credit grants (additions)
- Credit consumption (deductions)
- Expirations (automatic removals)
- Adjustments (manual corrections)
Wallets
A wallet is a prepaid account balance that customers can top up and use for payments. Wallets support:- Multiple currencies
- Automatic payment deduction
- Top-up notifications
- Balance thresholds
Credit Types
Monetary Credits
Monetary credits have a specific currency value and can be applied to invoices.- Promotional discounts
- Referral bonuses
- Service credits for outages
- Prepaid account balances
Unit Credits
Unit credits represent quantities that can be consumed against usage-based products.- API call packages
- Compute hours
- Message credits
- Storage allocations
Credit Lifecycle
1. Grant Created
When you create a credit grant, it becomes immediately available for the customer.2. Active
Credits are available for consumption against invoices or usage.3. Consumption
Credits are automatically applied based on:- Invoice generation (monetary credits)
- Usage events (unit credits)
- Manual application
4. Expiration
Unused credits are automatically expired on the expiration date. Expired credits cannot be recovered.Credit Application Rules
Priority Order
When multiple credit grants exist, they are consumed in this order:- Expiration date (earliest first)
- Priority value (lowest first)
- Creation date (oldest first)
Partial Consumption
Credits can be partially consumed. If an invoice is 75 in credits:- $75 applied from credits
- $25 charged to payment method
Currency Matching
Monetary credits must match the invoice currency. A USD credit cannot be applied to a EUR invoice.Webhooks
| Event | Description |
|---|---|
account.credits.granted | Credits manually granted to customer |
account.credits.balance_depleted | Credit balance reaches zero |
Example Webhook Payloads
Credit Granted:Best Practices
Set Expiration Dates
Always set reasonable expiration dates to prevent indefinite liabilities on your books.
Use Priority Values
Assign priorities to ensure promotional credits are used before purchased credits.
Monitor Balances
Set up webhooks to notify customers when balances are depleted.
Document Terms
Clearly communicate credit terms, including expiration and non-transferability.