POST /items/{item-id}/attached_items

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

Servers

Path parameters

Name Type Required Description
item-id String Yes

Request headers

Name Type Required Description
chargebee-request-origin-device String No

The device from which the customer has made the request

Content-Type String Yes The media type of the request body.

Default value: "application/x-www-form-urlencoded"

chargebee-event-webhook String No

skip only webhooks

Possible values:

  • "all-disabled"
chargebee-business-entity-id String No

If the site has multiple business entities, you can use this custom HTTP header to specify the business entity for which Chargebee should perform the operation.

chargebee-event-actions String No

skip all actions to be done on the events

Possible values:

  • "all-disabled"
chargebee-request-origin-user String No

The email address of your customer/user. Use this when the email address has only ASCII characters.

chargebee-request-origin-ip String No

The IP address of the customer where the request originated

chargebee-request-origin-user-encoded String No

The Base64-encoded email address of your customer/user. Use this if the email address has UTF-8 characters. When this header is provided, the header chargebee-request-origin-user is ignored.

chargebee-event-email String No

skip only emails

Possible values:

  • "all-disabled"

Request body fields

Name Type Required Description
charge_on_event String No

Indicates when the item is charged. This parameter only applies to charge-items. * contract_termination - when a contract term is terminated. * subscription_creation - the time of creation of the subscription. * subscription_trial_start - the time when the trial period of the subscription begins. * on_demand - Item can be charged on demand * plan_activation - same as subscription activation, but also includes the case when the plan-item of the subscription is changed. * subscription_activation - the moment a subscription enters an active or non-renewing state. Also includes reactivations of canceled subscriptions.

Possible values:

  • "subscription_activation"
  • "plan_activation"
  • "subscription_creation"
  • "contract_termination"
  • "subscription_trial_start"
  • "on_demand"
charge_once Boolean No

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.

quantity Integer No

The default quantity of the addon to be attached when the quantity is not specified while creating/updating the subscription.

quantity_in_decimal String No

The decimal representation of the quantity of the addon. Returned for quantity-based addons when multi-decimal pricing is enabled.

type String No

The type of attachment for the addon. Only applicable for addon-items and is a required parameter as well for addon-items. * recommended - The addon is recommended to go with the plan-item when using Checkout or Portal. * optional - The 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. * mandatory - The addon is attached automatically to the subscription for the plan-item unless explicitly removed via API.

Possible values:

  • "optional"
  • "recommended"
  • "mandatory"
business_entity_id String No

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. .

item_id String Yes

The id of the addon or charge that is being attached to the plan-item.

billing_cycles Integer No

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.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.