Customers
A customer is the party you bill. Each customer has an ID (yours or Orvlin’s), a name, an optional billing email, a currency, and free-formmetadata. Every other object refers to a customer by ID.
Set id to your own identifier when you create a customer. Then you never have to store a mapping between the two systems.
Events
An event records something a customer did: an API call, a generated image, a row written. Each event has:customerId: who did it.eventName: what happened, such asapi_call.timestamp: when it happened. Defaults to the time of ingestion.properties: details a metric can aggregate, such aslatencyMsortokens.idempotencyKey: optional. Events with the same key are counted once.
Metrics
A metric turns events into a number per billing period. The aggregation types are:
Metrics can filter events and group them by a property.
Prices
A price charges for a metric (or for a flat fee, when it has no metric). Each price has:- a
configwith a pricingmodel(unit, tiered, bulk, package, percentage, or license). See Pricing models. - a
cadence:monthly,quarterly,annual,one_time, orusage_based. - a
timing:in_advance(charged at the start of the period) orin_arrears(charged at the end).
Plans
A plan is a named bundle of prices. Customers subscribe to plans, not to individual prices. Editing a plan creates a new version, so existing subscriptions keep the terms they signed up for until you migrate them.Subscriptions
A subscription connects a customer to a plan from a start date. Itsstatus is one of active, trialing, past_due, paused, or canceled.
You can cancel a subscription immediately or at the end of the period, amend it, schedule an amendment, or migrate it to a newer plan version.
Invoices
Orvlin creates invoices for each billing period, for prepaid credit purchases, and for manual charges. An invoice moves through these statuses:Credits and wallets
Credits are a prepaid balance a customer spends as they use your product. Each credit type (for exampleai_images) has its own wallet per customer. Usage can draw down a wallet automatically, and a wallet can top itself up when it falls below a threshold. See Prepaid credits.
Entitlements
An entitlement answers “may this customer use this feature right now, and how much is left?” It is derived from the customer’s subscription, plan, credits, and any grants you have added. See Entitlements.Webhooks
Webhooks deliver events such asinvoice.paid and subscription.created to an HTTPS endpoint you own, with a signature you can verify. See Webhooks.
Next steps
Pricing models
Unit, tiered, bulk, package, percentage, and license pricing.
Pricing as code
Declare your catalog in a
pricing.yaml file.