Skip to main content
Package pricing applies a fixed price to a group of units, such as 100 API calls. Use it when you sell usage in packages.

How it works

A package has a size (package_size) and a price (amount). Lago subtracts free_units from the measured quantity, then rounds the remaining quantity up to whole packages. The fee is the number of packages × amount. If the quantity does not exceed the free units, the fee is zero.

Availability

  • Fixed Products: not available.
  • Metered Products: available for Count, Count unique, Latest, Max, Sum and Weighted sum, except when metrics use recurring: true with proration. Advance billing is available only for Count, non-prorated Count unique and non-prorated Sum.
See the availability matrix.

Configure the rate

Set rate_model to package. rate_properties takes:

Example

This example prices 2,000 calls over one full monthly billing period in USD. Each package contains 100 calls and costs 1 USD. It uses no free units, proration or spending minimum: The 2,000 calls fill exactly 20 packages, giving a calculated fee of 20 USD before tax. This example uses complete packages and no free units. For example, with 50 free calls, packages of 100 calls and a package price of 1 USD, 200 calls leave 150 billable calls. Lago rounds these up to two packages, for a fee of 2 USD before tax.

Check the result

For the complete-package example above, divide the quantity by the package size and multiply the package count by its price. Use Contract current usage to inspect provisional values. See Rates to check which Rate applies.

Standard

One unit price.

Pricing models

Compare every rate model.

Create a rate

POST /rate_cards/{rate_card_code}/rates

The rate object

rate_properties fields.