basalt / subscriptions/src / meteredLine
Function: meteredLine()
> meteredLine(feature, opts): NewLineItem | null
Defined in: subscriptions/src/metered.ts:71
An invoice line for metered usage under a tiered price. includedUnits (the plan's free allowance) is subtracted first; returns null when nothing is billable. The tiered total is a single line (quantity 1) — tiered pricing has no single per-unit rate — with the breakdown in metadata.
Parameters
feature
string
opts
includedUnits?
number
price
units
number
Returns
NewLineItem | null