Introducing the Chargebee CLI

Create a price ramp

Creates a price ramp for an item price. Use this operation to schedule how the item price changes across a subscription's billing cycles by defining an ordered set of ramp_intervals.

Pass an overridden price for an interval using price (or price_in_decimal when multi-decimal pricing is enabled), or set apply_catalog_price to true to reuse the item price's catalog price for that interval.

Chargebee merges adjacent ramp_intervals that have the same pricing before saving. Intervals are merged when they have the same price, or when consecutive intervals have apply_catalog_price set to true. Intervals with different prices, a mix of catalog and fixed pricing, or gaps in billing cycles aren't merged.

The ramp must contain at least two intervals after merging. If the submitted intervals merge into a single interval, the request is rejected.

Prerequisites & Constraints

  • Price Ramps must be enabled for the site. Contact Chargebee Support to enable them. Until they are enabled, this operation returns API_RESTRICTED.
  • The item_price_id must not already be linked to a price ramp. An item price can have at most one price ramp.

Sample Request

create a price ramp for an item price

Sample Result[JSON]

URL Format

POST https://[site].chargebee.com/api/v2/price_ramps

Input Parameters

item_price_id
required, string, max chars=100

The ID of the item price for which the price ramp is created. The price defined by the ramp intervals overrides the catalog price of this item price for the applicable billing cycles.

business_entity_id
optional, string, max chars=50

The unique ID of the business entity for this price_ramp. This is applicable only when multiple business entities have been created for the site. When provided, the operation will read or write data associated with the specified business entity. If not provided, the resource will be created at the site level, and the business_entity_id will not be included in the API response.

Note: An alternative way of passing this parameter is by using a custom HTTP header or query string parameter.

ramp_intervals[0..n]
Parameters for ramp_intervals. Multiple ramp_intervals can be passed by specifying unique indices.
pass parameters as ramp_intervals[<param name>][<idx:0..n>]

Returns

Price ramp object
Resource object representing price_ramp