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

Create a price variant

Idempotency Supported

This endpoint allows the creation of a new price variant that can be attached to item prices.

Prerequisites & Constraints

  • Variant Pricing must be enabled for your site to create a price variant.
  • At least one attribute (with both a name and a value) must be provided.

Sample Request

create a price variant

Sample Result[JSON]

URL Format

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

Input Parameters

id
required, string, max chars=100

The unique and immutable identifier of the price variant.

Constraints
  • id must not contain spaces or the / character.
  • id must be unique across all price variants.
name
required, string, max chars=100

A unique name of the price variant.

Constraint
  • name must be unique across all price variants.
external_name
optional, string, max chars=100

A unique display name for the price variant.

description
optional, string, max chars=500

Description of the price variant.

variant_group
optional, string, max chars=100

The variant_group organizes similar price_variants to optimize strategies such as bundling, geo-based pricing experiments, and campaign-specific pricing like cb-atomic-pricing- for effective grouping. The variant_group provides greater flexibility and precision in your pricing models.

business_entity_id
optional, string, max chars=50

The unique ID of the business entity for this price_variant. 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 means of a custom HTTP header.

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

Returns

Price variant object
Resource object representing price_variant