ledger.catalog.json
Plan fields
Items
A metered item’s
trialIncluded is what a trial includes instead of included, and its prepaid prices units past included in prepaid packs. A metered item with included: 0 and an overage price is pay as you go. A held item’s price makes it a per-seat price, flat or tiered. A credits feature needs no item: any plan’s credits pay for it.
Free, paid and pay as you go
- Free: a price of
0, no overage and no priced item. It runs entirely in Ledger, starts at once on attach, and renews monthly. - Paid: a price above 0. It syncs to Stripe as a product with a price, and is bought through Checkout or a saved card.
- Pay as you go: a price of
0with an overage price. It needs a card and gets a $0 Stripe subscription that bills usage.
Groups and entity plans
A customer holds one base plan in each group, so each product line has its own ladder: Starter for the editor beside Campaigns Pro for email, on one invoice. Plans without agroup share the default group. Moving within a group is an upgrade or downgrade; a plan in another group is attached beside the first. See Plan groups.
Each entity inside a customer, such as a workspace, can hold plans of its own too, with its own credits and allowances, billed on the customer’s invoice. See Plans per workspace or user.
Extras on top of a plan are recurring add-ons, credit packs and balance adjustments. Monthly and annual prices of one tier are two plans (pro, pro_annual).
Add-ons
A plan withaddOn: true is a recurring add-on: bought beside a paid base plan and billed on the same invoice, such as 10,000 extra credits for $20 a month. A customer on a free plan, or on none, buys one on a bill of its own, which a paid plan of that interval joins later. maxQuantity (default 1) is how many one customer may hold. An add-on carries monthlyCredits and items of any feature type, which count in check and track beside the base plan’s, and renews with its bill. Changing either field publishes a new version, and GET /v1/plans lists both.
ledger.catalog.json
GET /v1/customers lists the plans the customer holds in plans.
Recurring add-ons covers attaching and cancelling one, how it bills and grants, and its rules.
Versions
Changing a plan’s price, intervals, credits, overage, items or structure (group, addOn, maxQuantity, entityGrants) publishes a new plan version. Customers already on the plan keep the version they started; customers who start it afterwards get the new one. Publishing the same values again changes nothing ("changed": false).
Each plan has one active version (what attach starts), at most one draft (its next terms, made but not sold) and legacy versions its subscribers keep. Plan versions covers drafts, promoting, rolling back and attaching an older version.
Changing only a plan’s name publishes no version: every version takes the new name in place, and so do its Stripe Products, so subscribers’ next invoices show it.
Rename a plan
To change a plan’s ID, changeid and list the old one in previousIds:
ledger.catalog.json
starter and making basic: every version, subscriber and Stripe Price stays with it. The old ID keeps working as an alias wherever a plan ID is taken (attach, upgrade, downgrade, import, overage overrides and the plan routes), and responses carry the new one. ledger pull writes previousIds back. Without the CLI, call POST /v1/plans/starter/rename:
Test a price with a variant
A variant is its own plan, linked to a base for an A/B price test:ledger.catalog.json
- Attach it by its ID. Your app chooses which customers see which variant.
- It has its own terms and versions: a change to the base leaves it as it is, and the diff lists the variants a base change leaves alone (
variants_keep_terms). - It shares the base’s trial: a customer who trialled one doesn’t get the other’s.
- Moving between the base and a variant is an ordinary upgrade or downgrade.
GET /v1/plans?variantOf=prolists the variants (listPlans({ variantOf: "pro" }),list_plans(variant_of="pro")). ChangingvariantOfrelinks a variant in place; removing it detaches it.
Archiving
Removing a plan from your catalog file archives it: new customers stop getting it, while customers already on it keep their subscription and balances, and nothing is cancelled in Stripe. Publishing its ID again brings it back.Stripe sync
A plan’sstripeSyncStatus is pending while the sync runs, synced once Stripe has its product and price, failed, or null for a free plan. Attaching a paid plan that is still syncing syncs it first, so attach works the moment you publish. Stripe lists what Ledger creates.
Rules
- A free plan renews monthly; annual (
billingInterval: "year") and lifetime ("one_off") plans take a price above 0. - Metered, held and boolean features need an item on the plan, or
checkandtrackanswerfeature_not_in_plan. - Overage prices go on base plans; a push refuses them on an add-on (
add_on_overage_unsupported). - Attach sells active plans; publish an archived plan’s ID again to sell it.
- If Stripe refuses the sync during attach, attach returns
502 stripe_checkout_failed. - A new plan takes an ID that is no other plan’s alias (
409 plan_id_is_alias). Drop an alias withDELETE /v1/plans/{id}/aliases/{alias}to free it. - A variant’s base is an active plan that is not itself a variant, and a plan with variants stays a base (
400 invalid_variant).
Next steps
Customers and subscriptions
What attaching a plan creates.
Choose a model
One page per pricing pattern, each with its catalog.