API Reference — Events Ingestion
API Reference — Meters Creation
Creating a Meter
Meters define how your usage events are aggregated and measured for billing purposes. Before creating a meter, plan your usage tracking strategy:- Identify what usage events you want to track
- Determine how events should be aggregated (count, sum, etc.)
- Define any filtering requirements for specific use cases
Step-by-Step Meter Creation
Follow this guide to set up your usage meter:Configure Basic Information
Configure Aggregation Settings
- Count
- Sum
- Max
- Last
Configure Event Filtering (Optional)
- AND Logic
- OR Logic
user_tier = "premium" AND endpoint = "/api/v2/users"Add Condition
Configure Property Key
Select Comparator
equals— Exact matchnot_equals— Exclusion filtergreater_than— Numeric comparisongreater_than_or_equals— Numeric comparison (inclusive)less_than— Numeric comparisonless_than_or_equals— Numeric comparison (inclusive)contains— String contains substringdoes_not_contain— String exclusion filter
Set Comparison Value
Add Groups
Create Meter
Linking Meter in a Product
Once you have created your meter, you need to link it to a product to enable usage-based billing. This process connects your meter’s usage data to pricing rules for customer billing. Linking meters to products establishes the connection between usage tracking and billing:- Products define pricing rules and billing behavior
- Meters provide usage data for billing calculations
- Multiple meters can be linked to a single product for complex billing scenarios
Product Configuration Process
Transform your usage data into billable charges by properly configuring your product settings:Choose Usage-Based Billing Product Type
Select Associated Meter
Add Your Meter
- Click Add Meters to view available meters
- Select the meter you created from the dropdown list
- The selected meter will appear in your product configuration
Configure Price Per Unit
- 1,000 units consumed = 1,000 × $0.50 = $500.00 charged
- 500 units consumed = 500 × $0.50 = $250.00 charged
- 100 units consumed = 100 × $0.50 = $50.00 charged
Set Free Threshold (Optional)
- Free threshold: 100 units
- Price per unit: $0.50
- Customer usage: 250 units
- Calculation: (250 - 100) × $0.50 = $75.00 charged
Save Configuration
- Usage events sent to your meter will be tracked and aggregated
- Billing calculations will apply your pricing rules automatically
- Customers will be charged based on actual consumption during each billing cycle
Sending Usage Events
Once your meter is configured, you can start sending usage events from your application to track customer usage.Event Structure
Each usage event must include these required fields:Usage Events API Examples
Send usage events to your configured meters using the Events API:Key Things to Know for Reliable Ingestion
Follow these practices to keep usage tracking accurate and resilient in production.timestamp for real-time events and it defaults to the current UTC timestamp. Set it explicitly (ISO 8601) for delayed or batched events so usage lands in the correct billing period. Note the accepted window is narrow: events timestamped more than 1 hour in the past or more than 5 minutes in the future are rejected. Historical backfill is not supported — flush buffered events within the hour.Usage-Based Billing Analytics
Monitor and analyze your usage-based billing data with a comprehensive analytics dashboard. Track customer consumption patterns, meter performance, and billing trends to optimize your pricing strategy and understand usage behaviors.Overview Analytics
The Overview tab provides a comprehensive view of your usage-based billing performance:Activity Metrics
Track key usage statistics across different time periods:Meter Quantities Chart

- Time-series visualization: Track usage patterns across days, weeks, or months
- Multiple meter support: View data from different meters simultaneously
- Trend analysis: Identify usage spikes, patterns, and growth trajectories
Events Analytics

Event Information Display
The events table provides a clear view of individual usage events with the following columns:- Event Name: The specific action or trigger that generated the usage event
- Event ID: A unique identifier for each event instance
- Customer ID: The customer associated with the event
- Timestamp: When the event occurred
Customer Analytics
The Customers tab provides a detailed table view of customer usage data with the following information:Available Data Columns
Table Features
- Column Filtering: Use the “Edit Columns” feature to show or hide specific data columns
- Real-time Updates: Usage data reflects the most current consumption metrics
Aggregation Examples
Here are practical examples of how different aggregation types work:Understanding Aggregation Types
Different aggregation types serve different billing scenarios. Choose the right type based on how you want to measure and charge for usage.Practical Implementation Examples
These examples demonstrate real-world applications of each aggregation type with sample events and expected results:Count Aggregation — API Calls
Count Aggregation — API Calls
- Event Name:
api.call - Aggregation Type: Count
- Measurement Unit:
calls
Sum Aggregation — Data Transfer
Sum Aggregation — Data Transfer
- Event Name:
data.transfer - Aggregation Type: Sum
- Over Property:
bytes - Measurement Unit:
GB
Max Aggregation — Peak Concurrent Users
Max Aggregation — Peak Concurrent Users
- Event Name:
concurrent.users - Aggregation Type: Max
- Over Property:
count - Measurement Unit:
users
Event Filtering Examples
- Filter by API Endpoint
- Filter by Value Range
- Complex Multi-Condition Filters
- Property:
endpoint - Comparator:
equals - Value:
/v1/orders
Troubleshooting
Resolve common issues with usage-based billing implementation and ensure accurate tracking and billing.Common Issues
Most usage-based billing problems fall into these categories:- Event delivery and processing issues
- Meter configuration problems
- Data type and formatting errors
- Customer ID and authentication issues
Debugging Steps
When troubleshooting usage-based billing:- Verify event delivery in the Events analytics tab
- Check that meter configuration matches your event structure
- Validate customer IDs and API authentication
- Review filtering conditions and aggregation settings
Solutions and Fixes
Events not showing in meter
Events not showing in meter
- Event name doesn’t exactly match meter configuration
- Event filtering conditions are excluding your events
- Customer ID doesn’t exist in your Dodo Payments account
- Event timestamp is outside the current billing period
- Verify event name spelling and case sensitivity
- Review and test your filtering conditions
- Confirm customer ID is valid and active
- Check that event timestamps are recent and properly formatted
Aggregation not working as expected
Aggregation not working as expected
- Over Property name doesn’t match event metadata keys
- Metadata values are the wrong data type (string vs number)
- Missing required metadata properties
- Ensure metadata keys exactly match your Over Property setting
- Convert string numbers to actual numbers in your events
- Include all required properties in every event
Filtering not working
Filtering not working
- Filter property names don’t match event metadata
- Wrong comparator for data type (string vs number)
- Case sensitivity in string comparisons
- Double-check that property names match exactly
- Use appropriate comparators for your data types
- Consider case sensitivity when filtering strings