How Usage Billing Works
- Usage occurs - Customer uses your product (API calls, storage, etc.)
- Events recorded - Usage events are sent to Alguna
- Usage aggregated - Alguna totals usage for the billing period
- Invoice generated - Charges calculated based on your pricing
- Payment collected - Customer pays for their usage
Step 1: Create a Billable Metric
Define what you want to measure:- Navigate to Settings → Billable Metrics
- Click Create Metric
- Fill in the details:
- Name: What you’re measuring (e.g., “API Calls”)
- Code: Unique identifier (e.g.,
api_calls) - Aggregation Type: How to count usage
Aggregation Types
- Click Create
Step 2: Create a Usage-Based Product
- Navigate to Products
- Click New Product
- Configure:
- Name: Product name (e.g., “API Usage”)
- Fee Type: Select Metered
- Metric: Select the metric you created
- Pricing Model: Choose how to price usage
Pricing Models for Usage
- Click Save
Step 3: Add to a Plan
- Navigate to Plans
- Select or create a plan
- Click Add Product
- Select your usage-based product
- Click Save
Step 4: Send Usage Events
Work with your development team to send usage events. They’ll need:- Metric Code: The code you defined (e.g.,
api_calls) - Account ID: The customer’s Alguna account ID
- Timestamp: When the usage occurred
Viewing Customer Usage
Current Period Usage
- Navigate to Customers → [Customer Name]
- Click the Usage tab
- View:
- Usage by metric
- Estimated charges
- Usage trends
Historical Usage
- Navigate to Reports → Usage
- Filter by customer, metric, or date range
- Export data if needed
Common Use Cases
API Billing
Storage Billing
Compute Billing
Active User Billing
Troubleshooting
No Usage Showing
- Verify usage events are being sent (check with your dev team)
- Confirm the metric code matches exactly
- Check timestamps are within the billing period
Incorrect Charges
- Review the metric aggregation type
- Check pricing model configuration
- Verify billing period dates
Best Practices
Clear Naming
Use descriptive metric names customers will understand.
Test First
Test usage tracking in sandbox before production.
Monitor Usage
Regularly review usage reports for anomalies.
Communicate Pricing
Clearly explain usage-based charges to customers.
Next Steps
Define Metrics
Learn more about metric configuration.
Pricing Models
Explore pricing options.