Skip to main content
Monigo supports five pricing models that cover the full spectrum of usage-based billing. Each model is attached to a Price, which is in turn attached to a Plan. One plan can have multiple prices, each tracking a different metric with its own model.

Quick reference

The tiers field is polymorphic — its structure depends on the pricing model. For tiered it is a JSON array; for package and overage it is a JSON object. The Go SDK accepts json.RawMessage; the JavaScript SDK accepts PriceTier[] | PackageConfig | OverageConfig.

Prerequisites

All examples assume you have already created a metric and a customer. See Metering and the Quickstart for how to create these.

1. Flat / Per-unit pricing

Every unit costs the same fixed amount regardless of how many units are consumed. Model value: flat_unit (use PricingModel.Flat / monigo.PricingModelFlat in the SDKs) Example: ₦2.00 per API call.
Invoice line item example (1 500 calls):

2. Tiered pricing (graduated)

Usage is divided into bands. Each unit is charged at the rate of the tier it falls into. As volume grows, units in higher tiers get cheaper — but earlier units still cost their tier’s rate. Model value: tiered tiers field: A JSON array of { up_to, unit_amount } objects. The last tier must have up_to: null (infinity). Example: ₦5 for the first 1 000 calls, ₦3 for the next 9 000, ₦1 beyond that.
The final tier must always have up_to: null (REST/JS) or UpTo: nil (Go). Monigo rejects tier arrays that do not end with an open-ended tier.
Invoice line item example (12 000 calls):

3. Package pricing

Usage is sold in fixed-size bundles. Partial bundles are always rounded up to the next whole bundle. Model value: package tiers field: A PackageConfig object (not an array). Example: ₦500 per bundle of 1 000 SMS. Sending 1 500 SMS → 2 bundles → ₦1 000.
Invoice line item example (1 500 SMS → 2 bundles):

4. Overage pricing

A flat base_price covers up to included_units. Every unit above that quota is charged at overage_price. Model value: overage tiers field: An OverageConfig object (not an array). Charge formula:
Example: 10 000 API calls included per month; ₦1.50 per call beyond that.
Invoice line item example (13 500 calls):
Set included_units: 0 and base_price: "0.000000" for a pure overage plan with no free tier — every unit is charged at overage_price from the first unit.


5. Cap pricing

A flat base_price covers up to included_units. Usage above the cap is not charged — the customer’s invoice shows only the base price regardless of how far over the limit they go. A subscription.usage_cap_reached webhook is fired the first time a customer crosses the cap within a billing period. Model value: cap tiers field: A CapConfig object (not an array). Example: ₦10 000 flat for up to 5 000 API calls per month. The customer pays ₦10 000 whether they make 1 call or 5 000 calls — and nothing extra if they exceed 5 000.
Invoice line item example (any usage from 0 to 5 000 calls):
When a customer crosses included_units, Monigo fires a subscription.usage_cap_reached webhook to your registered endpoints. Use this to notify the customer, upsell a higher plan, or take any other action. See Webhooks for the payload shape.

Choosing a model


Combining multiple prices on one plan

A plan can carry multiple prices — one per metric. Each price is calculated independently and totals are summed on the invoice.

Complete runnable examples

The Monigo SDKs ship with a pricing-models example that creates all four plan types, subscribes a customer to each, and prints a summary.
See the Go SDK and JavaScript SDK reference for full installation instructions.