When offering subscriptions of products or services, each entity that is made available for sale is represented by an “item” object. Items therefore represent the various plans, addons or charges that you offer as part of your product catalog. Non-metered
items are charged upfront in Chargebee, while metered
items are charged at the end of the billing cycle, based on usage.
There are three types of items and they’re listed and explained here. Examples for each type are provided in the table that follows.
Plan-items are items that have a recurring charge and are an essential component of any subscription. Typically, plans represent a principal or key product or service in your catalog. They are charged at recurring intervals and often have other products or services offered along with them as addons and charges.
Addon-items are items that are sold along with a plan and are charged for at recurring intervals.
Charge-items are items that are sold along with a plan but charged once (or each time) a specified event occurs. A charge can also be applied to a customer without attaching to a subscription.
To help understand each type of item better, listed below are some examples of items from different business domains:
{
"enabled_for_checkout": true,
"enabled_in_portal": true,
"id": "silver",
"is_giftable": false,
"is_shippable": false,
"item_applicability": "all",
"name": "Silver",
"object": "item",
"resource_version": 1599817249982,
"status": "active",
"type": "plan",
"updated_at": 1599817249
}
<cb_client>.Item
<ul><li>testing</li><li>desc</li></ul>
.id
and name
can be reused. Deleted items can be retrieved using List items.id
of the Item family that the item belongs to. Is mandatory when Product Families have been enabled. type = charge
and when the feature is enabled in Chargebee. Note: If the site-level setting is to exclude charge-items from MRR calculations, this value is always returned false
. applicable_items
can be applied to this plan-item.true
, the quantity is calculated from usage records. When false
, the quantity
is as determined while adding an item price to the subscription. Applicable only for items of type
plan
or addon
and when Metered Billing is enabled. The value of this attribute cannot be changed. metered
. This value overrides the one set at the site level. quantity
of all usages for the current term.last_usagefrom among the usage records for the item price with usage_date
within the relevant billing period, the quantity
of the usage record with the most recent usage_date
is taken as the net quantity consumed.max_usagefrom among the usage records for the item price with usage_date
within the relevant billing period, the quantity
of the usage record with the maximum value is taken as the net quantity consumed.item_applicability
is restricted
.plan
.plan
.import chargebee from chargebee import Chargebee cb_client = Chargebee(api_key="{site_api_key}", site="{site}") response = cb_client.Item.create( cb_client.Item.CreateParams( id="silver", name="Silver", type=chargebee.Item.Type.PLAN, item_family_id="acme-inc", item_applicability=chargebee.Item.ItemApplicability.ALL ) ) item = response.item
import chargebee from chargebee import Chargebee cb_client = Chargebee(api_key="{site_api_key}", site="{site}") response = cb_client.Item.create( cb_client.Item.CreateParams( id="ssl", name="ssl", type=chargebee.Item.Type.ADDON, item_family_id="acme-inc" ) ) item = response.item
import chargebee from chargebee import Chargebee cb_client = Chargebee(api_key="{site_api_key}", site="{site}") response = cb_client.Item.create( cb_client.Item.CreateParams( id="gold", name="Gold", type=chargebee.Item.Type.PLAN, item_family_id="acme-inc", item_applicability=chargebee.Item.ItemApplicability.RESTRICTED, applicable_items=["day-pass"] ) ) item = response.item
<cb_client>.Item.create({<param name> : <value>,<param name> : <value> ...})
<ul><li>testing</li><li>desc</li></ul>
.id
of the Item family that the item belongs to. Is mandatory when Product Families have been enabled. applicable_items
can be applied to this plan-item.type = charge
and when the feature is enabled in Chargebee. Note: If the site-level setting is to exclude charge-items from MRR calculations, this value is always returned false
. true
, the quantity is calculated from usage records. When false
, the quantity
is as determined while adding an item price to the subscription. Applicable only for items of type
plan
or addon
and when Metered Billing is enabled. The value of this attribute cannot be changed. metered
. This value overrides the one set at the site level. . quantity
of all usages for the current term.last_usagefrom among the usage records for the item price with usage_date
within the relevant billing period, the quantity
of the usage record with the most recent usage_date
is taken as the net quantity consumed.max_usagefrom among the usage records for the item price with usage_date
within the relevant billing period, the quantity
of the usage record with the maximum value is taken as the net quantity consumed.item
. 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. An alternative way of passing this parameter is by means of a custom HTTP header.
bundle_configuration.type
appears when you create a bundle plan that cannot be updated during checkout or subscription creation. item_type
that can be added to the bundle. plan
item must be associated with the bundle.addonA recurring component that can be added to a bundle plan.chargeA non-recurring component that can be added to a bundle plan.from chargebee import Chargebee cb_client = Chargebee(api_key="{site_api_key}", site="{site}") response = cb_client.Item.retrieve("cbdemo_additionaluser") item = response.item
from chargebee import Chargebee cb_client = Chargebee(api_key="{site_api_key}", site="{site}") response = cb_client.Item.retrieve("cbdemo_additionaluser") item = response.item
<cb_client>.Item.retrieve(<item_id>,{<param name> : <value>,<param name> : <value> ...})
from chargebee import Chargebee cb_client = Chargebee(api_key="{site_api_key}", site="{site}") response = cb_client.Item.update("basic", cb_client.Item.UpdateParams( description="basic plan", enabled_for_checkout=False, enabled_in_portal=False ) ) item = response.item
from chargebee import Chargebee cb_client = Chargebee(api_key="{site_api_key}", site="{site}") response = cb_client.Item.update("basic", cb_client.Item.UpdateParams( description="basic plan", enabled_for_checkout=False, enabled_in_portal=False ) ) item = response.item
<cb_client>.Item.update(<item_id>,{<param name> : <value>,<param name> : <value> ...})
<ul><li>testing</li><li>desc</li></ul>
.id
of the Item family that the item belongs to. Is mandatory when Product Families have been enabled. applicable_items
can be applied to this plan-item.type = charge
and when the feature is enabled in Chargebee. Note: If the site-level setting is to exclude charge-items from MRR calculations, this value is always returned false
. item_type
that can be added to the bundle. item_type
that you want to update from the bundle. item_type
that you want to remove from the bundle. from chargebee import Chargebee, Filters cb_client = Chargebee(api_key="{site_api_key}", site="{site}") entries = cb_client.Item.list( cb_client.Item.ListParams( limit=2 ) ) for entry in entries.list: item = entry.item
from chargebee import Chargebee, Filters cb_client = Chargebee(api_key="{site_api_key}", site="{site}") entries = cb_client.Item.list( cb_client.Item.ListParams( limit=2 ) ) for entry in entries.list: item = entry.item
<cb_client>.Item.list({<param name> : <value>,<param name> : <value> ...})
true
, the quantity is calculated from usage records. When false
, the quantity
is as determined while adding an item price to the subscription. Applicable only for items of type
plan
or addon
and when Metered Billing is enabled. The value of this attribute cannot be changed. Possible values are : true, false metered
. This value overrides the one set at the site level. . Possible values are : sum_of_usages, last_usage, max_usage item
. Learn more about all the scenarios before using this filter.
Default value is true
. To exclude site-level resources in specific cases, set this parameter to false
.
bundle_configuration
status
as deleted. This is not allowed if there are active
or archived
item prices under the item. Once deleted, the id and name of the item can be reused.from chargebee import Chargebee cb_client = Chargebee(api_key="{site_api_key}", site="{site}") response = cb_client.Item.delete("delete-sample") item = response.item
from chargebee import Chargebee cb_client = Chargebee(api_key="{site_api_key}", site="{site}") response = cb_client.Item.delete("delete-sample") item = response.item
<cb_client>.Item.delete(<item_id>,{<param name> : <value>,<param name> : <value> ...})