BillingConcepts
Product and Price
The Product and Price entities in Billing.
A Product is the catalog entry for something you sell — a plan, a feature pack, a one-off SKU. A Price is a specific monetary amount + currency + recurrence attached to a product. A product may have many prices (currency variants, monthly vs. yearly, grandfathered tiers); subscriptions and invoices charge against a Price ID, never a Product ID.
Lifecycle
- Create the product with
createProduct.active: truemakes it usable for new prices and checkouts. - Create one or more prices with
createPrice, passing theproduct_id. Prices are immutable in terms ofunit_amount,currency, and recurrence — to change the amount, create a new price and migrate subscriptions. - Set a default by patching
default_price_idon the product so checkouts and the customer portal can resolve a single price per product. - Archive with
archiveProductorarchivePricewhen retired. Archived products and prices remain valid on existing subscriptions but cannot be selected for new ones.
Relationships
A PriceData belongs to one ProductData (product_id). Subscriptions reference prices through SubscriptionItem.price_id. Invoice line items can link to a price_id for catalog-driven invoicing or use raw unit_price + description for ad-hoc lines. Coupons may scope to specific products via applies_to_products.
Fields that matter
- Product
name(string) anddescription(string) — surfaced on hosted invoices, checkouts, and the customer portal. - Product
default_price_id(string) — the price used when callers don't specify one (e.g. customer portal plan switcher). - Price
unit_amount(number, smallest currency unit — cents) andcurrency(CurrencyCode) — what gets charged per unit. - Price
recurring(boolean) —truerequiresinterval(day|week|month|year) andinterval_count;falseis a one-time price suitable for invoices and checkouts. - Price
pricing_model(PricingModel) —per_unit,tiered_volume,tiered_graduated,package,metered, orflat_rate.meteredrequires usage reports (see Meter usage). - Price
trial_period_days(number) — applies a default trial when the price is used to start a subscription without an explicittrial_period_daysoverride.