Glossary

What is metered billing?

Metered billing measures each unit a customer uses, the way a utility meter does, and bills from those measurements. The meter is a stream of usage events; the bill is what those events add up to over a period, priced by the customer's plan.

How it works

From events to a total

  • A meter. A named thing you measure, such as storage, API calls or exports.
  • Events. One record per use, with its own ID, the customer, the quantity and the time.
  • Aggregation. Events are added up per customer and per period.
  • Rating. The total is priced by the plan: an included amount, then a price per unit beyond it.

Example

Your API records one event per request, each with its own ID. A network error makes your backend send one event twice; the meter keeps one. At the end of the month the customer's events add up to 52,000 requests, and the plan decides what that total costs.

Compared

Terms next to it

Usage-based billing
The pricing model of charging for use. Metered billing is how the use behind it is measured.
Usage metering
The measurement on its own, without billing; the counts may also drive limits or analytics.
Overage billing
Charging for the part of the metered total that goes beyond what the plan includes.

Building it yourself

What you handle if you build it

  • An ID for each piece of work. So retries and replays are not counted twice.
  • A place for events while the meter is unreachable. Buffer them and send them later instead of losing usage.
  • Bad events that do not block good ones. An event with a missing field should be set aside, not stop the batch.
  • Work whose size is not known until afterwards. Hold an amount before the work and settle the real figure after it.
  • One count for everyone. The number you bill from should be the one your limits and your customer's usage page read.

In ShipRev

Where metered billing sits in ShipRev

The measuring side sits in metering in ShipRev. Your backend reports usage through the Server SDK after the work is done, and a refused event is set aside without holding up the rest. For work whose cost is not known until afterwards, you reserve an amount first and confirm what was used; a reservation that is never confirmed is reclaimed. The counts sit on the same customer record as the subscription and the entitlements they are measured against.

Metering

In the docs

Report usage from your backend

Identity, subscriptions, metering and entitlements, kept aligned on one customer record