timestamp places the usage in the right billing period, and there is no limit on how old a timestamp can be.
Backfilling usage events with the bulk endpoint
- Set
timestampto when the usage happened, not when you send it. - Derive
event_idfrom the source record, such as the row ID in your old billing system’s export or the original request ID. A rerun after a failure then collapses with what already arrived instead of counting twice. - Send batches of up to 1000 events with
POST /v1/events/bulk. See High-Volume Ingestion. - Run it in a sandbox environment first. Compare totals per customer and feature with your source data, then run the same backfill in production.
How backfilled usage reaches invoices
What happens to backfilled usage depends on the state of the invoice for the billing period its timestamp falls in:Correcting usage you already sent
Flexprice has no endpoint to edit or delete a usage event, and a negative property value counts as0, so a negative event can’t cancel usage.
- Missing usage: send it as new events with new
event_idvalues. The table above decides how it reaches the invoice. - Usage that shouldn’t have been counted: Flexprice keeps the event, so correct the bill instead. Once the invoice is finalized, issue a credit note for the difference.
Send Usage Events with the API and SDKs
Authentication, single and bulk requests, and the responses to handle.
Idempotency and Deduplication
How Flexprice recognizes a copy of an event, and how to make retries and heartbeats safe.

