Glossary
What is usage-based billing?
Usage-based billing charges a customer for what they actually use, such as API calls, exports or records processed, instead of, or on top of, a fixed fee per period. The product counts each unit of use, compares the total with what the customer's plan includes, and turns the result into a charge or a limit.
How it works
Five parts, one count
- A unit. The thing you count, such as an export or an API call.
- Usage events. Each time a customer consumes a unit, your product records who used it, how much and when.
- An allowance. What the plan includes for a period before anything extra applies.
- A period. The window the count runs over. When it ends, the count starts again.
- Overage. What happens to use beyond the allowance: refuse it, charge for it, or ask the customer to upgrade.
Example
A plan includes 1,000 exports a month. A customer runs 1,040 exports in the month. The first 1,000 are covered by the plan; the other 40 are overage, and the plan's overage rule decides whether they were allowed and what they cost. When the next month starts, the count goes back to zero.
Compared
Terms next to it
- Metered billing
- The measuring side of usage-based billing: recording each unit of use so it can be counted and charged. The two names are often used for the same thing.
- Flat-rate pricing
- One fixed price per period, whatever the customer uses. Nothing is counted, and heavy and light users pay the same.
- Overage billing
- The part of usage-based billing that deals with use beyond what the plan includes.
Building it yourself
What you handle if you build it
- Count every event once. Give each event its own ID and drop repeats, so a retry is not counted twice.
- Keep counts per customer and per period. Add each event to the right customer's allowance, and start a new count when the period resets.
- Check before the work. Look at what is left before doing metered work, so a customer at the limit is stopped or charged as the plan says.
- Keep the plan and the count in step. When a customer changes plan, the allowance they are counted against has to change with it.
- Show where the customer stands. Expose usage and what is left, to the customer and to your own team.
In ShipRev
Where usage-based billing sits in ShipRev
Usage-based billing sits in metering, one of the four states ShipRev keeps on each customer record. Your backend reports usage events through the Server SDK, and ShipRev counts them against the allowance the customer's plan grants for the current period, starting a new period at each reset. A refused event is set aside without holding up the others. Beyond the allowance, the capability's overage policy decides whether further use is refused, or paid from the customer's prepaid wallet when the overage has a price and the balance covers it.
MeteringIn the docs