API Version
Product Catalog
Library

Addon-item and charge-item prices are purchased with plan-item prices in subscriptions. You can automate this process by configuring certain addons and charges as “attached” to certain plans. This is done at the “item” level. In other words, addon- and charge-items can be attached to plan-items.

Once the attachment is defined, while creating or updating a subscription, the addon- or charge-item prices are selected automatically based on the plan-item price selected . Let’s look at the details:

Addons

Addons can be attached to plans as recommended, mandatory or optional.

  • When an addon is attached as recommended for a plan, the addon is suggested to be applied to subscriptions for the plan in Checkout and Self-Serve Portal. Alternatively, if you build your own payment pages or have a sales team, you can suggest recommended addons to your customers or salespeople on your website or CRM respectively
  • When an addon is attached as mandatory for a plan, the addon gets applied to subscriptions for the plan compulsorily, unless removed explicitly. If you do not pass an item price for a mandatory addon when including the plan in a subscription, an addon-item price is automatically applied as explained below.
  • Attaching an addon as optional neither marks it as recommended or mandatory but allows you a way to set a quantity and billing_cycles for the addon, for when it is applied to subscriptions with the plan.

How auto-selection of the addon-item price works

Once an addon has been attached as mandatory, the addon-item price to be applied to the plan-item price is selected based on the following rule: The addon-item price with the same currency as that of the plan-item price and the longest compatible period is selected.

Here's an example:

Consider a plan Standard Cloud Storage has an addon Extra Storage attached to it. Note that each of the two are items. Now consider that they have item prices with the following periods and currencies:

Item price for “Standard Cloud Storage” plan-item:

  • Standard Cloud Storage, 3 years, AUD.

Item prices for “Extra Storage” addon-item:

  • Extra Storage, 1 year, EUR.
  • Extra Storage, 1 year, USD.
  • Extra Storage, 1 year, AUD.
  • Extra Storage, 18 months, AUD.
  • Extra Storage, 2 years, AUD.
  • Extra Storage, 30 months, AUD.

For the plan-item price (Standard Cloud Storage, 3 years, AUD), the addon-item prices with matching currencies are the last 4 from the above list:

  • Extra Storage, 1 year, AUD.
  • Extra Storage, 18 months, AUD.
  • Extra Storage, 2 years, AUD.
  • Extra Storage, 30 months, AUD.

From among them, the last two have periods that are incompatible with the plan-item price period of 3 years. From the remaining 2 addon-item prices, the one with the longest period is of 18 months. So, “Extra Storage, 18 months, AUD” is selected for mandatory application to the plan item price.

Charges

Charges can also be attached to plans. When doing so, you specify the event at which the charge is to be applied to the subscription. For some events that can occur multiple times in a subscription lifetime, you can also set whether to apply the charge each time the event occurs or just once.

There may be multiple item prices for a given attached charge. The item price that matches the currency of the plan-item price is automatically selected for application.

Here’s an example:

Consider a plan Standard Cloud Storage has a charge named Implementation Fee attached to it. Now consider their item prices below, with the following periods and currencies:

Item price for “Standard Cloud Storage” plan-item:

  • Standard Cloud Storage, 3 years, AUD.

Item prices for “Implementation Fee” charge-item:

  • Implementation Fee, USD.
  • Implementation Fee, AUD.
  • Implementation Fee, EUR.

From among the charge-item prices above, the one compatible with the plan-item price is “Implementation Fee, AUD” since it has the same currency as the plan-item price.


Sample attached item [ JSON ]

{ "created_at": 1594107081, "id": "c9109b84-732a-4093-b53d-0b9f31ccc11c", "item_id": "day-pass", "object": "attached_item", "parent_item_id": "basic", "quantity": 1, "resource_version": 1594107081871, "status": "active", "type": "mandatory", "updated_at": 1594107081 }

API Index URL GET

https://{site}.chargebee.com/api/v2/attached_items

Model Class

ChargeBee.Models.AttachedItem
Id
string, max chars=100
The unique id for the attached item. Set to a random, immutable value automatically when the attached item is created.
ParentItemId
string, max chars=100
The id of the plan-item to which the item is attached.
ItemId
string, max chars=100
The id of the item being attached.
Type
enumerated string
The type of attachment for the addon. Only applicable for addon-items.
Possible values are
RecommendedThe addon is recommended to go with the plan-item when using Checkout or Portal.MandatoryThe addon is attached automatically to the subscription for the plan-item unless explicitly removed via API.OptionalThe addon is neither mandatory, nor recommended. This allows you to attach an addon so you can specify a quantity and billing_cycles for the addon, for when it is applied to subscriptions with the plan.
RecommendedThe addon is recommended to go with the plan-item when using Checkout or Portal.MandatoryThe addon is attached automatically to the subscription for the plan-item unless explicitly removed via API.OptionalThe addon is neither mandatory, nor recommended. This allows you to attach an addon so you can specify a quantity and billing_cycles for the addon, for when it is applied to subscriptions with the plan.
Show all values[+]
Status
optional, enumerated string
The item state.
Possible values are
ActiveNew subscriptions can be created with the item.ArchivedNo new subscriptions allowed for the item.DeletedNo subscriptions allowed for the item.
ActiveNew subscriptions can be created with the item.ArchivedNo new subscriptions allowed for the item.DeletedNo subscriptions allowed for the item.
Show all values[+]
Quantity
optional, integer, min=1
The default quantity of the addon to be attached when the quantity is not specified while creating/updating the subscription.
QuantityInDecimal
optional, string, max chars=33
The decimal representation of the quantity of the addon. Returned for quantity-based addons when multi-decimal pricing is enabled.
BillingCycles
optional, integer, min=1
The number of subscription billing cycles for which this item is attached when applied to a subscription. Applicable only for items of type addon. Requires addon billing cycles to be enabled for the site.
The value set explicitly for billing_cycles while applying the addon to a subscription takes precedence over this attribute. This attribute, in turn, has a higher precedence than the value set for the addon-item price.

ChargeOnEvent
enumerated string
Indicates when the item is charged. This attribute only applies to charge-items.
Possible values are
SubscriptionCreationthe time of creation of the subscription.SubscriptionTrialStartthe time when the trial period of the subscription begins.PlanActivationsame as subscription activation, but also includes the case when the plan-item of the subscription is changed.SubscriptionActivationthe moment a subscription enters an active or non-renewing state. Also includes reactivations of canceled subscriptions.ContractTerminationwhen a contract term is terminated.OnDemandItem can be charged on demand
SubscriptionCreationthe time of creation of the subscription.SubscriptionTrialStartthe time when the trial period of the subscription begins.PlanActivationsame as subscription activation, but also includes the case when the plan-item of the subscription is changed.SubscriptionActivationthe moment a subscription enters an active or non-renewing state. Also includes reactivations of canceled subscriptions.
ContractTerminationwhen a contract term is terminated.OnDemandItem can be charged on demand
Show all values[+]
ChargeOnce
boolean
Indicates if the charge-item is to be charged only once or each time the charge_on_event occurs. This attribute only applies to charge-items.
CreatedAt
timestamp(UTC) in seconds
The time at which this attached item was created.
ResourceVersion
optional, long
Version number of this resource. The 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.
UpdatedAt
optional, timestamp(UTC) in seconds
The time at which this attached item was last updated.
Channel
optional, enumerated string
The subscription channel this object originated from and is maintained in.
Possible values are
WebThe object was created (and is maintained) for the web channel directly in Chargebee via API or UI.AppStoreThe object data is synchronized with data from in-app subscription(s) created in Apple App Store. Direct manipulation of this object via UI or API is disallowed.PlayStoreThe object data is synchronized with data from in-app subscription(s) created in Google Play Store. Direct manipulation of this object via UI or API is disallowed.
WebThe object was created (and is maintained) for the web channel directly in Chargebee via API or UI.AppStoreThe object data is synchronized with data from in-app subscription(s) created in Apple App Store. Direct manipulation of this object via UI or API is disallowed.PlayStoreThe object data is synchronized with data from in-app subscription(s) created in Google Play Store. Direct manipulation of this object via UI or API is disallowed.
Show all values[+]
BusinessEntityId
optional, string, max chars=50
The unique ID of the business entity of this subscription. This is applicable only when multiple business entities have been created for the site. The value of this attribute indicates that the resource is specific to the given business entity.
Deleted
boolean
Indicates whether the attached item has been deleted or not.
Id Id
string, max chars=100
The unique id for the attached item. Set to a random, immutable value automatically when the attached item is created.
ParentItemId ParentItemId
string, max chars=100
The id of the plan-item to which the item is attached.
ItemId ItemId
string, max chars=100
The id of the item being attached.
Type Type
enumerated string
The type of attachment for the addon. Only applicable for addon-items.
Possible values are
RecommendedThe addon is recommended to go with the plan-item when using Checkout or Portal.MandatoryThe addon is attached automatically to the subscription for the plan-item unless explicitly removed via API.OptionalThe addon is neither mandatory, nor recommended. This allows you to attach an addon so you can specify a quantity and billing_cycles for the addon, for when it is applied to subscriptions with the plan.
RecommendedThe addon is recommended to go with the plan-item when using Checkout or Portal.MandatoryThe addon is attached automatically to the subscription for the plan-item unless explicitly removed via API.OptionalThe addon is neither mandatory, nor recommended. This allows you to attach an addon so you can specify a quantity and billing_cycles for the addon, for when it is applied to subscriptions with the plan.
Show all values[+]
Status Status
optional, enumerated string
The item state.
Possible values are
ActiveNew subscriptions can be created with the item.ArchivedNo new subscriptions allowed for the item.DeletedNo subscriptions allowed for the item.
ActiveNew subscriptions can be created with the item.ArchivedNo new subscriptions allowed for the item.DeletedNo subscriptions allowed for the item.
Show all values[+]
Quantity Quantity
optional, integer, min=1
The default quantity of the addon to be attached when the quantity is not specified while creating/updating the subscription.
QuantityInDecimal QuantityInDecimal
optional, string, max chars=33
The decimal representation of the quantity of the addon. Returned for quantity-based addons when multi-decimal pricing is enabled.
BillingCycles BillingCycles
optional, integer, min=1
The number of subscription billing cycles for which this item is attached when applied to a subscription. Applicable only for items of type addon. Requires addon billing cycles to be enabled for the site.
The value set explicitly for billing_cycles while applying the addon to a subscription takes precedence over this attribute. This attribute, in turn, has a higher precedence than the value set for the addon-item price.

ChargeOnEvent ChargeOnEvent
enumerated string
Indicates when the item is charged. This attribute only applies to charge-items.
Possible values are
SubscriptionCreationthe time of creation of the subscription.SubscriptionTrialStartthe time when the trial period of the subscription begins.PlanActivationsame as subscription activation, but also includes the case when the plan-item of the subscription is changed.SubscriptionActivationthe moment a subscription enters an active or non-renewing state. Also includes reactivations of canceled subscriptions.ContractTerminationwhen a contract term is terminated.OnDemandItem can be charged on demand
SubscriptionCreationthe time of creation of the subscription.SubscriptionTrialStartthe time when the trial period of the subscription begins.PlanActivationsame as subscription activation, but also includes the case when the plan-item of the subscription is changed.SubscriptionActivationthe moment a subscription enters an active or non-renewing state. Also includes reactivations of canceled subscriptions.
ContractTerminationwhen a contract term is terminated.OnDemandItem can be charged on demand
Show all values[+]
ChargeOnce ChargeOnce
boolean
Indicates if the charge-item is to be charged only once or each time the charge_on_event occurs. This attribute only applies to charge-items.
CreatedAt CreatedAt
timestamp(UTC) in seconds
The time at which this attached item was created.
ResourceVersion ResourceVersion
optional, long
Version number of this resource. The 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.
UpdatedAt UpdatedAt
optional, timestamp(UTC) in seconds
The time at which this attached item was last updated.
Channel Channel
optional, enumerated string
The subscription channel this object originated from and is maintained in.
Possible values are
WebThe object was created (and is maintained) for the web channel directly in Chargebee via API or UI.AppStoreThe object data is synchronized with data from in-app subscription(s) created in Apple App Store. Direct manipulation of this object via UI or API is disallowed.PlayStoreThe object data is synchronized with data from in-app subscription(s) created in Google Play Store. Direct manipulation of this object via UI or API is disallowed.
WebThe object was created (and is maintained) for the web channel directly in Chargebee via API or UI.AppStoreThe object data is synchronized with data from in-app subscription(s) created in Apple App Store. Direct manipulation of this object via UI or API is disallowed.PlayStoreThe object data is synchronized with data from in-app subscription(s) created in Google Play Store. Direct manipulation of this object via UI or API is disallowed.
Show all values[+]
BusinessEntityId BusinessEntityId
optional, string, max chars=50
The unique ID of the business entity of this subscription. This is applicable only when multiple business entities have been created for the site. The value of this attribute indicates that the resource is specific to the given business entity.
Deleted Deleted
boolean
Indicates whether the attached item has been deleted or not.

Creates an attached addon or a charge item for a plan.

Notes

Sample Codes
 
using ChargeBee.Api;
using ChargeBee.Models;
ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = AttachedItem.Create("basic")
		.ItemId("day-pass")
		.Type(TypeEnum.Mandatory)
		.Quantity(1)
		.Request();

AttachedItem attachedItem = result.AttachedItem;

 
using ChargeBee.Api;
using ChargeBee.Models;
using ChargeBee.Models.Enums;
ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = AttachedItem.Create("basic")
		.ItemId("ssl")
		.ChargeOnEvent(ChargeOnEventEnum.SubscriptionCreation)
		.ChargeOnce(true)
		.Request();

AttachedItem attachedItem = result.AttachedItem;

copy
Click to Copy
Attach a mandatory addon item
 
using ChargeBee.Api;
using ChargeBee.Models;
ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = AttachedItem.Create("basic")
		.ItemId("day-pass")
		.Type(TypeEnum.Mandatory)
		.Quantity(1)
		.Request();

AttachedItem attachedItem = result.AttachedItem;

Sample Result [ JSON ]

Show more...
{
    "attached_item": {
        "created_at": 1594107081,
        "id": "c9109b84-732a-4093-b53d-0b9f31ccc11c",
        "item_id": "day-pass",
        "object": "attached_item",
        "parent_item_id": "basic",
        "quantity": 1,
        "resource_version": 1594107081871,
        "status": "active",
        "type": "mandatory",
        "updated_at": 1594107081
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/items/{item-id}/attached_items

Method

AttachedItem.Create(<item_id>)
ItemId[(val)](val)
required, string, max chars=100
The id of the addon or charge that is being attached to the plan-item.
Type[(val)](val)
optional, enumerated string
The type of attachment for the addon. Only applicable for addon-items and is a required parameter as well for addon-items.
Possible values are
RecommendedThe addon is recommended to go with the plan-item when using Checkout or Portal.MandatoryThe addon is attached automatically to the subscription for the plan-item unless explicitly removed via API.OptionalThe addon is neither mandatory, nor recommended. This allows you to attach an addon so you can specify a quantity and billing_cycles for the addon, for when it is applied to subscriptions with the plan.
RecommendedThe addon is recommended to go with the plan-item when using Checkout or Portal.MandatoryThe addon is attached automatically to the subscription for the plan-item unless explicitly removed via API.OptionalThe addon is neither mandatory, nor recommended. This allows you to attach an addon so you can specify a quantity and billing_cycles for the addon, for when it is applied to subscriptions with the plan.
Show all values[+]
BillingCycles[(val)](val)
optional, integer, min=1
The number of subscription billing cycles for which this item is attached when applied to a subscription. Applicable only for items of type addon. Requires addon billing cycles to be enabled for the site.

The value set explicitly for billing_cycles while applying the addon to a subscription takes precedence over this parameter. This parameter, in turn, has a higher precedence than the value set for the addon-item price.
Quantity[(val)](val)
optional, integer, min=1
The default quantity of the addon to be attached when the quantity is not specified while creating/updating the subscription.
QuantityInDecimal[(val)](val)
optional, string, max chars=33
The decimal representation of the quantity of the addon. Returned for quantity-based addons when multi-decimal pricing is enabled.
ChargeOnEvent[(val)](val)
optional, enumerated string
Indicates when the item is charged. This parameter only applies to charge-items.
Possible values are
SubscriptionCreationthe time of creation of the subscription.SubscriptionTrialStartthe time when the trial period of the subscription begins.PlanActivationsame as subscription activation, but also includes the case when the plan-item of the subscription is changed.SubscriptionActivationthe moment a subscription enters an active or non-renewing state. Also includes reactivations of canceled subscriptions.ContractTerminationwhen a contract term is terminated.OnDemandItem can be charged on demand
SubscriptionCreationthe time of creation of the subscription.SubscriptionTrialStartthe time when the trial period of the subscription begins.PlanActivationsame as subscription activation, but also includes the case when the plan-item of the subscription is changed.SubscriptionActivationthe moment a subscription enters an active or non-renewing state. Also includes reactivations of canceled subscriptions.
ContractTerminationwhen a contract term is terminated.OnDemandItem can be charged on demand
Show all values[+]
ChargeOnce[(val)](val)
optional, boolean
Indicates if the charge-item is to be charged only once or each time the charge_on_event occurs. This parameter only applies to charge-items.
BusinessEntityId[(val)](val)
optional, string, max chars=50

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

Note: An alternative way of passing this parameter is by using a custom HTTP header or query string parameter.

.
attached_item attached_item
always returned
Resource object representing attached_item

Sample admin console URL

https://{site}.chargebee.com/admin-console/attached_items/123x

Updates an attached addon or a charge item for a plan.

Notes

Sample Codes
 
using ChargeBee.Api;
using ChargeBee.Models;
ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = AttachedItem.Update("85943f11-6014-4ab5-990d-60c86a9c2893")
		.ParentItemId("cb-demo")
		.Type(TypeEnum.Recommended)
		.Request();

AttachedItem attachedItem = result.AttachedItem;

copy
Click to Copy
 
using ChargeBee.Api;
using ChargeBee.Models;
ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = AttachedItem.Update("85943f11-6014-4ab5-990d-60c86a9c2893")
		.ParentItemId("cb-demo")
		.Type(TypeEnum.Recommended)
		.Request();

AttachedItem attachedItem = result.AttachedItem;

Sample Result [ JSON ]

Show more...
{
    "attached_item": {
        "created_at": 1594107090,
        "id": "85943f11-6014-4ab5-990d-60c86a9c2893",
        "item_id": "day-pass",
        "object": "attached_item",
        "parent_item_id": "cb-demo",
        "quantity": 1,
        "resource_version": 1594107092592,
        "status": "active",
        "type": "recommended",
        "updated_at": 1594107092
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/attached_items/{attached-item-id}

Method

AttachedItem.Update(<attached_item_id>)
ParentItemId[(val)](val)
required, string, max chars=100
The id of the parent item in the attachment relationship.
Type[(val)](val)
optional, enumerated string
The type of attachment for the addon. Only applicable for addon-items and is a required parameter as well for addon-items.
Possible values are
RecommendedThe addon is recommended to go with the plan-item when using Checkout or Portal.MandatoryThe addon is attached automatically to the subscription for the plan-item unless explicitly removed via API.OptionalThe addon is neither mandatory, nor recommended. This allows you to attach an addon so you can specify a quantity and billing_cycles for the addon, for when it is applied to subscriptions with the plan.
RecommendedThe addon is recommended to go with the plan-item when using Checkout or Portal.MandatoryThe addon is attached automatically to the subscription for the plan-item unless explicitly removed via API.OptionalThe addon is neither mandatory, nor recommended. This allows you to attach an addon so you can specify a quantity and billing_cycles for the addon, for when it is applied to subscriptions with the plan.
Show all values[+]
BillingCycles[(val)](val)
optional, integer, min=1
The number of subscription billing cycles for which this item is attached when applied to a subscription. Applicable only for items of type addon. Requires addon billing cycles to be enabled for the site.

The value set explicitly for billing_cycles while applying the addon to a subscription takes precedence over this parameter. This parameter, in turn, has a higher precedence than the value set for the addon-item price.
Quantity[(val)](val)
optional, integer, min=1
The default quantity of the addon to be attached when the quantity is not specified while creating/updating the subscription.
QuantityInDecimal[(val)](val)
optional, string, max chars=33
The decimal representation of the quantity of the addon. Returned for quantity-based addons when multi-decimal pricing is enabled.
ChargeOnEvent[(val)](val)
optional, enumerated string
Indicates when the item is charged. This parameter only applies to charge-items.
Possible values are
SubscriptionCreationthe time of creation of the subscription.SubscriptionTrialStartthe time when the trial period of the subscription begins.PlanActivationsame as subscription activation, but also includes the case when the plan-item of the subscription is changed.SubscriptionActivationthe moment a subscription enters an active or non-renewing state. Also includes reactivations of canceled subscriptions.ContractTerminationwhen a contract term is terminated.OnDemandItem can be charged on demand
SubscriptionCreationthe time of creation of the subscription.SubscriptionTrialStartthe time when the trial period of the subscription begins.PlanActivationsame as subscription activation, but also includes the case when the plan-item of the subscription is changed.SubscriptionActivationthe moment a subscription enters an active or non-renewing state. Also includes reactivations of canceled subscriptions.
ContractTerminationwhen a contract term is terminated.OnDemandItem can be charged on demand
Show all values[+]
ChargeOnce[(val)](val)
optional, boolean
Indicates if the charge-item is to be charged only once or each time the charge_on_event occurs. This parameter only applies to charge-items.
attached_item attached_item
always returned
Resource object representing attached_item

Sample admin console URL

https://{site}.chargebee.com/admin-console/attached_items/123x

Retrieves details of an attached addon or a charge item.

Notes

Sample Codes
 
using ChargeBee.Api;
using ChargeBee.Models;
ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = AttachedItem.Retrieve("a0d63a3a-4bea-4621-b4c9-1bb7f833a603")
		.ParentItemId("cb-demo")
		.Request();

AttachedItem attachedItem = result.AttachedItem;

copy
Click to Copy
 
using ChargeBee.Api;
using ChargeBee.Models;
ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = AttachedItem.Retrieve("a0d63a3a-4bea-4621-b4c9-1bb7f833a603")
		.ParentItemId("cb-demo")
		.Request();

AttachedItem attachedItem = result.AttachedItem;

Sample Result [ JSON ]

Show more...
{
    "attached_item": {
        "charge_on_event": "plan_activation",
        "charge_once": true,
        "created_at": 1594107087,
        "id": "a0d63a3a-4bea-4621-b4c9-1bb7f833a603",
        "item_id": "ssl",
        "object": "attached_item",
        "parent_item_id": "cb-demo",
        "quantity": 1,
        "resource_version": 1594107087829,
        "status": "active",
        "updated_at": 1594107087
    }
}

URL Format GET

https://{site}.chargebee.com/api/v2/attached_items/{attached-item-id}

Method

AttachedItem.Retrieve(<attached_item_id>)
ParentItemId[(val)](val)
required, string, max chars=100
The id of the plan-item to which the item is attached.
attached_item attached_item
always returned
Resource object representing attached_item

Sample admin console URL

https://{site}.chargebee.com/admin-console/attached_items/123x

Deletes an attached addon or a charge item.

Notes

Sample Codes
 
using ChargeBee.Api;
using ChargeBee.Models;
ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = AttachedItem.Delete("bf0d81c1-eb45-4636-ad8e-5ab31099e325")
		.ParentItemId("no-trial")
		.Request();

AttachedItem attachedItem = result.AttachedItem;

copy
Click to Copy
 
using ChargeBee.Api;
using ChargeBee.Models;
ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = AttachedItem.Delete("bf0d81c1-eb45-4636-ad8e-5ab31099e325")
		.ParentItemId("no-trial")
		.Request();

AttachedItem attachedItem = result.AttachedItem;

Sample Result [ JSON ]

Show more...
{
    "attached_item": {
        "charge_on_event": "plan_activation",
        "charge_once": true,
        "created_at": 1594107084,
        "id": "bf0d81c1-eb45-4636-ad8e-5ab31099e325",
        "item_id": "ssl",
        "object": "attached_item",
        "parent_item_id": "no-trial",
        "quantity": 1,
        "resource_version": 1594107085548,
        "status": "deleted",
        "updated_at": 1594107085
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/attached_items/{attached-item-id}/delete

Method

AttachedItem.Delete(<attached_item_id>)
ParentItemId[(val)](val)
required, string, max chars=100
The id of the addon or charge that is being attached to the plan-item.
attached_item attached_item
always returned
Resource object representing attached_item

Sample admin console URL

https://{site}.chargebee.com/admin-console/attached_items/123x
Returns a list of attached items satisfying all the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order (latest first).

Notes

Sample Codes
 
using ChargeBee.Api;
using ChargeBee.Models;
ApiConfig.Configure("{site}","{site_api_key}");
ListResult result = AttachedItem.List("basic")
		.Limit(10)
		.Request();

foreach (var item in result.List){
  AttachedItem attachedItem = item.AttachedItem;
}

copy
Click to Copy
 
using ChargeBee.Api;
using ChargeBee.Models;
ApiConfig.Configure("{site}","{site_api_key}");
ListResult result = AttachedItem.List("basic")
		.Limit(10)
		.Request();

foreach (var item in result.List){
  AttachedItem attachedItem = item.AttachedItem;
}

Sample Result [ JSON ]

Show more...
{
    "list": [
        {
            "attached_item": {
                "charge_on_event": "subscription_creation",
                "charge_once": true,
                "created_at": 1594107083,
                "id": "9e2b1598-ade1-45ec-87a3-f5fb847b2b9e",
                "item_id": "ssl",
                "object": "attached_item",
                "parent_item_id": "basic",
                "resource_version": 1594107083189,
                "status": "active",
                "updated_at": 1594107083
            }
        },
        {..}
    ]
}

URL Format GET

https://{site}.chargebee.com/api/v2/items/{item-id}/attached_items

Method

AttachedItem.List(<item_id>)
Limit[(val)](val)
optional, integer, default=10, min=1, max=100
The number of resources to be returned.
Offset[(val)](val)
optional, string, max chars=1000
Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set offset to the value of next_offset obtained in the previous iteration of the API call.
Filter Params
For operator usages, see the Pagination and Filtering section.
Id().<operator>(val)
optional, string filter
Filter attached items based on their id. Possible values are :
Supported operators : Is, IsNot, StartsWith, In, NotIn

Example Id().Is(bec0c324-adb6-44d3-ad4f-694f449be97c)
IdIs().<operator>(val)
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
IdIsNot().<operator>(val)
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
IdStartsWith().<operator>(val)
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
IdIn().<operator>(val)
optional, string filter
Possible values are :
Supported operators :

Example
IdNotIn().<operator>(val)
optional, string filter
Possible values are :
Supported operators :

Example
ItemId().<operator>(val)
optional, string filter
Filter attached items based on the item_id of the item being attached. Possible values are :
Supported operators : Is, IsNot, StartsWith, In, NotIn

Example ItemId().Is(basic)
ItemIdIs().<operator>(val)
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
ItemIdIsNot().<operator>(val)
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
ItemIdStartsWith().<operator>(val)
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
ItemIdIn().<operator>(val)
optional, string filter
Possible values are :
Supported operators :

Example
ItemIdNotIn().<operator>(val)
optional, string filter
Possible values are :
Supported operators :

Example
Type().<operator>(val)
optional, enumerated string filter
Filter attached items based on the type of attached item. Possible values are : Recommended, Mandatory, Optional
Supported operators : Is, IsNot, In, NotIn

Example Type().Is(mandatory)
TypeIs().<operator>(val)
optional, enumerated string filter
Possible values are : Recommended, Mandatory, Optional
Supported operators :

Example
TypeIsNot().<operator>(val)
optional, enumerated string filter
Possible values are : recommended, mandatory, optional
Supported operators :

Example
TypeIn().<operator>(val)
optional, string filter
Possible values are :
Supported operators :

Example
TypeNotIn().<operator>(val)
optional, string filter
Possible values are :
Supported operators :

Example
ItemType().<operator>(val)
optional, enumerated string filter
To filter based on the type of of the attached item. Possible values are : Plan, Addon, Charge
Supported operators : Is, IsNot, In, NotIn

Example ItemType().Is(plan)
ItemTypeIs().<operator>(val)
optional, enumerated string filter
Possible values are : Plan, Addon, Charge
Supported operators :

Example
ItemTypeIsNot().<operator>(val)
optional, enumerated string filter
Possible values are : plan, addon, charge
Supported operators :

Example
ItemTypeIn().<operator>(val)
optional, string filter
Possible values are :
Supported operators :

Example
ItemTypeNotIn().<operator>(val)
optional, string filter
Possible values are :
Supported operators :

Example
ChargeOnEvent().<operator>(val)
optional, enumerated string filter
Indicates when the item is charged. This attribute only applies to charge-items. Possible values are : SubscriptionCreation, SubscriptionTrialStart, PlanActivation, SubscriptionActivation, ContractTermination, OnDemand
Supported operators : Is, IsNot, In, NotIn

Example ChargeOnEvent().Is(subscription_creation)
ChargeOnEventIs().<operator>(val)
optional, enumerated string filter
Possible values are : SubscriptionCreation, SubscriptionTrialStart, PlanActivation, SubscriptionActivation, ContractTermination, OnDemand
Supported operators :

Example
ChargeOnEventIsNot().<operator>(val)
optional, enumerated string filter
Possible values are : subscription_creation, subscription_trial_start, plan_activation, subscription_activation, contract_termination, on_demand
Supported operators :

Example
ChargeOnEventIn().<operator>(val)
optional, string filter
Possible values are :
Supported operators :

Example
ChargeOnEventNotIn().<operator>(val)
optional, string filter
Possible values are :
Supported operators :

Example
UpdatedAt().<operator>(val)
optional, timestamp(UTC) in seconds filter
Filter attached items based on when the attached items were last updated. Possible values are :
Supported operators : After, Before, On, Between

Example UpdatedAt().After(1243545465)
UpdatedAtAfter().<operator>(val)
optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :

Example
UpdatedAtBefore().<operator>(val)
optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :

Example
UpdatedAtOn().<operator>(val)
optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :

Example
UpdatedAtBetween().<operator>(val)
optional, string filter
Possible values are :
Supported operators :

Example
attached_item attached_item
always returned
Resource object representing attached_item
next_offset next_offset
optional, string, max chars=1000
This attribute is returned only if more resources are present. To fetch the next set of resources use this value for the input parameter `offset`.

Sample admin console URL

https://{site}.chargebee.com/admin-console/attached_items/123x