Introducing the Chargebee CLI

Update a price ramp

Updates a price ramp. You can either change its status (to activate or archive it) or replace its ramp_intervals. These two changes are mutually exclusive within a single request.

When ramp_intervals is provided, the existing intervals are replaced in full with the new ordered set. Each interval in that set must include starting_billing_cycle.

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.

Changes apply to new subscriptions only. Existing subscribers keep the ramp schedule captured when their subscription was created.

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 price ramp's status must not be archived when replacing ramp_intervals.
  • The linked item price must not be archived.

Sample Request

replace the ramp intervals of a price ramp

Sample Result[JSON]

URL Format

POST https://[site].chargebee.com/api/v2/price_ramps/{price-ramp-id}

Input Parameters

status
optional, enumerated string, default=active

The status to set for the price ramp. Use this to activate a ramp or archive it so that it no longer applies to the linked item price. status and ramp_intervals are mutually exclusive in a single request.

Enum Values
active

Activates the price ramp so that its ramp intervals apply to the linked item price.

archived

Archives the price ramp so that it no longer applies to the linked item price.

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