Introducing OpenTelemetry for Chargebee SDKs — trace every API call in any telemetry tool.
Chargebeechargebee API

Create a differential price

Idempotency Supported

Create a differential price for addon item price, addon item price with tiered pricing, or charge item price.

Prerequisites & Constraints

  • Either price or price_in_decimal is required when the parent item price uses the flat_fee or per_unit pricing model and multi-decimal pricing is enabled.
  • Multi-decimal pricing must be enabled for your site to set decimal tier fields (tiers[price_in_decimal], tiers[starting_unit_in_decimal], tiers[ending_unit_in_decimal]).

Sample Request

Sample Result[JSON]

URL Format

POST https://[site].chargebee.com/api/v2/item_prices/{item-price-id}/differential_prices

Input Parameters

parent_item_id
required, string, max chars=100

The id of the plan-item, in relation to which, the differential pricing for the addon or charge is defined. For example, this would be the id of the Standard or Enterprise plans-items mentioned in the examples above .

price
optional, in cents, min=0

The differential price. If the pricing model of the item_price_id is tiered , volume , or stairstep , pass tiers instead of this.

price_in_decimal
optional, string, max chars=39

The price of the item when the pricing_model is flat_fee. When the pricing model is per_unit , it is the price per unit quantity of the item. Not applicable for the other pricing models. The value is in decimal and in major units of the currency. Also, this is only applicable when multi-decimal pricing is enabled.

Constraints
  • Multi-decimal pricing must be enabled for your site to set price_in_decimal.
  • price_in_decimal must be a number.
business_entity_id
optional, string, max chars=50

The unique ID of the business entity for this differential_price. 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.

Constraint
  • When multiple business entities are active for Product Catalog, business_entity_id must reference a business entity accessible to your API key.
parent_periods[0..n]
Parameters for parent_periods. Multiple parent_periods can be passed by specifying unique indices.
pass parameters as parent_periods[<param name>][<idx:0..n>]
tiers[0..n]
Parameters for tiers. Multiple tiers can be passed by specifying unique indices.
pass parameters as tiers[<param name>][<idx:0..n>]

Returns

Differential price object
Resource object representing differential_price