What the customer's next invoice would be if it were drafted now
An estimate of the regular invoice of the period that is still open (or, while a closed period's grace period runs, of that period): the usage and late usage so far, rated by the plan version in force, the fixed fee, tax at the tenant's rate for the customer's country and the credit balance the invoice would use. It is computed by the same code that drafts the real invoice, from the same inputs, and nothing is stored. It moves with every event until the period closes, and a change of plan, a coupon or a tax rate made later can move it too: `estimate` is always `true`, and the response has no id and no number. A fixed fee invoiced in advance is its own invoice and is not in it. A customer with nothing to bill in the period gets `has_invoice: false` and no lines.
Loading the operation...
Usage of one meter against the customer's limit GET
Answered from near-real-time counters. They are eventually consistent (typically well under 2 s behind ingest): `as_of` is the ingest time of the newest event reflected in `used`. Payrudder never blocks ingest on a limit; call this before serving your customer and decide what to do. A customer without an entitlement on the meter is `unlimited`. `period` defaults to the current period in the tenant's time zone. A limit counts over its `window`: the billing month, or an hour, a day, an ISO week, a calendar year or the customer's whole lifetime, in the tenant's time zone. `period` picks the month of a monthly limit; every other window always reports its current one (`window_id`, ending at `resets_at`, which a lifetime window does not have). `allowed` follows the limit's `mode`: a `hard` limit stops allowing at the limit, a `soft` or `notify` one keeps allowing and says `over_limit`. Every window's counter is reconciled against the aggregator every few minutes, so an event delivered twice stops counting twice within one cycle.
Add credits to a customer POST
For a promotion, a goodwill gesture or a sale made outside Payrudder. With an `idempotency_key` (or the `Idempotency-Key` header) a repeat of the call adds nothing and returns `replayed: true`; the same key with other values is `billing.credits.key_reused`.