# Edit a quote for subscription creation

> For the complete machine-readable documentation index, see [llms.txt](https://apidocs.chargebee.com/llms.txt).


[Idempotency Supported](/docs/api/idempotency)

Changes the quote produced for creating a new subscription items

## Sample Request

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/quotes/4/edit_create_subscription_quote_for_items \
     -X POST  \
     -u {site_api_key}:\
     -d "subscription_items[item_price_id][0]"="basic-USD" \
     -d "subscription_items[unit_price][0]"=1520 \
     -d "subscription_items[quantity][0]"=3
```

#### .NET

```dotnet
using ChargeBee.Api;
using ChargeBee.Models;

ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = Quote.EditCreateSubCustomerQuoteForItems("4")
		.SubscriptionItemItemPriceId(0, "basic-USD")
		.SubscriptionItemUnitPrice(0, 1520)
		.SubscriptionItemQuantity(0, 3)
		.Request();

Quote quote = result.Quote;
QuotedSubscription quotedSubscription = result.QuotedSubscription;
QuotedRamp quotedRamp = result.QuotedRamp;
```

#### Go

```go
package main
import (
    "fmt"
    "github.com/chargebee/chargebee-go/v3"
    quoteAction "github.com/chargebee/chargebee-go/v3/actions/quote"
    "github.com/chargebee/chargebee-go/v3/models/quote"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := quoteAction.EditCreateSubCustomerQuoteForItems("4", &quote.EditCreateSubCustomerQuoteForItemsRequestParams{
        SubscriptionItems : []*quote.EditCreateSubCustomerQuoteForItemsSubscriptionItemParams{
            {
                ItemPriceId : "basic-USD",
                UnitPrice : chargebee.Int64(1520),
                Quantity : chargebee.Int32(3),
            },
        },
    }).Request()
    if err != nil {
        fmt.Println(err)
    } else {
        Quote := res.Quote
        QuotedSubscription := res.QuotedSubscription
        QuotedRamp := res.QuotedRamp
    }
}
```

#### Go

```go
package main

import (
  "fmt"
  "github.com/chargebee/chargebee-go/v4"
)

func main() {
  config := &chargebee.ClientConfig{
    SiteName: "{site}",
    ApiKey: "{site_api_key}",
  }    
  client := chargebee.NewClient(config)
  req := &chargebee.QuoteEditCreateSubCustomerQuoteForItemsRequest{
    SubscriptionItems : []*chargebee.QuoteEditCreateSubCustomerQuoteForItemsSubscriptionItem{
        {
            ItemPriceId : "basic-USD",
            UnitPrice : chargebee.Int64(1520),
            Quantity : chargebee.Int32(3),
        },
    },
}
  res, err := client.Quote.EditCreateSubCustomerQuoteForItems("4", req)
      if err != nil {
        fmt.Println(err)
    } else {
        Quote := res.Quote
        QuotedSubscription := res.QuotedSubscription
        QuotedRamp := res.QuotedRamp
    }
}
```

#### Java

```java
import com.chargebee.*;
import com.chargebee.ListResult;
import com.chargebee.models.*;
import com.chargebee.models.enums.*;
import java.io.IOException;

public class Sample {

    public static void main(String args[]) throws IOException, Exception {
        Environment.configure("{site}", "{site_api_key}");
        Result result = Quote.editCreateSubCustomerQuoteForItems("4")
            .subscriptionItemItemPriceId(0, "basic-USD")
            .subscriptionItemUnitPrice(0, 1520L)
            .subscriptionItemQuantity(0, 3)
            .request();

        Quote quote = result.quote();
        QuotedSubscription quotedSubscription = result.quotedSubscription();
        QuotedRamp quotedRamp = result.quotedRamp();
    }
}
```

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.quote.Quote;
import com.chargebee.v4.models.quote.params.EditCreateSubscriptionCustomerQuoteForItemsParams;
import com.chargebee.v4.models.quote.responses.EditCreateSubscriptionCustomerQuoteForItemsResponse;
import com.chargebee.v4.models.quotedRamp.QuotedRamp;
import com.chargebee.v4.models.quotedSubscription.QuotedSubscription;
import java.util.List;

public class EditCreateSubscriptionCustomerQuoteForItems {

    public static void main(String[] args) {
        ChargebeeClient client = ChargebeeClient.builder()
            .apiKey("{site_api_key}")
            .siteName("{site}")
            .build();

        EditCreateSubscriptionCustomerQuoteForItemsParams.SubscriptionItemsParams subscriptionItem0 =
            EditCreateSubscriptionCustomerQuoteForItemsParams.SubscriptionItemsParams.builder()
                .itemPriceId("basic-USD")
                .unitPrice(1520L)
                .quantity(3)
                .build();

        List<EditCreateSubscriptionCustomerQuoteForItemsParams.SubscriptionItemsParams> subscriptionItemsList =
            List.of(subscriptionItem0);

        EditCreateSubscriptionCustomerQuoteForItemsParams params = EditCreateSubscriptionCustomerQuoteForItemsParams.builder()
            .subscriptionItems(subscriptionItemsList)
            .build();

        EditCreateSubscriptionCustomerQuoteForItemsResponse response = client
            .quotes()
            .editCreateSubscriptionCustomerQuoteForItems("4", params);

        Quote quote = response.getQuote();
        QuotedSubscription quotedSubscription = response.getQuotedSubscription();
        QuotedRamp quotedRamp = response.getQuotedRamp();
    }
}
```

#### Node.js

```node
import Chargebee from "chargebee";

const chargebee = new Chargebee({
    site: "{site}",
    apiKey: "{site_api_key}",
});

try {
    const result = await chargebee.quote.editCreateSubCustomerQuoteForItems("4", {
        subscription_items: [
            {
                item_price_id: "basic-USD",
                unit_price: 1520,
                quantity: 3
            }
        ]
    });

    console.log(result);
    const quote = result.quote;
    const quotedSubscription = result.quoted_subscription;
    const quotedRamp = result.quoted_ramp;
} catch (err) {
    console.log(err);
}
```

#### PHP

```php
<?php

require __DIR__ . '/vendor/autoload.php';

use Chargebee\ChargebeeClient;

$chargebee = new ChargebeeClient(options: [
    "site" => "{site}",
    "apiKey" => "{site_api_key}",
]);
$result = $chargebee->quote()->editCreateSubCustomerQuoteForItems("4", [
    "subscription_items" => [
        [
            "item_price_id" => "basic-USD",
            "unit_price" => 1520,
            "quantity" => 3
        ]
    ]
]);
$quote = $result->quote;
$quotedSubscription = $result->quoted_subscription;
$quotedRamp = $result->quoted_ramp;
```

#### Python

```python
from chargebee import Chargebee

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
response = cb_client.Quote.edit_create_sub_customer_quote_for_items("4",
    cb_client.Quote.EditCreateSubCustomerQuoteForItemsParams(
        subscription_items=[
            cb_client.Quote.EditCreateSubCustomerQuoteForItemsSubscriptionItemParams(
              item_price_id="basic-USD",
              unit_price=1520,
              quantity=3
            )
        ]
    )
)
quote = response.quote
quoted_subscription = response.quoted_subscription
quoted_ramp = response.quoted_ramp
```

#### Ruby

```ruby
require 'chargebee'

ChargeBee.configure(:site => "{site}",
  :api_key => "{site_api_key}")

result = ChargeBee::Quote.edit_create_sub_customer_quote_for_items("4",{
  :subscription_items => [
    {
      :item_price_id => "basic-USD",
      :unit_price => 1520,
      :quantity => 3
    }
  ]
})

quote = result.quote
quoted_subscription = result.quoted_subscription
quoted_ramp = result.quoted_ramp
```

## Sample Response

```json
{
  "quote": {
    "amount_due": 4560,
    "amount_paid": 0,
    "billing_address": {
      "first_name": "John",
      "last_name": "Doe",
      "object": "billing_address",
      "validation_status": "not_validated"
    },
    "charge_on_acceptance": 0,
    "credits_applied": 0,
    "currency_code": "USD",
    "customer_id": "__test__KyVlFpS4cWDaQi",
    "date": 1517485108,
    "id": "4",
    "line_item_discounts": {},
    "line_item_taxes": {},
    "line_items": [
      {
        "amount": 4560,
        "customer_id": "__test__KyVlFpS4cWDaQi",
        "date_from": 1517485108,
        "date_to": 1519904308,
        "description": "basic USD",
        "discount_amount": 0,
        "entity_id": "basic-USD",
        "entity_type": "plan_item_price",
        "id": "__test__KyVlFpS4cWDxA10",
        "is_taxed": false,
        "item_level_discount_amount": 0,
        "object": "line_item",
        "pricing_model": "per_unit",
        "quantity": 3,
        "tax_amount": 0,
        "unit_amount": 1520
      },
      {..}
    ],
    "object": "quote",
    "operation_type": "create_subscription_for_customer",
    "price_type": "tax_exclusive",
    "resource_version": 1517485108000,
    "status": "open",
    "sub_total": 4560,
    "taxes": {},
    "total": 4560,
    "updated_at": 1517485108,
    "valid_till": 1517596199,
    "version": 2
  }
}
```

## URL Format

**POST** https://[site].chargebee.com/api/v2/quotes/{quote-id}/edit_create_subscription_quote_for_items

## Input Parameters

- `notes` (optional, string, max chars=10000)
  Notes specific to this quote that you want customers to see on the quote PDF.

- `expires_at` (optional, timestamp(UTC) in seconds)
  Quotes will be valid till this date. After this quote will be marked as closed.

- `billing_cycles` (optional, integer, min=0)
  The number of billing cycles the subscription runs before canceling. If not provided, then the billing cycles [set for the plan-item price](/docs/api/item_prices/item_price-object#billing_cycles) is used.

- `mandatory_items_to_remove` (optional, string, max chars=100)
  Item ids of [mandatorily attached addons](/docs/api/attached_items) that are to be removed from the subscription.

- `terms_to_charge` (optional, integer, min=1)
  The number of subscription billing cycles (including the first one) to [invoice in advance](https://www.chargebee.com/docs/advance-invoices.html) .

- `billing_alignment_mode` (optional, enumerated string)
  Override the [billing alignment mode](https://www.chargebee.com/docs/calendar-billing.html#alignment-of-billing-date) for Calendar Billing. Only applicable when using Calendar Billing. The default value is that which has been configured for the site.
  Possible enum values:
    - `immediate`
      Subscription period will be aligned with the configured billing date immediately, with credits or charges raised accordingly..
    - `delayed`
      Subscription period will be aligned with the configured billing date at the next renewal.

- `coupon_ids` (optional, string, max chars=100)
  The list of [IDs](/docs/api/coupons/coupon-object#id) of the coupons to be applied. [Coupon codes](/docs/api/coupon_codes) are also supported.
  
  **Note**
  
  Not applicable when Chargebee CPQ is enabled. Use `coupons[]` array instead.

- `billing_start_option` (optional, enumerated string, default=on_specific_date)
  When the quote is converted, this attribute determines the date/time as of when the subscription start is to be carried out.
  
  **Note**
  
  The parameter applies only when Chargebee CPQ is enabled. To request access, contact [Chargebee Support](https://www.chargebee.com/docs/billing/2.0/kb/getting-started/how-to-contact-chargebees-support-team?utm_source=docs_api&utm_medium=content&utm_campaign=support).
  Possible enum values:
    - `immediately`
      The subscription starts immediately upon conversion of the quote to a subscription.
    - `on_specific_date`
      Upon quote conversion, the subscription is scheduled to start on the specified date.

- `net_term_days` (optional, integer)
  The number of days from [`invoice.date`](/docs/api/invoices/invoice-object#date) until payment for the invoice is due.
  
  **Note** The parameter applies only when Chargebee CPQ is enabled. To request access, contact [Chargebee Support](https://www.chargebee.com/docs/billing/2.0/kb/getting-started/how-to-contact-chargebees-support-team?utm_source=docs_api&utm_medium=content&utm_campaign=support).

- `subscription` (optional, string)
  Parameters for subscription
  - `id` (optional, string, max chars=50)
    A unique and immutable identifier for the subscription. If not provided, it is autogenerated.
  - `po_number` (optional, string, max chars=100)
    Purchase order number for this subscription.
  - `trial_end` (optional, timestamp(UTC) in seconds)
    End of the trial period for the subscription. This overrides the trial period set for the plan-item. The value must be later than `start_date`. Set it to `0` to have no trial period.
  - `start_date` (optional, timestamp(UTC) in seconds)
    The date/time at which the subscription is to start or has started. If not provided, the subscription starts immediately on quote conversion. The quote can be converted on a date/time after this date. This is called backdating the subscription creation and is done when the subscription has already been provisioned but the conversion action has been delayed. Backdating is allowed only when the following prerequisites are met:
    
    -   Backdating is enabled for subscription creation operations.
    -   The current day of the month does not exceed the limit set in Chargebee for backdating such operations. This day is typically the day of the month by which the accounting for the previous month must be closed.
    -   The date is not more than duration X into the past where X is the billing period of the plan. For example, if the period of the plan in the subscription is 2 months and today is 14th April, `subscription[start_date]` cannot be earlier than 14th February.
  - `offline_payment_method` (optional, enumerated string)
    The preferred offline payment method for the subscription.
    Possible enum values:
      - `no_preference`
        No Preference
      - `cash`
        Cash
      - `check`
        Check
      - `bank_transfer`
        Bank Transfer
      - `ach_credit`
        ACH Credit
      - `sepa_credit`
        SEPA Credit
      - `boleto`
        Boleto
      - `us_automated_bank_transfer`
        US Automated Bank Transfer
      - `eu_automated_bank_transfer`
        EU Automated Bank Transfer
      - `uk_automated_bank_transfer`
        UK Automated Bank Transfer
      - `jp_automated_bank_transfer`
        JP Automated Bank Transfer
      - `mx_automated_bank_transfer`
        MX Automated Bank Transfer
      - `custom`
        Custom
  - `contract_term_billing_cycle_on_renewal` (optional, integer, min=1, max=100)
    Number of billing cycles the new contract term should run for, on contract renewal. The default value is the same as `billing_cycles` or a custom value depending on the [site configuration](https://www.chargebee.com/docs/contract-terms.html#configuring-contract-terms) .
  - `free_period` (optional, integer, min=1)
    The period of time by which the first term of the subscription is extended free of charge. The value is expressed in the time unit specified by `free_period_unit`. For example, `3` with `free_period_unit` = `month` adds 3 free months to the first term of the subscription.
    
    **Prerequisite**
    
    Can be used only when Chargebee CPQ is enabled. To request access, [contact Chargebee Support](https://www.chargebee.com/docs/billing/2.0/kb/getting-started/how-to-contact-chargebees-support-team?utm_source=docs_api&utm_medium=content&utm_campaign=support).
  - `free_period_unit` (optional, enumerated string)
    The time unit for `free_period`.
    
    **Prerequisite**
    
    Can be used only when Chargebee CPQ is enabled. To request access, [contact Chargebee Support](https://www.chargebee.com/docs/billing/2.0/kb/getting-started/how-to-contact-chargebees-support-team?utm_source=docs_api&utm_medium=content&utm_campaign=support).
    
    **Constraint**
    
    Must be equal to or lower than the [`period_unit`](/docs/api/item_prices#period_unit) of the plan [item price](/quotes/edit-create-subscription-quote-for-items#subscription_items_item_price_id) of the subscription.
    Possible enum values:
      - `day`
        Charge based on day(s)
      - `week`
        Charge based on week(s)
      - `month`
        Charge based on month(s)
      - `year`
        Charge based on year(s)

- `shipping_address` (optional, string)
  Parameters for shipping\_address
  - `first_name` (optional, string, max chars=150)
    The first name of the contact.
  - `last_name` (optional, string, max chars=150)
    The last name of the contact.
  - `email` (optional, string, max chars=70)
    The email address.
  - `company` (optional, string, max chars=250)
    The company name.
  - `phone` (optional, string, max chars=50)
    The phone number.
  - `line1` (optional, string, max chars=150)
    Address line 1
  - `line2` (optional, string, max chars=150)
    Address line 2
  - `line3` (optional, string, max chars=150)
    Address line 3
  - `city` (optional, string, max chars=50)
    The name of the city.
  - `state_code` (optional, string, max chars=50)
    The [ISO 3166-2 state/province code](https://www.iso.org/obp/ui/#search/code) without the country prefix. Currently supported for USA, Canada, India and UAE. For instance, for Arizona (USA), set `state_code` as `AZ` (not `US-AZ` ). For Tamil Nadu (India), set as `TN` (not `IN-TN` ). For British Columbia (Canada), set as `BC` (not `CA-BC` ). For Dubai (UAE), set as `DU` (not `AE-DU` ).
  - `state` (optional, string, max chars=50)
    The state/province name. Is set by Chargebee automatically for US, Canada, India and UAE, if `state_code` is provided.
  - `zip` (optional, string, max chars=20)
    Zip or postal code. The number of characters is validated according to the rules [specified here](https://chromium-i18n.appspot.com/ssl-address) .
  - `country` (optional, string, max chars=50)
    The billing address country of the customer. Must be one of [ISO 3166 alpha-2 country code](https://www.iso.org/iso-3166-country-codes.html) .
    
    **Note**: If you enter an invalid country code, the system will return an error.
    
    **Brexit**
    
    If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or later, or have [manually enable](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, then `XI` (the code for **United Kingdom - Northern Ireland**) is available as an option.
  - `validation_status` (optional, enumerated string, default=not_validated)
    The address verification status.
    Possible enum values:
      - `not_validated`
        Address is not yet validated.
      - `valid`
        Address was validated successfully.
      - `partially_valid`
        The address is valid for taxability but has not been validated for shipping.
      - `invalid`
        Address is invalid.

- `contract_term` (optional, enumerated string)
  Parameters for contract\_term
  - `action_at_term_end` (optional, enumerated string)
    Action to be taken when the contract term completes.
    Possible enum values:
      - `renew`
        -   Contract term completes and a new contract term is started for the number of billing cycles specified in [`contract_billing_cycle_on_renewal`](/docs/api/v2/pcv-1/subscriptions/create-subscription-for-customer#contract_term_billing_cycle_on_renewal).
        -   The `action_at_term_end` for the new contract term is set to `renew`.
      - `evergreen`
        Contract term completes and the subscription renews.
      - `cancel`
        Contract term completes and subscription is canceled.
  - `cancellation_cutoff_period` (optional, integer, default=0)
    The number of days before [`contract_end`](/docs/api/contract_terms/contract_term-object#contract_end) , during which the customer is barred from canceling the contract term. The customer is allowed to cancel the contract term via the Self-Serve Portal only before this period. This allows you to have sufficient time for processing the contract term closure.

- `billing_address` (optional, string)
  Parameters for billing\_address
  - `first_name` (optional, string, max chars=150)
    The first name of the billing contact.
    
    **Note** The parameter `billing_address` and all its sub-parameters apply only when Chargebee CPQ is enabled. To request access, contact [Chargebee Support](https://www.chargebee.com/docs/billing/2.0/kb/getting-started/how-to-contact-chargebees-support-team?utm_source=docs_api&utm_medium=content&utm_campaign=support).
  - `last_name` (optional, string, max chars=150)
    The last name of the billing contact.
  - `email` (optional, string, max chars=70)
    The email address.
  - `company` (optional, string, max chars=250)
    The company name.
  - `phone` (optional, string, max chars=50)
    The phone number.
  - `line1` (optional, string, max chars=150)
    Address line 1
  - `line2` (optional, string, max chars=150)
    Address line 2
  - `line3` (optional, string, max chars=150)
    Address line 3
  - `city` (optional, string, max chars=50)
    The name of the city.
  - `state_code` (optional, string, max chars=50)
    The [ISO 3166-2 state/province code](https://www.iso.org/obp/ui/#search/code) without the country prefix. Currently supported for USA, Canada, India and UAE. For instance, for Arizona (USA), set `state_code` as `AZ` (not `US-AZ` ). For Tamil Nadu (India), set as `TN` (not `IN-TN` ). For British Columbia (Canada), set as `BC` (not `CA-BC` ). For Dubai (UAE), set as `DU` (not `AE-DU` ).
  - `state` (optional, string, max chars=50)
    The state/province name. Is set by Chargebee automatically for US, Canada, India and UAE, if `state_code` is provided.
  - `zip` (optional, string, max chars=20)
    Zip or postal code. The number of characters is validated according to the rules [specified here](https://i18napis.appspot.com/address) .
  - `country` (optional, string, max chars=50)
    The billing address country of the customer. Must be one of [ISO 3166 alpha-2 country code](https://www.iso.org/iso-3166-country-codes.html) .
    
    **Note**: If you enter an invalid country code, the system will return an error.
    
    **Brexit**
    
    If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or later, or have [manually enable](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, then `XI` (the code for **United Kingdom - Northern Ireland**) is available as an option.
  - `validation_status` (optional, enumerated string, default=not_validated)
    The address verification status.
    Possible enum values:
      - `not_validated`
        Address is not yet validated.
      - `valid`
        Address was validated successfully.
      - `partially_valid`
        The address is valid for taxability but has not been validated for shipping.
      - `invalid`
        Address is invalid.

- `subscription_items` (optional, array)
  Parameters for subscription\_items
  - `item_price_id` (required, string, max chars=100)
    The unique identifier of the item price.
  - `quantity` (optional, integer)
    The quantity of the item purchased
  - `quantity_in_decimal` (optional, string, max chars=33)
    The decimal representation of the quantity of the item purchased. Can be provided for quantity-based item prices and only when [multi-decimal pricing](/docs/api/getting-started) is enabled.
  - `unit_price` (optional, in cents)
    The price/per unit price of the item. When not provided, [the value set](/docs/api/item_prices/item-price-object) for the item price is used. This is only applicable when the `pricing_model` of the item price is `flat_fee` or `per_unit`. Also, it is only allowed when [price overriding](https://www.chargebee.com/docs/price-override.html) is enabled for the site. The value depends on the type of currency. If `changes_scheduled_at` is in the past and a `unit_price` is not passed, then the item price's current unit price is considered even if the item price did not exist on the date as of when the change is scheduled.
  - `unit_price_in_decimal` (optional, string, max chars=39)
    When [price overriding](https://www.chargebee.com/docs/2.0/price-override.html) is enabled for the site, the price or per-unit price of the item can be set here. The [value set for the item price](/docs/api/item_prices/item_price-object#price) is used by default. Provide the value as a decimal string in major units of the currency. Can be provided only when [multi-decimal pricing](/docs/api/getting-started) is enabled.
  - `billing_cycles` (optional, integer)
    For the plan-item price: the value determines the number of billing cycles the subscription runs before canceling automatically. If not provided, then [the value set](/docs/api/item_prices/item-price-object) for the plan-item price is used.
    
    For addon-item prices: If [addon billing cycles](https://www.chargebee.com/docs/2.0/addons-billingcycle.html) are enabled then this is the number of subscription billing cycles for which the addon is included. If not provided, then [the value set under attached addons](/docs/api/attached_items/attached-item-object) is used. Further, if that value is not provided, then [the value set for the addon-item price](/docs/api/item_prices/item-price-object) is used.
  - `trial_end` (optional, timestamp(UTC) in seconds)
    The date/time when the trial period of the item ends. Applies to plan-items and--when [enabled](https://www.chargebee.com/docs/2.0/addons-trial.html) --addon-items as well.
  - `service_period_days` (optional, integer)
    The service period of the item in days from the day of charge.
  - `charge_on_event` (optional, enumerated string)
    When `charge_on_option` option is set to `on_event` , this parameter specifies the event at which the charge-item is applied to the subscription. This parameter only applies to charge-items.
    Possible enum values:
      - `subscription_creation`
        the time of creation of the subscription.
      - `subscription_trial_start`
        the time when the trial period of the subscription begins.
      - `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.
      - `contract_termination`
        when a contract term is [terminated](/docs/api/subscriptions/cancel-subscription-for-items#contract_term_cancel_option) .
  - `charge_once` (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.
  - `description` (optional, string, max chars=2000)
  - `charge_on_option` (optional, enumerated string)
    Indicates when the charge-item is to be charged. This parameter only applies to charge-items.
    Possible enum values:
      - `immediately`
        The item is charged immediately on being added to the subscription.
      - `on_event`
        The item is charged at the occurrence of the event specified as `charge_on_event` .
  - `start_date` (optional, timestamp(UTC) in seconds)
    Specifies the start date for the item price in the subscription. The period of the item price, determined by the `start_date` and `end_date`, specifies the [ramp](/docs/api/quoted_ramps) it belongs to.
    
    **Note**
    
    The parameter applies only when Chargebee CPQ is enabled. To request access, contact [Chargebee Support](https://www.chargebee.com/docs/billing/2.0/kb/getting-started/how-to-contact-chargebees-support-team?utm_source=docs_api&utm_medium=content&utm_campaign=support).
  - `end_date` (optional, timestamp(UTC) in seconds)
    Specifies the end date for the item price in the subscription. The period of the item price, determined by the `start_date` and `end_date`, specifies the [ramp](/docs/api/quoted_ramps) it belongs to.
    
    **Note**
    
    The parameter applies only when Chargebee CPQ is enabled. To request access, contact [Chargebee Support](https://www.chargebee.com/docs/billing/2.0/kb/getting-started/how-to-contact-chargebees-support-team?utm_source=docs_api&utm_medium=content&utm_campaign=support).
  - `ramp_tier_id` (optional, string, max chars=105)
    The index or identifier of the [ramp](/docs/api/quoted_ramps) to which the item price belongs. Use this index to map `item_tier` values to the correct ramp, as the target `item_price` of an `item_tier` may be part of multiple ramps.
    
    **Note**
    
    The parameter applies only when Chargebee CPQ is enabled. To request access, contact [Chargebee Support](https://www.chargebee.com/docs/billing/2.0/kb/getting-started/how-to-contact-chargebees-support-team?utm_source=docs_api&utm_medium=content&utm_campaign=support).

- `discounts` (optional, array)
  Parameters for discounts
  - `apply_on` (optional, enumerated string)
    The amount on the quote to which the discount is applied.
    Possible enum values:
      - `invoice_amount`
        The discount is applied to the invoice `sub_total` .
      - `specific_item_price`
        The discount is applied to the `invoice.line_item.amount` that corresponds to the item price specified by `item_price_id` .
  - `duration_type` (required, enumerated string)
    Specifies the time duration for which this discount is attached to the subscription.
    Possible enum values:
      - `one_time`
        The discount stays attached to the subscription till it is applied on an invoice **once**. It is removed after that from the subscription.
      - `forever`
        The discount is attached to the subscription and applied on the invoices till it is [explicitly removed](/docs/api/subscriptions/update-subscription-for-items#discounts_operation_type) .
      - `limited_period`
        The discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by `period` and `period_unit` .
  - `percentage` (optional, double)
    The percentage of the original amount that should be deducted from it.
  - `amount` (optional, in cents)
    The value of the discount. [The format of this value](/docs/api/currencies) depends on the kind of currency.
  - `period` (optional, integer)
    The duration of time for which the discount is attached to the subscription, in `period_units`. Applicable only when `duration_type` is `limited_period`.
  - `period_unit` (optional, enumerated string)
    The unit of time for `period`. Applicable only when `duration_type` is `limited_period`.
    Possible enum values:
      - `day`
        A period of 24 hours.
      - `week`
        A period of 7 days.
      - `month`
        A period of 1 calendar month.
      - `year`
        A period of 1 calendar year.
  - `included_in_mrr` (optional, boolean)
    The discount is included in MRR calculations for your site. This attribute is only applicable when `duration_type` is `one_time` and when the [feature is enabled](https://www.chargebee.com/docs/reporting.html#dashboards_flexible-mrr-calculation) in Chargebee. Also, If the [site-level setting](https://www.chargebee.com/docs/reporting.html#chart_flexible-mrr-calculation) is to exclude one-time discounts from MRR calculations, this value is always returned `false`.
  - `item_price_id` (optional, string, max chars=100)
    The [id of the item price](/docs/api/subscriptions/subscription-object#subscription_items_item_price_id) in the subscription to which the discount is to be applied. Relevant only when `apply_on` = `specific_item_price`.
  - `quantity` (optional, integer)
    Specifies the number of free units provided for the item, without affecting the total quantity sold
  - `start_date` (optional, timestamp(UTC) in seconds)
    Specifies the start date for the discount. The period of the discount, as specified by the `start_date` and `end_date` determines the [ramp(s)](/docs/api/quoted_ramps) it will be part of.
    
    **Note**
    
    The parameter applies only when Chargebee CPQ is enabled. To request access, contact [Chargebee Support](https://www.chargebee.com/docs/billing/2.0/kb/getting-started/how-to-contact-chargebees-support-team?utm_source=docs_api&utm_medium=content&utm_campaign=support).
  - `end_date` (optional, timestamp(UTC) in seconds)
    Specifies the end date for the discount. The period of the discount, as specified by the `start_date` and `end_date` determines the [ramp(s)](/docs/api/quoted_ramps) it will be part of.
    
    **Note**
    
    The parameter applies only when Chargebee CPQ is enabled. To request access, contact [Chargebee Support](https://www.chargebee.com/docs/billing/2.0/kb/getting-started/how-to-contact-chargebees-support-team?utm_source=docs_api&utm_medium=content&utm_campaign=support).

- `item_tiers` (optional, array)
  Parameters for item\_tiers
  - `item_price_id` (optional, string, max chars=100)
    The id of the item price for which the tier price is being overridden.
  - `starting_unit` (optional, integer)
    The lowest value in the quantity tier.
  - `ending_unit` (optional, integer)
    The highest value in the quantity tier.
  - `price` (optional, in cents)
    The overridden price of the tier. The value depends on the [type of currency](/docs/api/quotes) .
  - `starting_unit_in_decimal` (optional, string, max chars=33)
    The decimal representation of the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as `ending_unit_in_decimal` of the next lower tier. Returned only when the pricing\_model is `tiered` , `volume` or `stairstep` and [multi-decimal pricing](/docs/api/getting-started) is enabled.
  - `ending_unit_in_decimal` (optional, string, max chars=33)
    The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the `starting_unit_in_decimal` of the next higher tier. Returned only when the pricing\_model is `tiered` , `volume` or `stairstep` and [multi-decimal pricing](/docs/api/getting-started) is enabled.
  - `price_in_decimal` (optional, string, max chars=39)
    The decimal representation of the per-unit price for the tier when the `pricing_model` is `tiered` or `volume`. When the `pricing_model` is `stairstep` , it is the decimal representation of the total price for the item. The value is in major units of the currency. Returned when the plan is quantity-based and [multi-decimal pricing](/docs/api/getting-started) is enabled.
  - `pricing_type` (optional, enumerated string)
    Pricing type for the tier.
    Possible enum values:
      - `per_unit`
        Indicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).
      - `flat_fee`
        Indicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the **stairstep** pricing model, `pricing_type` will be set to `flat_fee` by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.
      - `package`
        Indicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).
  - `package_size` (optional, integer)
    Package size for the tier when pricing type is `package`. Specify the number of units that make up one package. For example, if 1000 API hits are grouped into a single package, set the package size to 1000.
  - `ramp_tier_id` (optional, string, max chars=105)
    The index or identifier of the [ramp](/docs/api/quoted_ramps) to which this tier information belongs. This must be a value from the `subscription_items[ramp_tier_id][i]`. Since an item price can be part of multiple subscriptions ramps, this group ID specifies the ramp to which this tier information belongs.
    
    **Note**
    
    The parameter applies only when Chargebee CPQ is enabled. To request access, contact [Chargebee Support](https://www.chargebee.com/docs/billing/2.0/kb/getting-started/how-to-contact-chargebees-support-team?utm_source=docs_api&utm_medium=content&utm_campaign=support).

- `coupons` (optional, array)
  - `id` (optional, string, max chars=100)
    The [ID](/docs/api/coupons/coupon-object#id) of the coupon to be applied. [Coupon codes](/docs/api/coupon_codes) are not supported.
    
    **Note**
    
    The parameter applies only when Chargebee CPQ is enabled. To request access, contact [Chargebee Support](https://www.chargebee.com/docs/billing/2.0/kb/getting-started/how-to-contact-chargebees-support-team?utm_source=docs_api&utm_medium=content&utm_campaign=support).
  - `start_date` (optional, timestamp(UTC) in seconds)
    Specifies the start date for the coupon. The period of the coupon, as specified by the `start_date` and `end_date` determines the [ramp(s)](/docs/api/quoted_ramps) it will be part of.
    
    **Note**
    
    The parameter applies only when Chargebee CPQ is enabled. To request access, contact [Chargebee Support](https://www.chargebee.com/docs/billing/2.0/kb/getting-started/how-to-contact-chargebees-support-team?utm_source=docs_api&utm_medium=content&utm_campaign=support).
  - `end_date` (optional, timestamp(UTC) in seconds)
    Specifies the end date for the coupon. The period of the coupon, as specified by the `start_date` and `end_date` determines the [ramp(s)](/docs/api/quoted_ramps) it will be part of.
    
    **Note**
    
    The parameter applies only when Chargebee CPQ is enabled. To request access, contact [Chargebee Support](https://www.chargebee.com/docs/billing/2.0/kb/getting-started/how-to-contact-chargebees-support-team?utm_source=docs_api&utm_medium=content&utm_campaign=support).

- `entitlement_overrides` (optional, array)
  The set of entitlement overrides to apply on this quote. Each entry targets a feature for an entity on the quote. Overrides are always upserted.
  - `feature_id` (optional, string, max chars=50)
    The `id` of the `feature` for which the entitlement override is being set.
  - `entity_id` (optional, string, max chars=100)
    The `id` of the entity on the quote (for example, a `plan_price`, `addon_price`, or `charge_price` handle from the quote context) whose entitlement is being overridden.
  - `entity_type` (optional, enumerated string)
    The type of the entity on the quote for which the entitlement override is being set.
    Possible enum values:
      - `plan_price`
        Indicates that the entity is an `item_price` with [`item_type`](/docs/api/item_prices/item-price-object#item_type) set to `plan`.
      - `addon_price`
        Indicates that the entity is an `item_price` with [`item_type`](/docs/api/item_prices/item-price-object#item_type) set to `addon`.
      - `charge_price`
        Indicates that the entity is an `item_price` with [`item_type`](/docs/api/item_prices/item-price-object#item_type) set to `charge`.
  - `value` (optional, string, max chars=50)
    The level of entitlement that the item has towards the feature. The possible values depend on the value of `feature.type` :
    
    -   When `feature.type` is `custom`: The value can be any one of `levels[].value`.
        
    -   When `feature.type` is `switch`: This value is `true` when the feature is available; it is `false` when the feature is unavailable.
        
    -   When `feature.type` is `quantity`:
        
    -   When `levels[].is_unlimited` is not `true`: The value can be any one of `levels[].value`.
        
    -   When `levels[].is_unlimited` is `true`: The value can also be any one of `levels[].value` or it can be `unlimited` (case-insensitive), indicating unlimited entitlement.
        
    -   When `feature.type` is `range`:
        
    -   When `levels[].is_unlimited` is not `true`: The value can be any whole number between `levels[0].value` and `levels[1].value` (inclusive).
        
    -   When `levels[].is_unlimited` is `true`: The value can be any whole number equal to or greater than `levels[0].value` or it can be `unlimited` (case-insensitive), indicating unlimited entitlement.
  - `is_enabled` (optional, boolean)
    Specifies whether the entitlement for the feature is enabled (`true`) or disabled (`false`) for the entity on the quote.
  - `start_date` (optional, timestamp(UTC) in seconds)
    Start date (UTC timestamp) of the entitlement override for the item on the quote. Used with `end_date` for ramp-scoped entitlements.
  - `end_date` (optional, timestamp(UTC) in seconds)
    End date (UTC timestamp) of the entitlement override for the item on the quote. Used with `start_date` for ramp-scoped entitlements.

## Returns

- `quote` (Quote object)
  Resource object representing quote

- `quoted_subscription` (Quoted subscription object)
  Resource object representing quoted\_subscription

- `quoted_ramp` (Quoted ramp object)
  Resource object representing quoted\_ramp
