Introducing the Chargebee CLI

How do I calculate MRR across product families with mid-term ramps?

Problem Statement

You need a period-by-period forecast of recurring charges for a subscription that has a mid-term ramp. A mid-term ramp is a scheduled ramp whose effective date falls in the middle of a billing cycle rather than on a billing-cycle renewal date. Calling the Advance invoice estimate API on such a subscription can return an error (for example, related to the remaining billing cycles) or omit the future pricing changes when:

  1. The subscription has one or more scheduled ramps.
  2. A ramp starts in the middle of a billing cycle, because advance invoicing is not available for subscriptions with mid-term ramps.
  3. The subscription's billing frequency, remaining billing cycles, or contract-term dates change mid-term. A mid-term plan change resets remaining billing cycles to the new plan's configured value and decrements them at the next renewal; if the billing period changes, the current term ends and the remaining billing cycles decrement immediately.

In addition, Chargebee MRR is a point-in-time metric on the live subscription: unexecuted ramps are excluded from current MRR. In RevenueStory, committed MRR (CMRR) also does not reflect subscription ramps. Counts of upcoming, created, and fulfilled ramps are in Ramps. See How to calculate the MRR value for the customers whose subscription change is in the Future? and Subscription Ramps. Finally, a subscription cannot be updated or ramped to a plan in a different product family; see Update a subscription to a plan from another product family.

  • Projecting recurring charges after a mid-term ramp
  • Handling Advance invoice estimate API errors on subscriptions with ramps
  • Using Chargebee CPQ to represent pricing changes across a contract term

Solution

Use Chargebee CPQ and the Quotes API, not the legacy Quotes workflow, to represent the contract term and its ramps and build a custom period-by-period forecast from the quote line items (this output is a custom forecast, not Chargebee MRR or RevenueStory).

This approach requires both Chargebee CPQ and Subscription Ramps to be enabled for the site. When a CPQ quote contains ramps, Chargebee generates quoted_ramps data containing the line items applicable to the different ramp periods.

Step 1: Create the CPQ quote

This step creates and persists a Chargebee CPQ quote. It is not a read-only estimate.

Using Create a quote for subscription creation (or New Business Quote in the UI) for a new subscription, or Create a quote for subscription update (or Amendment Quote in the UI) for an existing subscription, create a CPQ quote that contains the subscription's complete commercial configuration, including:

  • The customer and subscription
  • The applicable plan and recurring addons
  • Quantities and price overrides
  • Discounts or coupons
  • The contract term
  • Each ramp period (start_date and end_date on subscription_items, discounts, and coupons)

Use the same product and pricing details that will apply to the actual subscription. Do not use the legacy Quotes workflow.

Step 2: Retrieve the quote details

Retrieve the created quote and inspect the following resources:

  • quoted_ramps, which contains the line items associated with the ramp periods
  • quote_line_groups, which groups quote charges by charge event or billing cycle

The first quote line group is included in the quote response. Use the List quote line groups endpoint to retrieve any additional groups generated for the quote. If the response contains next_offset, pass it as offset and repeat the request until next_offset is absent.

Do not pass quote_line_groups as part of the quote creation request. Chargebee generates these groups from the quote configuration.

Step 3: Identify recurring charges for each period

For each quote or ramp period, build a custom forecast from recurring line items:

  1. Identify the recurring plan and addon line items.
  2. Exclude taxes, one-time charges, credits, and other non-recurring amounts (except one-time discounts and coupons where included_in_mrr is true).
  3. Apply the quantity, price, recurring discounts effective for that period, and any one-time discounts or coupons with included_in_mrr set to true.
  4. Normalize the resulting recurring amount to a monthly value.

For example:

  • Monthly recurring charge: use the recurring amount directly.
  • Quarterly recurring charge: divide the recurring amount by 3.
  • Annual recurring charge: divide the recurring amount by 12.

Step 4: Handle multiple product families separately

Chargebee does not allow changing a subscription to a plan in a different product family—neither by updating the subscription nor by scheduling a ramp. That is a catalog constraint, not an MRR or quote-line-group API limitation. To move a customer to a plan in another product family, you must cancel the current subscription and create a new one in the target product family, or move the plan item to the target product family first. See Update a subscription to a plan from another product family.

Because a ramp on a subscription can only change the plan, addon, quantity, discount, or price within that subscription's product family, use quoted_ramps and quote_line_groups to forecast each subscription within its own product family. If a customer has separate subscriptions across multiple product families, generate the quote forecast for each subscription individually and sum their normalized monthly recurring amounts for each period.

Important Notes

  • This workaround uses Chargebee CPQ, not legacy Quotes.
  • Chargebee CPQ and Subscription Ramps must be enabled for the site.
  • Subscription estimates do not currently support all ramp scenarios.
  • Advance invoicing and RevenueStory / CMRR limitations for mid-term ramps are documented in Subscription Ramps.
  • quote_line_groups are generated by Chargebee and retrieved from the quote response or the List quote line groups endpoint.
  • Use recurring line items—not quote totals—to build the period forecast. Quote totals may include taxes, credits, one-time charges, or other non-recurring amounts. This forecast is not Chargebee MRR or RevenueStory.
  • A quote is a projection based on the supplied configuration. Ensure that its contract dates, quantities, prices, discounts, and ramps match the intended subscription changes.
  • Contact Chargebee Support if the quote output does not match the configured contract or ramp schedule, and include the sanitized request parameters, response, subscription ID, quote ID, ramp effective dates, and expected forecast for each period.