rule: 'tiered' and a rule_config.tiers array.
Define a tiered plan
Each tier needs three fields:| Field | Type | Description | |
|---|---|---|---|
up_to | `int | null` | The inclusive upper bound of this tier. Use null for the final tier (no cap). |
unit_amount | int | Per-unit charge in minor currency units for units within this tier. | |
flat_amount | int | One-time flat fee in minor currency units added when this tier is reached. |
config/subscribd.php
price is set to 0 because the tiers define the entire cost. The price field is required by the schema but has no effect when rule is 'tiered'.How graduated tiers are calculated
For each billing period, Subscribd walks through the tiers in order and charges only the units that fall within each band. The flat fee for the highest tier reached is added once.Worked example: 12,000 API calls
Tier 1 — first 1,000 calls at $0.05
The first tier covers units 1 through 1,000.No flat fee applies to tier 1 (
flat_amount: 0).Tier 2 — next 9,000 calls at $0.03
The second tier covers units 1,001 through 10,000 (9,000 units).Reaching tier 2 adds its flat fee once:
Tier 3 — remaining 2,000 calls at $0.01
12,000 total minus the first 10,000 already charged leaves 2,000 units in the final tier.Reaching tier 3 (the highest tier) adds its flat fee once:
Reporting usage for tiered plans
Tiered plans that track discrete events (API calls, records processed, etc.) typically pair with metered usage reporting. Use theRecordUsage action to report units during the billing period — Subscribd sums them at period end and applies the graduated tier calculation to produce the invoice.
See Metered billing for details on reporting usage with RecordUsage.