

Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
How Flexprice turns usage into invoices: usage events, features, plans and prices, customers, subscriptions, and invoices, and how each one feeds the next


| Concept | What it is | How it connects to the rest |
|---|---|---|
| Usage events | A record of one piece of usage by one customer, sent by your application | Its event_name decides which features count it, and its external_customer_id decides which customer it belongs to |
| Features | Something you meter or grant access to | A metered feature aggregates matching events into a quantity that a usage price charges for |
| Plans and prices | A price charges for a feature’s usage or a fixed fee, and a plan bundles prices, entitlements, and credit grants | A new subscription copies the plan’s matching prices into its own line items |
| Customers | The account you bill, identified by your own External ID | A customer holds subscriptions, and its External ID links it to its usage |
| Subscriptions | One customer on one plan, from a start date, in one currency and billing period | Bills the customer’s usage against its line items, and raises an invoice for each billing period |
| Invoices | The bill for a stretch of time | Collects advance fees and the usage of the period that ended, then applies discounts, credits, and tax |
| Mistake | What it costs | Where it’s covered |
|---|---|---|
Retrying an event without a fixed event_id and timestamp | The usage counts twice | Making usage events idempotent |
| Summing a reading, such as seats in use | Every reading is billed | Choosing an aggregation |
A metered entitlement with no usage_limit on a priced feature | The usage price bills 0 | Combining entitlements and prices |
| An External ID that differs from your events, even in letter case | The usage is never billed | Choosing an External ID |
| Two subscriptions for one customer pricing the same feature | The usage is billed twice | Running several subscriptions |
| Cancelling immediately without asking for a final invoice | The current period’s usage is never billed | Cancelling a subscription |
| Sending usage after the period’s invoice is computed | The usage misses that invoice | Billing late usage |
