Unit-based pricing is for recurring products where the customer declares a quantity up front and pays for that quantity each billing period. It works well for devices, workspaces, locations, projects, or any other billable unit that does not need a person or seat assignment. Unlike usage-based billing, the quantity is selected before payment and does not come from usage events. Unlike seat-based pricing, units have no invitations, members, or benefit grants of their own.
Unit-based prices are supported on subscription products only. OurPay rejects a unit-based price on a one-time product.

Pricing models

Each currency can have one unit-based price and, optionally, a fixed recurring base price. A unit-based price cannot be combined with a seat-based or pay-what-you-want price. For tiers of 1–10 units at 10and11+unitsat10 and 11+ units at 8, a quantity of 14 costs:
  • Volume: 14 × 8=8 = 112
  • Graduated: 10 × 10+4×10 + 4 × 8 = $132
Rates sent to the API are whole integers in the currency’s smallest unit. For USD, 1000 means $10.00. The final tier may have a null bound for an unlimited maximum. When the final tier has a numeric bound, that value is the maximum quantity customers can buy.

Create a unit-based product

In the dashboard, create a Subscription product and select Units as the pricing type. Then:
  1. Enter singular and plural labels, such as device and devices.
  2. Choose fixed, volume, or graduated pricing.
  3. Enter the unit rate for each tier.
  4. Optionally set a minimum quantity. The default is one.
If Units is not shown, unit-based pricing has not been enabled for the organization by the deployment operator. You can also create the product with the TypeScript SDK:
See Create Product for every product field.

Choose the quantity at checkout

By default, checkout starts at the product’s minimum and lets the customer choose an allowed quantity. You can constrain or lock that value when creating a Checkout Session:
  • units preselects the quantity.
  • min_units and max_units narrow the range for that session, but cannot exceed the product price’s own bounds.
  • A Checkout Link can save a fixed units value. Sessions created from that link are locked to the saved quantity.
The selected quantity and localized unit label appear in checkout, the resulting subscription, orders, and invoices.

Change subscription units

An organization can change the declared quantity through the subscription API. OurPay validates the new value against the price bounds and applies the organization’s default proration behavior unless one is supplied explicitly.
With invoice, an increase creates an immediate prorated charge and a decrease creates the corresponding prorated credit. With prorate, the adjustment is recorded for the next invoice. The next renewal uses the new full-period quantity. Unit changes are organization-controlled. The customer portal displays the current quantity but does not currently let customers edit it themselves.
Switching an existing unit-based subscription to a product without unit-based pricing is not supported. Migrate the customer to a compatible unit-based product or create a new subscription.

Events and reconciliation

Listen for subscription.updated to detect quantity changes and order.created / order.paid to reconcile prorations and renewals. Billing entries retain the increase or decrease that produced each invoice amount, so integrations should use the resulting order rather than recomputing a charge from the current quantity.