Pro: $20 a month with 1,000 credits. More at $10 per 1,000, up to 50,000 a month.Prepaid terms price usage in packs bought up front, so revenue arrives at the start of the period and customers know their bill in advance. A plan’s
prepaid sells its credits, or a metered item’s units, in packs of billingUnits at unitAmountCents each. The included amount (monthlyCredits, or the item’s included) stays free, and packs price what’s above it, up to maxQuantity. Ledger publishes, versions and syncs the terms to Stripe like any price. The customer picks a quantity when you attach the plan, raises or lowers it with POST /v1/billing/quantities, and keeps it through renewals and upgrades.
The catalog
A quantity is the total for the period, the included amount counted: with the terms above, 5,000 credits is the free 1,000 plus 4 packs, $40 a month.
GET /v1/plans lists a plan’s prepaid for its credits and each item’s prepaid, null when there’s none, with maxQuantity only when it’s set. A plan edit that leaves the plan’s prepaid out, such as the dashboard’s plan form or POST /v1/plans/{id} without the field, keeps the current version’s; null removes it. An item’s prepaid is part of the item, so an edit that sends items sends it.
Stripe
Stripe sync creates one Stripe Price per prepaid entry: one pack atunitAmountCents, recurring at the plan’s billing interval, with ledger_price_role: prepaid and the feature’s ID (credits for the plan’s credits) in its metadata, under a <Plan> – <Feature> prepaid Product. Renaming the plan renames that Product in place. A plan with prepaid terms bills through Stripe even if its own price is $0, and counts as synced once every prepaid Price exists. A new version gets new Prices, so current subscribers keep theirs.
Sell a quantity
Sendquantities when you attach the plan, one entry per prepaid feature ("credits" for the plan’s credits), each the period’s total with the included amount counted:
messages grants 5,000 messages, which track spends and refuses with limit_reached past it. A feature left out gets its included amount and no pack line. Each renewal bills the plan and the same packs and grants the quantity again, reset like any plan grant; cancelling keeps it to the period end.
Change a quantity
POST /v1/billing/quantities sets a new total for one feature of the customer’s plan:
- A raise is charged now, prorated for the rest of the period, on the saved card. Once that invoice is paid, the customer holds the new quantity and is granted the extra units prorated by the time left, rounded down: 5,000 more credits a third of the way through a month grants 3,333 now. The renewal then bills and grants the new quantity in full.
- The same quantity changes nothing and answers
status: "unchanged". - A decrease takes effect at the renewal and answers
status: "scheduled", the new total inpendingQuantity. This period keeps its packs and grant; the renewal bills the lower packs and grants the lower quantity. A later change replaces a waiting decrease: another decrease, or the held quantity again to drop it.
{ itemChangeId, status, paymentUrl, quantities }, status as for an add-on: applied, pending_payment (send the customer to paymentUrl), processing (retry with the same key), closed, or for a decrease scheduled.
Plan changes
An upgrade to a plan that sells the same prepaid feature keeps the customer’s quantity, billed as the new plan’s packs above its own included amount: 5,000 credits onto a plan with 2,000 included bills 3 packs on the upgrade invoice and grants 5,000. A quantity below the new plan’s included amount becomes the included amount. A plan without the feature drops it, and its packs leave the bill. To change the quantity as well, upgrade, then change the quantity.Coupons
A coupon on a plan covers its prepaid pack Products too, so the discount reaches the pack lines as well as the plan’s own.Rules
- Prepaid terms are money terms. Changing them publishes a new plan version.
- A quantity is whole packs, from the included amount to
maxQuantity. Below the included amount, or not whole packs above it, is400 invalid_requestatquantities.N.quantity(Ledger refuses 5,500 with packs of 1,000 rather than rounding it up); abovemaxQuantityis400 max_purchase_exceeded, on attach and on an upgrade that carries the quantity. A feature the plan sells no prepaid entry for, or one named twice, is400 invalid_requestatquantities.N.featureId. - Prepaid sells on its own monthly or yearly bill. An attach that starts a trial, a plan that bills yearly but resets monthly, or an attach onto another group’s bill or an entity is
400 prepaid_attach_unavailable. - Upgrades carry the quantity; downgrades go through a cancel. A downgrade to or from a plan with prepaid is
400 prepaid_change_unavailable: upgrade, or cancel at the period end and attach the new plan. - One change at a time per bill. A raise while a decrease waits, or any change while another is pending, is
409 subscription_change_pending.POST /v1/billing/quantitiesfor a plan the customer doesn’t hold on an active paid bill is409 plan_not_held. - Metered items, or the credit pool. An item’s feature is
metered(prepaid_feature_type); sell credits with the plan’s ownprepaid. - An item with a limit. A prepaid item has
included, notunlimited(prepaid_unlimited). - Base plans that recur. Prepaid terms go on a monthly or annual base plan, not an add-on (
prepaid_add_on_unsupported) or a lifetime plan (prepaid_must_recur). - A maximum above the included amount, in whole packs.
maxQuantityis aboveincludedormonthlyCredits(prepaid_max_below_included), by a whole number of packs (prepaid_max_not_multiple): with 1,000 included and packs of 1,000, 50,000 fits and 50,500 doesn’t. - Prepaid or a seat price. A seat price is for held items and prepaid for metered ones, so an item takes one of the two.
- Seat plans are priced per seat. A license’s seat plan has no prepaid terms (
license_plan_has_prepaid). - One currency. A plan with prepaid terms is priced in its own currency, without
currencyOptions.
prepaid, prepaid.maxQuantity, items.N.prepaid or items.N.prepaid.maxQuantity. A pack size or maximum that isn’t a whole number above 0, or a unitAmountCents of 0, is refused as invalid_request (invalid_catalog on POST /v1/catalog). Every code is in Errors.
Related
- Credit packs: one-time credits bought through Checkout.
- Top-ups and auto top-ups: any amount, or bought automatically when the balance runs low.
- Overage: bill usage past the allowance after the period.