An item price is a price point for an item. It defines the currency, pricing model, price, billing period and other attributes for an item. For example, consider a cloud storage service as an item. Then each of the following defines an item price:
period
of the item price in period_unit
s. An item can have only one item price for a given currency and billing period.
The type of an item price corresponds to the type of the item that the item price belongs to. In other words, item prices can be of the following types:
{
"created_at": 1594106928,
"currency_code": "USD",
"external_name": "silver USD",
"free_quantity": 0,
"id": "silver-USD-monthly",
"is_taxable": true,
"item_id": "silver",
"item_type": "plan",
"name": "silver USD monthly",
"object": "item_price",
"period": 1,
"period_unit": "month",
"price": 1000,
"pricing_model": "per_unit",
"resource_version": 1594106928574,
"status": "active",
"updated_at": 1594106928
}
external_name
is not provided, this is also used in customer-facing pages and documents such as invoices and hosted pages.id
and name
can be reused.name
is usedThe pricing scheme for this item price. If subscriptions, invoices or differential prices exist for this item price, pricing_model
cannot be changed.
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 the minor unit of the currency.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.type
is plan
: The billing period of the plan in period_unit
s. For example, create a 6 month plan by providing period
as 6 and period_unit
as month.type
is addon
: The period of the addon in period_unit
s. For example, create an addon with a 2 month period
by providing period as 2 and period_unit
as month
. The period of an addon is the duration for which its price
applies. When attached to a plan, the addon is billed for the billing period of the plan. Learn more.period
cannot be changed. The period
is mandatory when the item type
is plan
or addon
currency_code
cannot be changed.period
. If subscriptions or invoices exist for this item price, period_unit
cannot be changed. The period_unit
is mandatory when the item type
is plan
or addon
trial_period_unit
s. You can also set trial periods for addons; contact Support to enable that feature.trial_period
.item.type
is plan
and a trial period is defined for this item price, this attribute (parameter) is returned (required). This can be overridden at the subscription-level.The default number of billing cycles a subscription to the plan must run. Can be overridden for a subscription.
Addons can also have billing cycles. However, you must contact Support to enable that. Also, for addons, you can override this while attaching it to a plan. However, if you provide the value while applying the addon to a subscription, then that value takes still higher precedence.
If subscriptions, invoices or differential prices exist for this item price,billing_cycles
cannot be changed.resource_version
is updated with a new timestamp in milliseconds for every change made to the resource. This attribute will be present only if the resource has been updated after 2016-09-28.tiered
, volume
, and stairstep
pricing_models
.pricing_model
is tiered
or volume
; the total cost for the item price when the pricing_model
is stairstep
. The value is in the minor unit of the currency.<category-name>: <option>
. For example:Location: Singapore.
<parent class>:<sub-class-1>:<sub-class-2>...
<parent class>: <sub-class-1>: <sub-class2>....
For example: Services: Plan.
<category-name>: <option>....
For example, Region: South
<parent-location>:<sub-location-1>:<sub-location-2>....
For example: Location: North America: Canada
<parent-location> : <sub-location-1>: <sub-location-2>....
For example: NA:US:CA
<parent-department> : <sub-department-1>: <sub-department-2>....
For example: Production: Assembly.
This API creates an item price (a price point) for an item.
curl https://{site}.chargebee.com/api/v2/item_prices \ -X POST \ -u {site_api_key}:\ -d id="silver-USD-monthly" \ -d item_id="silver" \ -d name="silver USD monthly" \ -d pricing_model="per_unit" \ -d price=1000 \ -d external_name="silver USD" \ -d period_unit="month" \ -d period=1
external_name
is not provided, this is also used in customer-facing pages and documents such as invoices and hosted pages.
name
is used.
The pricing scheme for this item price. If subscriptions, invoices or differential prices exist for this item price, pricing_model
cannot be changed.
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 the minor unit of the currency.
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.
period
. If subscriptions or invoices exist for this item price, period_unit
cannot be changed. The period_unit
is mandatory when the item type
is plan
or addon
.type
is plan
: The billing period of the plan in period_unit
s. For example, create a 6 month plan by providing period
as 6 and period_unit
as month.type
is addon
: The period of the addon in period_unit
s. For example, create an addon with a 2 month period
by providing period as 2 and period_unit
as month
. The period of an addon is the duration for which its price
applies. When attached to a plan, the addon is billed for the billing period of the plan. Learn more.period
cannot be changed. The period
is mandatory when the item type
is plan
or addon
.
trial_period
.trial_period_unit
s. You can also set trial periods for addons; contact Support to enable that feature.
The default number of billing cycles a subscription to the plan must run. Can be overridden for a subscription.
Addons can also have billing cycles. However, you must contact Support to enable that. Also, for addons, you can override this while attaching it to a plan. However, if you provide the value while applying the addon to a subscription, then that value takes still higher precedence.
If subscriptions, invoices or differential prices exist for this item price,billing_cycles
cannot be changed.
item.type
is plan
and a trial period is defined for this item price, this attribute (parameter) is returned (required). This can be overridden at the subscription-level.<category-name>: <option>
. For example:Location: Singapore.
<parent class>:<sub-class-1>:<sub-class-2>...
<parent class>: <sub-class-1>: <sub-class2>....
For example: Services: Plan.
<category-name>: <option>....
For example, Region: South
<parent-location>:<sub-location-1>:<sub-location-2>....
For example: Location: North America: Canada
<parent-location> : <sub-location-1>: <sub-location-2>....
For example: NA:US:CA
<parent-department> : <sub-department-1>: <sub-department-2>....
For example: Production: Assembly.
pricing_model
is tiered
or volume
; the total cost for the item price when the pricing_model
is stairstep
. The value is in the minor unit of the currency.
ending_unit_in_decimal
of the next lower tier. Returned only when the pricing_model
is tiered
, volume
or stairstep
and multi-decimal pricing is enabled.
starting_unit_in_decimal
of the next higher tier. Returned only when the pricing_model
is tiered
, volume
or stairstep
and multi-decimal pricing is enabled.
pricing_model
is tiered
or volume
. When the pricing_model
is stairstep
, it is the decimal representation of the total price for the addon. The value is in major units of the currency. Returned when the plan is quantity-based and multi-decimal pricing is enabled.
This API retrieves a specific item price using the id.
curl https://{site}.chargebee.com/api/v2/item_prices/basic-USD-monthly \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/item_prices/basic-USD-monthly \ -u {site_api_key}:
Updates an item price with the changes specified. Unspecified item price attributes are not modified.
curl https://{site}.chargebee.com/api/v2/item_prices/scale-USD \ -X POST \ -u {site_api_key}:\ -d name="scale USD Yearly" \ -d price=10000 \ -d period=1 \ -d period_unit="year"
curl https://{site}.chargebee.com/api/v2/item_prices/scale-USD \ -X POST \ -u {site_api_key}:\ -d name="scale USD Yearly" \ -d price=10000 \ -d period=1 \ -d period_unit="year"
external_name
is not provided, this is also used in customer-facing pages and documents such as invoices and hosted pages.
name
is used.
currency_code
cannot be changed.
The pricing scheme for this item price. If subscriptions, invoices or differential prices exist for this item price, pricing_model
cannot be changed.
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 the minor unit of the currency.
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.
period
. If subscriptions or invoices exist for this item price, period_unit
cannot be changed. The period_unit
is mandatory when the item type
is plan
or addon
.type
is plan
: The billing period of the plan in period_unit
s. For example, create a 6 month plan by providing period
as 6 and period_unit
as month.type
is addon
: The period of the addon in period_unit
s. For example, create an addon with a 2 month period
by providing period as 2 and period_unit
as month
. The period of an addon is the duration for which its price
applies. When attached to a plan, the addon is billed for the billing period of the plan. Learn more.period
cannot be changed. The period
is mandatory when the item type
is plan
or addon
.
trial_period
.trial_period_unit
s. You can also set trial periods for addons; contact Support to enable that feature.
The default number of billing cycles a subscription to the plan must run. Can be overridden for a subscription.
Addons can also have billing cycles. However, you must contact Support to enable that. Also, for addons, you can override this while attaching it to a plan. However, if you provide the value while applying the addon to a subscription, then that value takes still higher precedence.
If subscriptions, invoices or differential prices exist for this item price,billing_cycles
cannot be changed.
item.type
is plan
and a trial period is defined for this item price, this attribute (parameter) is returned (required). This can be overridden at the subscription-level.<category-name>: <option>
. For example:Location: Singapore.
<parent class>:<sub-class-1>:<sub-class-2>...
<parent class>: <sub-class-1>: <sub-class2>....
For example: Services: Plan.
<category-name>: <option>....
For example, Region: South
<parent-location>:<sub-location-1>:<sub-location-2>....
For example: Location: North America: Canada
<parent-location> : <sub-location-1>: <sub-location-2>....
For example: NA:US:CA
<parent-department> : <sub-department-1>: <sub-department-2>....
For example: Production: Assembly.
pricing_model
is tiered
or volume
; the total cost for the item price when the pricing_model
is stairstep
. The value is in the minor unit of the currency.
ending_unit_in_decimal
of the next lower tier. Returned only when the pricing_model
is tiered
, volume
or stairstep
and multi-decimal pricing is enabled.
starting_unit_in_decimal
of the next higher tier. Returned only when the pricing_model
is tiered
, volume
or stairstep
and multi-decimal pricing is enabled.
pricing_model
is tiered
or volume
. When the pricing_model
is stairstep
, it is the decimal representation of the total price for the addon. The value is in major units of the currency. Returned when the plan is quantity-based and multi-decimal pricing is enabled.
Returns a list of item prices satisfying all the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order.
curl https://{site}.chargebee.com/api/v2/item_prices \ -G \ -u {site_api_key}:\ --data-urlencode limit=2
curl https://{site}.chargebee.com/api/v2/item_prices \ -G \ -u {site_api_key}:\ --data-urlencode limit=2
offset
to the value of next_offset
obtained in the previous iteration of the API call.
name
s.pricing_model
. Possible values are : flat_fee, per_unit, tiered, volume, stairstep.item_id
.item_family_id
.item_type
. Possible values are : plan, addon, charge.currency_code
.trial_period
.trial_period_unit
. Possible values are : day, month.status
. Possible values are : active, archived, deleted.updated_at
.period_unit
. Possible values are : day, week, month, year.period
. Deletes an item price, marking its status
as deleted
. If it is part of a subscription or invoice, the item price status
is marked archived
instead. Once deleted, the id
and name
of the item price can be reused to create a new item price.
curl https://{site}.chargebee.com/api/v2/item_prices/delete-sample/delete \ -X POST \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/item_prices/delete-sample/delete \ -X POST \ -u {site_api_key}:
item_applicability
and applicable_items
defined for the parent item of the plan-item price.
curl https://{site}.chargebee.com/api/v2/item_prices/basic-USD-weekly/applicable_items \ -G \ -u {site_api_key}:\ --data-urlencode limit=2
curl https://{site}.chargebee.com/api/v2/item_prices/basic-USD-weekly/applicable_items \ -G \ -u {site_api_key}:\ --data-urlencode limit=2
offset
to the value of next_offset
obtained in the previous iteration of the API call.
item_applicability
and applicable_items
defined for the parent item of the plan-item priceNote
If an addon-item price has differential pricing defined against the parent item of the plan-item price, then the pricing information in the addon-item price object returned, reflects the differential pricing.
curl https://{site}.chargebee.com/api/v2/item_prices/basic-USD-weekly/applicable_item_prices \ -G \ -u {site_api_key}:\ --data-urlencode limit=2
curl https://{site}.chargebee.com/api/v2/item_prices/basic-USD-weekly/applicable_item_prices \ -G \ -u {site_api_key}:\ --data-urlencode limit=2
offset
to the value of next_offset
obtained in the previous iteration of the API call.