Overview
When implementing a usage-based plan for your customers on Salesbricks, you have the flexibility to charge based on two distinct types of usage data: Gauges and Counters, referred to as Final value and Prorated in the admin interface.
Counter / Final value
With final value measurement, tally up all billable events over a set time period. This approach is suitable for measuring cumulative usage, such as the total number of API calls in a month.
Example
![final-value](https://mintlify.s3-us-west-1.amazonaws.com/salesbricks/api-reference/usage/images/final-value.png)
Calculation is sum(billable events) * unit price = total
.
In the illustrated graph,
Use cases
Gauges / Prorated
With prorated measurement, tally up billable events per time unit over a set period. This method is ideal for tracking usage over time, such as virtual machine hours used in a month.
Example
![prorated](https://mintlify.s3-us-west-1.amazonaws.com/salesbricks/api-reference/usage/images/prorated.png)
Calculation is ((billable events * time unit (days), ...) * unit price = total
.
In the illustrated graph,
Use cases
Simple API Calls
Regardless of your chosen pricing strategy, integrating usage data with Salesbricks requires just two simple API calls:
incrementCounter
Used with final value bricks, this call increments the counter for a specific billable event.
setGauge
Used with prorated bricks, this call sets the gauge for a specific billable event and time unit.