Skip to main content
Ledger bills almost any usage-based pricing page from one catalog, and the patterns combine on a single plan. Find each line of your pricing page below, then answer five questions to put it together.

Every pattern

Five decisions

Your catalog has features, the things customers use, and plans, what they buy. Each feature has one of five types: credits, metered, held, boolean or ai_tokens (Features). Each plan lists items, what it includes of each feature (Plans and items). Answer these five questions before you write the catalog. Each answer names a pattern page with a complete catalog.

1. One shared credit pool, or an allowance per feature

  • An allowance per feature (“500 messages and 50 exports a month”): make each action a metered feature and give each plan an item with included. Each feature has its own balance and resets each period. See Metered allowances.
  • One shared pool (“1,000 credits a month; an image costs 4”): make each action a credits feature with a creditCost, and give plans monthlyCredits. Every action draws on one balance, so you can price an expensive action higher without a new plan. See Credits.
You can mix them: metered messages and credit-priced images on the same plan.

2. A hard limit, or overage

  • A hard limit: leave overage out. When the allowance runs out, check answers allowed: false and you offer an upgrade, a credit pack or a top-up.
  • Overage: give the plan or the item an overage price. Uses past the allowance are billed on the next invoice, up to one cap. See Overage.
  • Nothing included, every use billed: a $0 plan with overage only. See Pay as you go.
  • A pace on top: cap any window inside the allowance (“never more than 200 a day”) with a usage limit, and hear when customers near it with a usage alert.

3. Per seat, or flat

  • Flat: the plan’s priceCents is the whole price.
  • Per seat: make seats a held feature and give its item a price. The plan then bills each period for the seats held, prorated when the count changes. See Per-seat pricing, and Tiered pricing for prices that fall with volume.
  • A cap on a count, no price (“3 projects on Free”): a held item with included. See Limits.
  • Billed by what was held over the month (“25 cents a GB-month”): a held item with a measured price. See Storage billed by GB-month.
  • On or off (“SSO on Business”): a boolean feature. See Feature flags.

4. Monthly or annual

Plans bill monthly unless you set billingInterval: "year". An annual plan is its own plan, beside the monthly one, and still grants its allowance every month unless you set resetInterval: "year". See Annual plans.

5. Recurring or one-off

  • Recurring: every plan above. It renews until cancelled.
  • Paid once, kept for good: a plan with billingInterval: "one_off". Its credits and allowances never expire. See Lifetime plans.
  • A one-time top-up beside a plan: a credit pack, or a top-up of any amount.
  • Extra credits or allowance every period, beside a plan: a recurring add-on, billed on the plan’s invoice.

From your pricing page to a pattern

Several plans

A customer holds one base plan per group, plus any recurring add-ons beside it, and each of its entities can hold plans of its own. List each group’s plans on the billing page sorted by price: the pricier ones are upgrades, the cheaper ones downgrades. Upgrades and downgrades covers moving between them. Changing a plan’s terms publishes a new plan version, and current subscribers keep theirs. See Plan versions.

Publish

Write the catalog in ledger.config.ts or ledger.catalog.json, then review and publish it:
The push validates the whole catalog before it publishes anything and reports every problem with its path, such as plans.1.items.0.included, so only a fully valid catalog goes live. CLI has every command.