Olaryn BillingBilling, credits and usage
Before a job starts, Olaryn Billing puts the cost on hold. When it’s done, people pay only for what was used. The rest goes back.
Example account
| What happened | Change | Left |
|---|---|---|
| Starting balance | — | 100 |
| Hold for a reportBefore the work starts | −12 | 88 |
| Report finishedUsed 9, 3 go back | +3 | 91 |
- Hold the costThe product works out the price and Olaryn Billing sets those credits aside.
- Do the workThe held credits can’t be spent on anything else in the meantime.
- Charge what was usedUnused credits go straight back. If the job is cancelled, all of them do.
One place for billing. Shared by every Olaryn product.
- Handles
- Subscriptions
- Credits
- Usage
- Refunds
Service integrationsStripe, OpenMeter and Olaryn Billing
Stripe looks after the money. OpenMeter looks after what each customer can use. Olaryn Billing makes sure the two always agree.
The money
Checkout, invoices and saved payment methods.
The access
Credits, plan features and how much has been used.
The go-between
Holds, retries, plan changes and a record of every change.
Each product decides what its work costs. Every request to Olaryn Billing is checked by Olaryn Identity and limited to one product.
Accounting safeguardsfor credits and billing
The accounting rules used when processing reservations, payments and refunds.
- No double spendingTwo jobs that each need 25 credits, with only 35 left: exactly one goes ahead.
- Pay first, then accessPlans and allowances change only after a payment has really gone through.
- Safe to try againIf a request is sent twice, it still only counts once.
- Refunds take credits backWhen a payment is refunded or disputed, the credits it bought are removed.
Credits have an end datedepending on where they came from
Each kind of credit follows its own simple rule.
Monthly allowance
Ends at the end of each month.
Credit pack
Comes with its own end date.
Yearly plan
Released one month at a time during the paid year.
For developershold, then charge or cancel
A product requests a credit hold, settles actual usage or releases the reservation. Requests carry an Olaryn Identity token.
Example requests
# 1. Hold the cost before the work starts
POST /v1/{product}/customers/{customer}/reservations
Authorization: Bearer <Olaryn Identity machine token>
{
"amount": 12,
"operation": "export-report",
"idempotency_key": "<same key if you retry>",
"resource_type": "report",
"resource_id": "<report id>"
}
# 2a. Work finished: charge what was used
POST .../reservations/{id}/settle
{ "amount": 9 }
# 2b. Work cancelled: give the credits back
POST .../reservations/{id}/release
{ "reason": "cancelled" }