Usage entitlements
Put a metric and price on an agreement, or hold prepaid credit, and read the balance.
Endpoints
Guides that use it
Sell prepaid credit
Let customers buy credit ahead of time that pays for usage before anything is charged. Charge the pack with an invoice and add the credit when it is paid.
Credits and burndown
Sell prepaid credit, add it safely with an idempotency key, read the balance, and see exactly what is used first when usage is billed.
Entitlements
What each customer gets on an agreement. Metered usage on a pinned price version, an included allowance, an overage policy, and prepaid credit balances.
How usage is billed
Billing periods, late usage, usage on the renewal invoice, the separate usage invoice, prepaid credit, billing runs, held bills and test mode.
Quickstart
Set up usage billing for one customer in test mode and send their first usage events, then read usage so far, in short Node.js scripts.
Set up usage billing
Create a metric, a price, an agreement for a customer's subscription, entitlements and a usage key, with the API or in the dashboard.
Usage billing API
Every usage billing route on the Comecero API, grouped by resource, with who may call it and a link to its full page in the API reference.
Find a customer's subscription GET
Finds the one active billing agreement that covers your customer id at a time, and the subscription it bills. Use it to check which subscription usage sent now (or at `occurred_at`) will be billed to. Secret and trusted tokens may call it; a limited token may not (`403`).
Create or update an entitlement POST
A `metered` entitlement bills a metric on a pinned rate plan version. A `credit` entitlement holds prepaid credit for the agreement. Send an existing `entitlement_id` to update it: its `kind`, agreement, metric and `customer_id` can not change. It answers `201` for a create and for an update. Create a credit entitlement before a metered one that draws on it. Secret and trusted tokens may call it; a limited token may not (`403`).