Free: 1 project. Pro: 10 projects. Business: unlimited projects.Give each plan its own cap on projects, members or connected repos, and Ledger enforces it: a customer at their limit is stopped before they create one more, right when an upgrade makes sense. A
held feature is a count the customer holds at once. It carries from period to period, unlike a metered allowance. Your app adds to the count when the customer creates one and removes from it when they delete one, and Ledger holds the count to the plan’s limit. To bill for the count as well, give the item a seat price.
The catalog
included is the most the customer may hold at once.
Add, remove and set the count
- Check before creating one.
checkwithquantityasks whether the customer can hold that many more (default 1). - Add with
trackandquantity: 1once the project exists. - Remove with
trackandquantity: -1when it’s deleted. A remove at 0 applies nothing. - Set the count outright with
count, to reconcile with your app’s own records. It applies even above the limit, since it reports what exists.
request_id, as any track does, so a retried add or remove counts once.
What check and track return
For a held feature,balance.used is the count held now and remaining is how many more fit. A Pro customer who holds 3 projects and adds one gets:
Response
chargedQuantity is the change applied: -1 for a remove, 0 for a remove at 0, and the difference for a count. resetsAt is always null, since a held count never resets.
When the customer holds 10 and asks for one more, check answers allowed: false with reason: "limit_reached", and the track is refused:
Response (409)
feature_not_in_plan, and one with no plan no_plan. On an unlimited item, included and remaining are null and every add is allowed.
Rules
- The count carries over. It carries from period to period and across plan changes. It’s the customer’s, not the plan’s.
- Downgrades keep what the customer holds. A customer who holds 8 projects and moves to a plan with 1 keeps all 8:
remainingis 0, removes work, and adds resume once the count is under the new limit. Your app decides whether to archive the extras. - Charge per unit with a seat price. A held item bills through a seat price rather than an overage price, and an add past the limit is refused.
- Entity plans set limits by scope. An entity’s
ownplans give a limit only it uses, then it draws on the shared limit; see held limits by scope. - Check without
reserve. A held feature answerscheckdirectly;reserveon it returns400 reserve_not_supported. - Send
quantityorcount, one of the two.countis for held features, and a held feature’squantityis non-zero.
Related
- Per-seat pricing: bill for the count held.
- Feature flags: on or off, with no count.
- Metered allowances: a count of uses that resets each period.