Each takes effect on the customer’s next
track. Usage already recorded keeps the rate it was recorded at.
Set a customer’s cap
Response
0turns overage off for the customer: uses past their allowance are refused.nullclears it. The cap falls back to the customer’s override cap, else the plan’soverageCapCents.- Which cap applies has how this cap combines with the plan’s.
overageis the customer’s current period, ornullwhen their plan has no overage.
Set a negotiated rate
An override replaces the plan’s price for extra credits:unitAmountCents per billingUnits credits (default 1). This customer pays $0.01 per 2 credits on Scale, instead of the plan's $0.01 per credit:
Response
- It prices credit overage, on a plan that has credit overage terms. A metered item keeps its own overage price.
- Scope.
planIdapplies it to one plan, across all its versions. LeaveplanIdout to apply it to whichever overage plan the customer is on, so it carries across upgrades. A plan-specific override wins over one for any plan. - Its own cap.
capCentssets a cap for this override, used when the customer has no cap of their own. Leave it out to keep the plan default. - Clear it with the same
planIdand"unitAmountCents": null, and no other terms. The plan’s rate applies again from the next track. - Mid-period changes bill as a second line: the renewal invoice has one overage line per rate the period recorded.
Overage controls
A customer’s or entity’s own controls replace the plan’s entry with the same target: turn overage off for one account, give a design partner 10,000 free credits a period, or record a pilot’s usage without billing it. The same call sets their own usage limits and usage alerts.Response
- Each kind you send replaces that kind at this level; a kind left out stays as it was, and
nullclears it back to the plan’s. - Entities. Add
entityIdto set one entity’s own entries; an entity’s entry replaces the customer’s with the same target. - Read what applies with
getCustomerControls: every entry in force, itssource(plan,customerorentity), and this period’sbilled,unbilledandfreeLeftfor overage.
Read the effective terms
overage.capSource says which cap applies: customer, override, plan, or null for no cap. Which cap applies has the order. overage.source says where the rate comes from: plan, or override with the override in overage.override.
Customers see these terms before they pay: the text Ledger adds above Checkout’s Subscribe button uses the customer’s own cap or rate when they have one. Read them any time with getCustomer: overageCapCents is the customer’s own cap, and overage the effective terms this period.
Auto top-ups
A customer’s own auto top-up replaces their plan’s default the same way: a different threshold or amount,enabled: false to turn it off, or autoTopUp: null to follow the plan again. Save it with setCustomerAutoTopUp.
Other ways. Over HTTP, see Set overage cap, Set overage rate and Set controls. How overage is decided and billed is in Overage.
Rules
- Overrides and controls need a key with the Customers permission at Write.
- A rate override applies to a plan with credit overage terms; on a plan without them it returns
409 plan_has_no_overage. - An unknown
planIdreturns404 plan_not_found. - Controls follow the plan’s rules:
400 invalid_usage_limit,invalid_alertorinvalid_overage_control, with each problem inissues.