Ingest usage events (1..500 per request, at most 1 MiB)
Answers `202` with one result per event, in request order, for any structurally valid batch. A bad event does not fail the batch: it comes back `rejected` with an `error_code`. Live keys must send an `idempotency_key` per event; a retry with the same key and payload returns `duplicate` with the original `event_id`. `quantity` may be a JSON string or number and is parsed as an exact decimal (never as a float). The `ingest` rate limit is charged per event.
Loading the operation...
Correct usage events (1..500 per request, at most 1 MiB) POST
A correction is a new event, never an edit: it names the `idempotency_key` of the event it corrects and the `quantity` that event should have had (`0` cancels it), with a `reason`. The service works out the difference between that and what the event stands at now (its own quantity plus every earlier correction of it) and adds it to the **period of the original event**, by the rules every event follows: while that period is open, or closed but inside its grace period, the usage of the period changes exactly; once it has passed its cutoff or been rated, the difference becomes **late usage** of that period, a (negative, for less) `LATE_USAGE` line on the invoice of the period the correction was accepted in. A finalized invoice is never changed. Only events of meters that add (`SUM`, `COUNT`) and have no property filter can be corrected (`CORRECTION_UNSUPPORTED_METER` otherwise). For a `COUNT` meter an event is one whatever its quantity, so the only corrections are `0` (cancel it) and any positive quantity (count it again). An event can be corrected as long as its idempotency key is remembered, which is at least 45 and less than 76 days after it was first seen (`CORRECTION_UNKNOWN_EVENT` after). A correction cannot be corrected: send the original's key again with the quantity it should have. `customer_external_id` and `meter_code` must be the original's. The answer is `202` with one result per correction, in request order, like `POST /v1/events`; the correction has its own `idempotency_key`, and a retry with the same key and payload is a `duplicate` and changes nothing. A refused correction claims no key. Who made it (the signed-in person, or the API key) and the reason are kept. The `ingest` rate limit is charged per correction. A correction is not usage and is not metered as events.
Correct one of your paid invoices with a numbered credit note, added to the customer's credit balance or refunded to the card POST
An issued invoice is never edited. The note's amount goes to the customer's credit balance in the invoice's currency and pays their next invoice, or, with refund_to_card, back to the card through the payment provider that took the payment (the note's refund_state says whether it went through; a refund nobody answers is sent again, and a failed one can be retried with POST /v1/credit-notes/{id}/retry-refund). The notes of an invoice never add up to more than the invoice. Only a paid invoice can be credited: `409 billing.credit_note.not_paid` for any other, `409 billing.credit_note.fully_credited` when nothing is left of it, `409 billing.credit_note.nothing_to_refund` when refund_to_card is asked of a payment no provider can return. Works on the invoices of the key's (or the signed-in person's) own environment only. Needs `invoices:write`. Recorded in the audit log (`credit_note.issued`).