# Create subscription estimate

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


Generates an estimate for the 'create subscription' operation. This is similar to the [Create Subscription](/docs/api/v2/pcv-1/subscriptions/create-a-subscription) API but no subscription will be created, only an estimate for this operation is created.

In the response,

-   **estimate.subscription\_estimate** has the subscription details like the status of the subscription (in\_trial, active, etc.), next billing date, and so on.
    
-   **estimate.invoice\_estimate** has details of the invoice that will be generated immediately. This will not be present if no immediate invoice is generated for this operation.
    

**estimate.next\_invoice\_estimate** has details of the invoice that will be generated on the next billing date of this subscription. This will be present only if no immediate invoice is generated during this operation and this subscription has next billing.

If the subscription is created in **trial/future** states, _estimate.invoice\_estimate_ will not be present as no immediate invoice would be generated. However, _estimate.next\_invoice\_estimate_ will be returned which is a preview of the invoice that would be generated at a later date when the subscription becomes 'active'.

-   **estimate.unbilled\_charge\_estimates** has details of the unbilled charges. This is returned only if _invoice\_immediately_ is set as false. But this is not applicable for the 'Subscription renewal estimate' operation.

**Tip**

Set the `customer[taxability]` attribute as `true` and provide any other necessary parameters to compute taxes. Otherwise tax is exempted for the estimate.

#### Related Tutorial[](#related-tutorial)

-   [Check out this tutorial for when and how to use create subscription estimate API](https://www.chargebee.com/tutorials/in-app-checkout-page-using-estimate-api-example.html)

## Sample Request

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/estimates/create_subscription \
     -u {site_api_key}:\
     -d "subscription[plan_id]"="no_trial" \
     -d "billing_address[line1]"="PO Box 9999" \
     -d "billing_address[city]"="Walnut" \
     -d "billing_address[zip]"="91789" \
     -d "billing_address[country]"="US"
```

#### .NET

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

ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = Estimate.CreateSubscription()
		.SubscriptionPlanId("no_trial")
		.BillingAddressLine1("PO Box 9999")
		.BillingAddressCity("Walnut")
		.BillingAddressZip("91789")
		.BillingAddressCountry("US")
		.Request();

Estimate estimate = result.Estimate;
```

#### Go

```go
package main
import (
    "fmt"
    "github.com/chargebee/chargebee-go/v3"
    estimateAction "github.com/chargebee/chargebee-go/v3/actions/estimate"
    "github.com/chargebee/chargebee-go/v3/models/estimate"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := estimateAction.CreateSubscription(&estimate.CreateSubscriptionRequestParams{
        Subscription : &estimate.CreateSubscriptionSubscriptionParams{
            PlanId : "no_trial",
        },
        BillingAddress : &estimate.CreateSubscriptionBillingAddressParams{
            Line1 : "PO Box 9999",
            City : "Walnut",
            Zip : "91789",
            Country : "US",
        },
    }).Request()
    if err != nil {
        fmt.Println(err)
    } else {
        Estimate := res.Estimate
    }
}
```

#### 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.EstimateCreateSubscriptionRequest{
    Subscription : &chargebee.EstimateCreateSubscriptionSubscription{
        PlanId : "no_trial",
    },
    BillingAddress : &chargebee.EstimateCreateSubscriptionBillingAddress{
        Line1 : "PO Box 9999",
        City : "Walnut",
        Zip : "91789",
        Country : "US",
    },
}
  res, err := client.Estimate.CreateSubscription(req)
      if err != nil {
        fmt.Println(err)
    } else {
        Estimate := res.Estimate
    }
}
```

#### 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 = Estimate.createSubscription()
            .subscriptionPlanId("no_trial")
            .billingAddressLine1("PO Box 9999")
            .billingAddressCity("Walnut")
            .billingAddressZip("91789")
            .billingAddressCountry("US")
            .request();

        Estimate estimate = result.estimate();
    }
}
```

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.estimate.Estimate;
import com.chargebee.v4.models.estimate.params.EstimateCreateSubscriptionParams;
import com.chargebee.v4.models.estimate.responses.EstimateCreateSubscriptionResponse;

public class EstimateCreateSubscription {

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

        EstimateCreateSubscriptionParams.SubscriptionParams subscriptionParams =
            EstimateCreateSubscriptionParams.SubscriptionParams.builder()
                .planId("no_trial")
                .build();

        EstimateCreateSubscriptionParams.BillingAddressParams billingAddressParams =
            EstimateCreateSubscriptionParams.BillingAddressParams.builder()
                .line1("PO Box 9999")
                .city("Walnut")
                .zip("91789")
                .country("US")
                .build();

        EstimateCreateSubscriptionParams params = EstimateCreateSubscriptionParams.builder()
            .subscription(subscriptionParams)
            .billingAddress(billingAddressParams)
            .build();

        EstimateCreateSubscriptionResponse response = client.estimates().createSubscription(params);

        Estimate estimate = response.getEstimate();
    }
}
```

#### Node.js

```node
import Chargebee from "chargebee";

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

try {
    const result = await chargebee.estimate.createSubscription({
        subscription: {
            plan_id: "no_trial"
        },
        billing_address: {
            line1: "PO Box 9999",
            city: "Walnut",
            zip: 91789,
            country: "US"
        }
    });

    console.log(result);
    const estimate = result.estimate;
} 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->estimate()->createSubscription([
    "subscription" => [
        "plan_id" => "no_trial"
    ],
    "billing_address" => [
        "line1" => "PO Box 9999",
        "city" => "Walnut",
        "zip" => "91789",
        "country" => "US"
    ]
]);
$estimate = $result->estimate;
```

#### Python

```python
from chargebee import Chargebee

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
response = cb_client.Estimate.create_subscription(
    cb_client.Estimate.CreateSubscriptionParams(
        subscription=cb_client.Estimate.CreateSubscriptionSubscriptionParams(
            plan_id="no_trial"
        ),
        billing_address=cb_client.Estimate.CreateSubscriptionBillingAddressParams(
            line1="PO Box 9999",
            city="Walnut",
            zip="91789",
            country="US"
        )
    )
)
estimate = response.estimate
```

#### Ruby

```ruby
require 'chargebee'

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

result = ChargeBee::Estimate.create_subscription({
  :subscription => {
    :plan_id => "no_trial"
  },
  :billing_address => {
    :line1 => "PO Box 9999",
    :city => "Walnut",
    :zip => "91789",
    :country => "US"
  }
})

estimate = result.estimate
```

## Sample Response

```json
{
  "estimate": {
    "created_at": 1517505710,
    "invoice_estimate": {
      "amount_due": 895,
      "amount_paid": 0,
      "credits_applied": 0,
      "currency_code": "USD",
      "customer_id": "__test__KyVnHhSBWl2E82aS",
      "date": 1517505710,
      "line_item_discounts": {},
      "line_item_taxes": {},
      "line_items": [
        {
          "amount": 895,
          "customer_id": "__test__KyVnHhSBWl2E82aS",
          "date_from": 1517505710,
          "date_to": 1519924910,
          "description": "No Trial",
          "discount_amount": 0,
          "entity_id": "no_trial",
          "entity_type": "plan",
          "id": "li___test__KyVnHhSBWl2Eq2aU",
          "is_taxed": false,
          "item_level_discount_amount": 0,
          "object": "line_item",
          "pricing_model": "per_unit",
          "quantity": 1,
          "tax_amount": 0,
          "unit_amount": 895
        },
        {..}
      ],
      "object": "invoice_estimate",
      "price_type": "tax_exclusive",
      "recurring": true,
      "round_off_amount": 0,
      "sub_total": 895,
      "taxes": {},
      "total": 895
    },
    "object": "estimate",
    "subscription_estimate": {
      "currency_code": "USD",
      "next_billing_at": 1519924910,
      "object": "subscription_estimate",
      "status": "active"
    }
  }
}
```

## URL Format

**POST** https://[site].chargebee.com/api/v2/estimates/create_subscription

## Input Parameters

- `billing_cycles` (optional, integer, min=0)
  Number of cycles(plan interval) this subscription should be charged. After the billing cycles exhausted, the subscription will be cancelled.

- `mandatory_addons_to_remove` (optional, string, max chars=100)
  List of addons IDs that are mandatory to the plan and has 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)
  List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.

- `invoice_immediately` (optional, boolean)
  If there are charges raised immediately for the subscription, this parameter specifies whether those charges are to be invoiced immediately or added to [unbilled charges](https://www.chargebee.com/docs/unbilled-charges.html). The default value is as per the [site settings](https://www.chargebee.com/docs/unbilled-charges.html#configuration) .
  
  **Note:** `invoice_immediately` only affects charges that are raised at the time of execution of this API call. Any charges scheduled to be raised in the future are not affected by this parameter.
  
  .

- `invoice_date` (optional, timestamp(UTC) in seconds)
  The document date displayed on the invoice PDF. By default, it is the date of creation of the invoice or, when Metered Billing is enabled, it can be the date of closing the invoice. Provide this value to backdate the invoice (set the invoice date to a value in the past). Backdating an invoice is done for reasons such as booking revenue for a previous date or when the non-recurring charge is effective as of a past date. `taxes` and `line_item_taxes` are computed based on the tax configuration as of this date. The date should not be more than one calendar month into the past. For example, if today is 13th January, then you cannot pass a value that is earlier than 13th December.

- `client_profile_id` (optional, string, max chars=50)
  Indicates the Client profile id for the customer. This is applicable only if you use [Chargebee's AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration.

- `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.
  - `plan_id` (required, string, max chars=100)
    Identifier of the plan for this subscription
  - `plan_quantity` (optional, integer, default=1, min=1)
    Plan quantity for this subscription
  - `plan_quantity_in_decimal` (optional, string, max chars=33)
    The decimal representation of the quantity of the plan purchased. Can be provided for quantity-based plans and only when [multi-decimal pricing](/docs/api/v2/pcv-1/currencies) is enabled.
  - `plan_unit_price` (optional, in cents, min=0)
    Amount that will override the Plan's default price. The unit depends on the [type of currency](/docs/api/getting-started) .
  - `plan_unit_price_in_decimal` (optional, string, max chars=39)
    When [price overriding](http://chargebee.com/docs/price-override.html ) is enabled for the site, the price or per-unit price of the plan can be set here. The value [set for the plan](/docs/api/v2/pcv-1/plans/plan-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/v2/pcv-1/currencies) is enabled.
  - `setup_fee` (optional, in cents, min=0)
    Amount that will override the default setup fee. The unit depends on the [type of currency](/docs/api/getting-started) .
  - `trial_end` (optional, timestamp(UTC) in seconds)
    The time at which the trial ends for this subscription. Can be specified to override the default trial period.If **'0'** is passed, the subscription will be activated immediately.
  - `start_date` (optional, timestamp(UTC) in seconds)
    The date/time at which the subscription is to start. If not provided, the subscription starts immediately. You can provide a value in the past as well. This is called backdating the subscription creation and is done when the subscription has already been provisioned but its billing 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, `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
  - `free_period` (optional, integer, min=1)
    The period of time by which the first term of the subscription is to be extended free-of-charge. The value must be in multiples of free\_period\_unit.
  - `free_period_unit` (optional, enumerated string)
    The unit of time in multiples of which the free\_period parameter is expressed. The value must be equal to or lower than the [period\_unit](/docs/api/v2/pcv-1/plans/create-a-plan#period_unit) attribute of the [plan](/docs/api/v2/pcv-1/subscriptions/create-a-subscription#plan_id) chosen.
    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)
  - `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) .
  - `trial_end_action` (optional, enumerated string)
    Applicable only when [End-of-trial Action](https://www.chargebee.com/docs/1.0/trial_periods_hidden.html#how-to-define-the-end-of-trial-actions-for-subscriptions) has been enabled for the site. Whenever the subscription has a trial period, this attribute (parameter) is returned (required) and specifies the operation to be carried out for the subscription once the trial ends.
    Possible enum values:
      - `site_default`
        This is the default value. The action [configured for the site](https://www.chargebee.com/docs/1.0/trial_periods_hidden.html#how-to-define-the-end-of-trial-actions-for-subscriptions) at the time when the trial ends, takes effect.
      - `plan_default`
        The action [configured for the site](https://www.chargebee.com/docs/1.0/trial_periods_hidden.html#how-to-define-the-end-of-trial-actions-for-subscriptions) at the time when the trial ends, takes effect.
      - `activate_subscription`
        The subscription activates and charges are raised for non-metered items.
      - `cancel_subscription`
        The subscription cancels.

- `billing_address` (optional, string)
  Parameters for billing\_address
  - `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 and India. 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` ).
  - `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.

- `shipping_address` (optional, string)
  Parameters for shipping\_address
  - `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 and India. 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` ).
  - `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.

- `customer` (optional, string)
  Parameters for customer
  - `vat_number` (optional, string, max chars=20)
    VAT number of this customer. If not provided then taxes are not calculated for the estimate. Applicable only when taxes are configured for the EU or UK region. VAT validation is not done for this.
  - `vat_number_prefix` (optional, string, max chars=10)
    An overridden value for the first two characters of the [full VAT number](https://en.wikipedia.org/wiki/VAT_identification_number). Only applicable specifically for customers with `[billing_address](/docs/api/customers/customer-object#billing_address)`
    
    `country` as `XI` (which is **United Kingdom - Northern Ireland** ).
    
    When you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or have [manually enabled](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, you have the option of setting `[billing_address](/docs/api/customers/customer-object#billing_address)`
    
    `country` as `XI`. That's the code for **United Kingdom - Northern Ireland**. The first two characters of the VAT number in such a case is `XI` by default. However, if the VAT number was registered in UK, the value should be `GB`. Set `vat_number_prefix` to `GB` for such cases.
  - `registered_for_gst` (optional, boolean)
    Confirms that a customer is registered under GST. If set to `true` then the [Reverse Charge Mechanism](https://www.chargebee.com/docs/australian-gst.html#reverse-charge-mechanism) is applicable. This field is applicable only when Australian GST is configured for your site.
  - `taxability` (optional, enumerated string, default=taxable)
    Specifies if the customer is liable for tax
    Possible enum values:
      - `taxable`
        Computes tax for the customer based on the [site configuration](https://www.chargebee.com/docs/tax.html). In some cases, depending on the region, shipping\_address is needed. If not provided, then billing\_address is used to compute tax. If that's not available either, the tax is taken as zero.
      - `exempt`
        -   Customer is exempted from tax. When using Chargebee's native [Taxes](https://www.chargebee.com/docs/tax.html) feature or when using the [TaxJar integration](https://www.chargebee.com/docs/taxjar.html), no other action is needed.
        -   However, when using our [Avalara integration](https://www.chargebee.com/docs/avalara.html), optionally, specify `entity_code` or `exempt_number` attributes if you use Chargebee's [AvaTax for Sales](https://www.chargebee.com/docs/avalara.html#configuring-tax-exemption) or specify `exemption_details` attribute if you use [Chargebee's AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration. Tax may still be applied by Avalara for certain values of `entity_code`/`exempt_number`/`exemption_details` based on the state/region/province of the taxable address.
  - `entity_code` (optional, enumerated string)
    The exemption category of the customer, for USA and Canada. Applicable if you use Chargebee's [AvaTax for Sales integration](https://www.chargebee.com/docs/avalara.html#configuring-tax-exemption) .
    Possible enum values:
      - `a`
        Federal government
      - `b`
        State government
      - `c`
        Tribe/Status Indian/Indian Band
      - `d`
        Foreign diplomat
      - `e`
        Charitable or benevolent organization
      - `f`
        Religious organization
      - `g`
        Resale
      - `h`
        Commercial agricultural production
      - `i`
        Industrial production/manufacturer
      - `j`
        Direct pay permit
      - `k`
        Direct mail
      - `l`
        Other or custom
      - `m`
        Educational organization
      - `n`
        Local government
      - `p`
        Commercial aquaculture
      - `q`
        Commercial Fishery
      - `r`
        Non-resident
      - `med1`
        US Medical Device Excise Tax with exempt sales tax
      - `med2`
        US Medical Device Excise Tax with taxable sales tax
  - `exempt_number` (optional, string, max chars=100)
    Any string value that will cause the sale to be exempted. Use this if your finance team manually verifies and tracks exemption certificates. Applicable if you use Chargebee's [AvaTax for Sales integration](https://www.chargebee.com/docs/avalara.html#configuring-tax-exemption) .
  - `exemption_details` (optional)
    Indicates the exemption information. You can customize customer exemption based on specific Location, Tax level (Federal, State, County and Local), Category of Tax or specific Tax Name. This is applicable only if you use [Chargebee's AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration. To know more about what values you need to provide, refer to this [Avalara's API document](https://developer.avalara.com/communications/dev-guide_rest_v2/customizing-transactions/sample-transactions/exemption/) .
  - `customer_type` (optional, enumerated string)
    Indicates the type of the customer. This is applicable only if you use [Chargebee's AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration.
    Possible enum values:
      - `residential`
        When the purchase is made by a customer for home use
      - `business`
        When the purchase is made at a place of business
      - `senior_citizen`
        When the purchase is made by a customer who meets the jurisdiction requirements to be considered a senior citizen and qualifies for senior citizen tax breaks
      - `industrial`
        When the purchase is made by an industrial business

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

- `addons` (optional, array)
  Parameters for addons
  - `id` (optional, string, max chars=100)
    Identifier of the addon. Multiple addons can be passed.
  - `quantity` (optional, integer)
    Quantity of the addon. Applicable for addons with `pricing_model` other than `flat_fee` .
  - `quantity_in_decimal` (optional, string, max chars=33)
    The decimal representation of the quantity of the addon. Can be provided for quantity-based addons and only when [multi-decimal pricing](/docs/api/v2/pcv-1/currencies) is enabled.
  - `unit_price` (optional, in cents)
    The price or per-unit-price of the addon. The value depends on the [type of currency](/docs/api/getting-started).
    
    **Note:**
    
    For recurring addons, this is the final price or per-unit price for each billing period of the subscription, regardless of the [addon period](/docs/api/v2/pcv-1/addons/addon-object#period). For example, consider the following details:
    
    -   The `unit_price` provided is $10
    -   The addon billing period is 1 month.
    -   The plan billing period is 3 months.
    -   The addon is only billed for $10 on each subscription renewal.
  - `unit_price_in_decimal` (optional, string, max chars=39)
    When [price overriding](http://chargebee.com/docs/price-override.html ) is enabled for the site, the price or per-unit price of the addon can be set here. The value [set for the addon](/docs/api/v2/pcv-1/addons/addon-object#price) is used by default. However, the price provided here is considered as the price of the addon for an entire billing cycle of the subscription regardless of the value of the addon `period`. Provide the value as a decimal string in major units of the currency. Can be provided only when [multi-decimal pricing](/docs/api/v2/pcv-1/currencies) is enabled.
  - `billing_cycles` (optional, integer)
    Number of billing cycles the addon will be charged for. When not set, the addon is attached to the subscription for an indefinite number of billing cycles. While updating a subscription to a plan with a different billing period, set this parameter again or its value will be lost. And so, the addon will be attached indefinitely.
  - `trial_end` (optional, timestamp(UTC) in seconds)
    The time at which the trial ends for the addon. This value can only be set for subscriptions that start with an `active` or `non-renewing` status. Once set, the value can't be changed. (Addon trial periods must be enabled by [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) )

- `event_based_addons` (optional, array)
  Parameters for event\_based\_addons
  - `id` (optional, string, max chars=100)
    A unique 'id' used to identify the addon.
  - `quantity` (optional, integer)
    Quantity of the addon. Applicable for addons with `pricing_model` other than `flat_fee` .
  - `unit_price` (optional, in cents)
    Amount that will override the Addon's default price. The unit depends on the [type of currency](/docs/api/getting-started) .
  - `quantity_in_decimal` (optional, string, max chars=33)
    The decimal representation of the quantity of the addon. Can be provided for quantity-based addons and only when [multi-decimal pricing](/docs/api/v2/pcv-1/currencies) is enabled.
  - `unit_price_in_decimal` (optional, string, max chars=39)
    When [price overriding](http://chargebee.com/docs/price-override.html ) is enabled for the site, the price or per-unit price of the addon can be set here. The value [set for the addon](/docs/api/v2/pcv-1/addons/addon-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/v2/pcv-1/currencies) is enabled.
  - `service_period_in_days` (optional, integer)
    Defines service period of the addon in days from the day of charge.
  - `on_event` (optional, enumerated string)
    Event on which this addon will be charged.
    Possible enum values:
      - `subscription_creation`
        Addon will be charged on subscription creation.
      - `subscription_trial_start`
        Addon will be charged when the trial period starts.
      - `plan_activation`
        Addon will be charged on plan activation.
      - `subscription_activation`
        Addon will be charged on subscription activation.
      - `contract_termination`
        Addon will be charged on contract termination.
  - `charge_once` (optional, boolean)
    If enabled, the addon will be charged only at the first occurrence of the event. Applicable only for non-recurring add-ons.
  - `charge_on` (optional, enumerated string)
    Indicates when the non-recurring addon will be charged.
    Possible enum values:
      - `immediately`
        Charges for the addon will be applied immediately.
      - `on_event`
        Charge for the addon will be applied on the occurrence of a specified event.

- `tax_providers_fields` (optional, array)
  Parameters for tax\_providers\_fields
  - `provider_name` (optional, string, max chars=50)
    Name of the tax provider.
  - `field_id` (optional, string, max chars=50)
    Field id of the attribute which tax vendor has provided while getting onboarded with Chargebee.
  - `field_value` (optional, string, max chars=50)
    The value of the related tax field

## Returns

- `estimate` (Estimate object)
  Resource object representing estimate
