Overview
Prices define the actual cost and billing mechanics for plans, add-ons, and other entities in FlexPrice. Each price specifies how much to charge, when to charge it, and how to calculate the amount based on quantity or usage.Price Structure
Core Configuration
Unique identifier for the price (max 50 characters)
Price amount in major currency units (e.g., 12.50 for $12.50, not cents)
Three-letter ISO currency code in lowercase (e.g.,
usd, eur, gbp)Formatted amount with currency symbol (e.g., “$12.50”)
Human-readable name for the price (max 255 characters)
Price type:
FIXED: Static price (seats, licenses, base fees)USAGE: Consumption-based price (requiresmeter_id)
Entity this price belongs to:
PLAN: Price for a planADDON: Price for an add-onSUBSCRIPTION: Subscription-level overridePRICE: Price override
ID of the plan, addon, subscription, or price this price is associated with
Billing Configuration
How to calculate the total:
FLAT_FEE: Simple per-unit pricing (amount × quantity)PACKAGE: Fixed price for a bundle of unitsTIERED: Different prices at different volume levels
Frequency of charges:
RECURRING: Charges repeat each billing periodONETIME: Single charge
Duration of each billing cycle:
DAILY,WEEKLY,MONTHLY,QUARTERLY,HALF_YEARLY,ANNUAL
Number of billing periods (e.g.,
2 with MONTHLY = every 2 months)When to generate invoices:
ADVANCE: Invoice at the start of the periodARREAR: Invoice at the end of the period (default for usage-based)
Additional Fields
Human-readable identifier for API lookups (max 255 characters)
Detailed description of what this price covers
Trial period in days (only for
FIXED prices with RECURRING cadence)Minimum quantity that can be purchased
When this price becomes active
When this price expires (null = no expiration)
Custom key-value pairs
Billing Models
- Flat Fee
- Package
- Tiered
Simple per-unit pricing. Total = amount × quantity.Example Calculation:
Flat Fee Price
- 5 users × 250/month
- 10 users × 500/month
- Per-seat pricing
- Per-license fees
- Simple subscription fees
Price Types
Fixed Prices
Fixed Prices
Static prices independent of usage tracking.Characteristics:
- No meter required
- Quantity set manually (e.g., number of seats)
- Supports trial periods
- Predictable billing amounts
- Subscription base fees
- Per-seat licenses
- Flat-rate services
Usage Prices
Usage Prices
Consumption-based prices tied to meters.Characteristics:
- Requires
meter_id - Quantity calculated from tracked events
- No trial periods (usage-based by nature)
- Typically invoiced in arrears
- API calls
- Compute hours
- Storage consumption
- Data transfer
Advanced Features
Custom Price Units
Charge in non-fiat currencies or custom units (credits, tokens, etc.).Custom Price Unit
price_unit_type:FIATorCUSTOMprice_unit_id: ID of custom unit entityprice_unit_amount: Amount in custom unitsconversion_rate: Exchange rate to fiat (1 BTC = 40,000 USD)
Tiered Pricing with Flat Fees
Combine per-unit pricing with tier-specific fixed fees.Tier with Flat Amount
- 50 units: (50 × 50.00 = $100.00
Price Lifecycle Management
Time-Bound Price
Active Price Logic: A price is active when:
- Status is
published - Current time ≥
start_date(if set) - Current time <
end_date(if set)
Best Practices
Use Decimal Precision
Store amounts with appropriate precision. FlexPrice uses
decimal(25,15) internally. Avoid floating-point errors.Set Display Names
Use clear
display_name values: “Base Subscription”, “Overage Charges”, “Per-User Fee”Plan for Currency
Create separate prices for different currencies rather than relying on conversion:
Group Related Prices
Use
group_id to associate prices that should be managed together (e.g., monthly and annual versions)Invoice Timing:
ADVANCE: Customers pay at the start (common for subscriptions)ARREAR: Customers pay at the end (typical for usage-based pricing)
Example Configurations
Related Resources
Tiered Pricing
Deep dive into volume and slab pricing models
Plans
Organize prices into sellable plans
Meters
Track usage for consumption-based pricing
Subscriptions
How prices are applied to customer subscriptions