# Create an item price

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


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

This API creates an item price (a price point) for an [item](/docs/api/items).

## Sample Request

### Default

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/item_prices \
     -u {site_api_key}:\
     -d id="silver-USD-monthly" \
     -d item_id="silver" \
     -d name="silver USD monthly" \
     -d pricing_model="PER_UNIT" \
     -d price=1000 \
     -d currency_code="USD" \
     -d external_name="silver USD" \
     -d period_unit="MONTH" \
     -d period=1
```

#### .NET

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

ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = ItemPrice.Create()
		.Id("silver-USD-monthly")
		.ItemId("silver")
		.Name("silver USD monthly")
		.PricingModel(PricingModelEnum.PerUnit)
		.Price(1000)
		.CurrencyCode("USD")
		.ExternalName("silver USD")
		.PeriodUnit(ItemPrice.PeriodUnitEnum.Month)
		.Period(1)
		.Request();

ItemPrice itemPrice = result.ItemPrice;
```

#### Go

```go
package main
import (
    "fmt"
    "github.com/chargebee/chargebee-go/v3"
    itempriceAction "github.com/chargebee/chargebee-go/v3/actions/itemprice"
    "github.com/chargebee/chargebee-go/v3/models/itemprice"
    enum "github.com/chargebee/chargebee-go/v3/enum"
    itemPriceEnum "github.com/chargebee/chargebee-go/v3/models/itemprice/enum"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := itempriceAction.Create(&itemprice.CreateRequestParams{
        Id : "silver-USD-monthly",
        ItemId : "silver",
        Name : "silver USD monthly",
        PricingModel : enum.PricingModelPerUnit,
        Price : chargebee.Int64(1000),
        CurrencyCode : "USD",
        ExternalName : "silver USD",
        PeriodUnit : itemPriceEnum.PeriodUnitMonth,
        Period : chargebee.Int32(1),
    }).Request()
    if err != nil {
        fmt.Println(err)
    } else {
        ItemPrice := res.ItemPrice
    }
}
```

#### 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.ItemPriceCreateRequest{
    Id : "silver-USD-monthly",
    ItemId : "silver",
    Name : "silver USD monthly",
    PricingModel : chargebee.PricingModelPerUnit,
    Price : chargebee.Int64(1000),
    CurrencyCode : "USD",
    ExternalName : "silver USD",
    PeriodUnit : chargebee.ItemPricePeriodUnitMonth,
    Period : chargebee.Int32(1),
}
  res, err := client.ItemPrice.Create(req)
      if err != nil {
        fmt.Println(err)
    } else {
        ItemPrice := res.ItemPrice
    }
}
```

#### 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 = ItemPrice.create()
            .id("silver-USD-monthly")
            .itemId("silver")
            .name("silver USD monthly")
            .pricingModel(PricingModel.PER_UNIT)
            .price(1000L)
            .currencyCode("USD")
            .externalName("silver USD")
            .periodUnit(ItemPrice.PeriodUnit.MONTH)
            .period(1)
            .request();

        ItemPrice itemPrice = result.itemPrice();
    }
}
```

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.itemPrice.ItemPrice;
import com.chargebee.v4.models.itemPrice.params.ItemPriceCreateParams;
import com.chargebee.v4.models.itemPrice.responses.ItemPriceCreateResponse;

public class ItemPriceCreate {

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

        ItemPriceCreateParams params = ItemPriceCreateParams.builder()
            .id("silver-USD-monthly")
            .itemId("silver")
            .name("silver USD monthly")
            .pricingModel(ItemPriceCreateParams.PricingModel.PER_UNIT)
            .price(1000L)
            .currencyCode("USD")
            .externalName("silver USD")
            .periodUnit(ItemPriceCreateParams.PeriodUnit.MONTH)
            .period(1)
            .build();

        ItemPriceCreateResponse response = client.itemPrices().create(params);

        ItemPrice itemPrice = response.getItemPrice();
    }
}
```

#### Node.js

```node
import Chargebee from "chargebee";

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

try {
    const result = await chargebee.itemPrice.create({
        id: "silver-USD-monthly",
        item_id: "silver",
        name: "silver USD monthly",
        pricing_model: "per_unit",
        price: 1000,
        currency_code: "USD",
        external_name: "silver USD",
        period_unit: "month",
        period: 1
    });

    console.log(result);
    const itemPrice = result.item_price;
} 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->itemPrice()->create([
    "id" => "silver-USD-monthly",
    "item_id" => "silver",
    "name" => "silver USD monthly",
    "pricing_model" => "per_unit",
    "price" => 1000,
    "currency_code" => "USD",
    "external_name" => "silver USD",
    "period_unit" => "month",
    "period" => 1
]);
$itemPrice = $result->item_price;
```

#### Python

```python
import chargebee
from chargebee import Chargebee

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
response = cb_client.ItemPrice.create(
    cb_client.ItemPrice.CreateParams(
        id="silver-USD-monthly",
        item_id="silver",
        name="silver USD monthly",
        pricing_model=chargebee.PricingModel.PER_UNIT,
        price=1000,
        currency_code="USD",
        external_name="silver USD",
        period_unit=chargebee.ItemPrice.PeriodUnit.MONTH,
        period=1
    )
)
item_price = response.item_price
```

#### Ruby

```ruby
require 'chargebee'

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

result = ChargeBee::ItemPrice.create({
  :id => "silver-USD-monthly",
  :item_id => "silver",
  :name => "silver USD monthly",
  :pricing_model => "PER_UNIT",
  :price => 1000,
  :currency_code => "USD",
  :external_name => "silver USD",
  :period_unit => "MONTH",
  :period => 1
})

item_price = result.item_price
```

### create an addon item price with tiered pricing model

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/item_prices \
     -u {site_api_key}:\
     -d id="day-pass-USD-monthly" \
     -d name="Day Pass USD Monthly" \
     -d item_id="day-pass" \
     -d period=1 \
     -d period_unit="MONTH" \
     -d pricing_model="TIERED" \
     -d currency_code="USD" \
     -d "tiers[starting_unit][0]"=1 \
     -d "tiers[ending_unit][0]"=10 \
     -d "tiers[price][0]"=100 \
     -d "tiers[starting_unit][1]"=11 \
     -d "tiers[ending_unit][1]"=20 \
     -d "tiers[price][1]"=300 \
     -d "tiers[starting_unit][2]"=21 \
     -d "tiers[price][2]"=500
```

#### .NET

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

ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = ItemPrice.Create()
		.Id("day-pass-USD-monthly")
		.Name("Day Pass USD Monthly")
		.ItemId("day-pass")
		.Period(1)
		.PeriodUnit(ItemPrice.PeriodUnitEnum.Month)
		.PricingModel(PricingModelEnum.Tiered)
		.CurrencyCode("USD")
		.TierStartingUnit(0, 1)
		.TierEndingUnit(0, 10)
		.TierPrice(0, 100)
		.TierStartingUnit(1, 11)
		.TierEndingUnit(1, 20)
		.TierPrice(1, 300)
		.TierStartingUnit(2, 21)
		.TierPrice(2, 500)
		.Request();

ItemPrice itemPrice = result.ItemPrice;
```

#### Go

```go
package main
import (
    "fmt"
    "github.com/chargebee/chargebee-go/v3"
    itempriceAction "github.com/chargebee/chargebee-go/v3/actions/itemprice"
    "github.com/chargebee/chargebee-go/v3/models/itemprice"
    itemPriceEnum "github.com/chargebee/chargebee-go/v3/models/itemprice/enum"
    enum "github.com/chargebee/chargebee-go/v3/enum"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := itempriceAction.Create(&itemprice.CreateRequestParams{
        Tiers : []*itemprice.CreateTierParams{
            {
                StartingUnit : chargebee.Int32(1),
                EndingUnit : chargebee.Int32(10),
                Price : chargebee.Int64(100),
            },
            {
                StartingUnit : chargebee.Int32(11),
                EndingUnit : chargebee.Int32(20),
                Price : chargebee.Int64(300),
            },
            {
                StartingUnit : chargebee.Int32(21),
                Price : chargebee.Int64(500),
            },
        },
        Id : "day-pass-USD-monthly",
        Name : "Day Pass USD Monthly",
        ItemId : "day-pass",
        Period : chargebee.Int32(1),
        PeriodUnit : itemPriceEnum.PeriodUnitMonth,
        PricingModel : enum.PricingModelTiered,
        CurrencyCode : "USD",
    }).Request()
    if err != nil {
        fmt.Println(err)
    } else {
        ItemPrice := res.ItemPrice
    }
}
```

#### 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.ItemPriceCreateRequest{
    Tiers : []*chargebee.ItemPriceCreateTier{
        {
            StartingUnit : chargebee.Int32(1),
            EndingUnit : chargebee.Int32(10),
            Price : chargebee.Int64(100),
        },
        {
            StartingUnit : chargebee.Int32(11),
            EndingUnit : chargebee.Int32(20),
            Price : chargebee.Int64(300),
        },
        {
            StartingUnit : chargebee.Int32(21),
            Price : chargebee.Int64(500),
        },
    },
    Id : "day-pass-USD-monthly",
    Name : "Day Pass USD Monthly",
    ItemId : "day-pass",
    Period : chargebee.Int32(1),
    PeriodUnit : chargebee.ItemPricePeriodUnitMonth,
    PricingModel : chargebee.PricingModelTiered,
    CurrencyCode : "USD",
}
  res, err := client.ItemPrice.Create(req)
      if err != nil {
        fmt.Println(err)
    } else {
        ItemPrice := res.ItemPrice
    }
}
```

#### 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 = ItemPrice.create()
            .id("day-pass-USD-monthly")
            .name("Day Pass USD Monthly")
            .itemId("day-pass")
            .period(1)
            .periodUnit(ItemPrice.PeriodUnit.MONTH)
            .pricingModel(PricingModel.TIERED)
            .currencyCode("USD")
            .tierStartingUnit(0, 1)
            .tierEndingUnit(0, 10)
            .tierPrice(0, 100L)
            .tierStartingUnit(1, 11)
            .tierEndingUnit(1, 20)
            .tierPrice(1, 300L)
            .tierStartingUnit(2, 21)
            .tierPrice(2, 500L)
            .request();

        ItemPrice itemPrice = result.itemPrice();
    }
}
```

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.itemPrice.ItemPrice;
import com.chargebee.v4.models.itemPrice.params.ItemPriceCreateParams;
import com.chargebee.v4.models.itemPrice.responses.ItemPriceCreateResponse;
import java.util.List;

public class ItemPriceCreate {

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

        ItemPriceCreateParams.TiersParams tier0 =
            ItemPriceCreateParams.TiersParams.builder()
                .startingUnit(1)
                .endingUnit(10)
                .price(100L)
                .build();

        ItemPriceCreateParams.TiersParams tier1 =
            ItemPriceCreateParams.TiersParams.builder()
                .startingUnit(11)
                .endingUnit(20)
                .price(300L)
                .build();

        ItemPriceCreateParams.TiersParams tier2 =
            ItemPriceCreateParams.TiersParams.builder()
                .startingUnit(21)
                .price(500L)
                .build();

        List<ItemPriceCreateParams.TiersParams> tiersList =
            List.of(tier0, tier1, tier2);

        ItemPriceCreateParams params = ItemPriceCreateParams.builder()
            .id("day-pass-USD-monthly")
            .name("Day Pass USD Monthly")
            .itemId("day-pass")
            .period(1)
            .periodUnit(ItemPriceCreateParams.PeriodUnit.MONTH)
            .pricingModel(ItemPriceCreateParams.PricingModel.TIERED)
            .currencyCode("USD")
            .tiers(tiersList)
            .build();

        ItemPriceCreateResponse response = client.itemPrices().create(params);

        ItemPrice itemPrice = response.getItemPrice();
    }
}
```

#### Node.js

```node
import Chargebee from "chargebee";

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

try {
    const result = await chargebee.itemPrice.create({
        tiers: [
            {
                starting_unit: 1,
                ending_unit: 10,
                price: 100
            },
            {
                starting_unit: 11,
                ending_unit: 20,
                price: 300
            },
            {
                starting_unit: 21,
                price: 500
            }
        ],
        id: "day-pass-USD-monthly",
        name: "Day Pass USD Monthly",
        item_id: "day-pass",
        period: 1,
        period_unit: "month",
        pricing_model: "tiered",
        currency_code: "USD"
    });

    console.log(result);
    const itemPrice = result.item_price;
} 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->itemPrice()->create([
    "tiers" => [
        [
            "starting_unit" => 1,
            "ending_unit" => 10,
            "price" => 100
        ],
        [
            "starting_unit" => 11,
            "ending_unit" => 20,
            "price" => 300
        ],
        [
            "starting_unit" => 21,
            "price" => 500
        ]
    ],
    "id" => "day-pass-USD-monthly",
    "name" => "Day Pass USD Monthly",
    "item_id" => "day-pass",
    "period" => 1,
    "period_unit" => "month",
    "pricing_model" => "tiered",
    "currency_code" => "USD"
]);
$itemPrice = $result->item_price;
```

#### Python

```python
import chargebee
from chargebee import Chargebee

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
response = cb_client.ItemPrice.create(
    cb_client.ItemPrice.CreateParams(
        tiers=[
            cb_client.ItemPrice.CreateTierParams(
              starting_unit=1,
              ending_unit=10,
              price=100
            ),
            cb_client.ItemPrice.CreateTierParams(
              starting_unit=11,
              ending_unit=20,
              price=300
            ),
            cb_client.ItemPrice.CreateTierParams(
              starting_unit=21,
              price=500
            )
        ],
        id="day-pass-USD-monthly",
        name="Day Pass USD Monthly",
        item_id="day-pass",
        period=1,
        period_unit=chargebee.ItemPrice.PeriodUnit.MONTH,
        pricing_model=chargebee.PricingModel.TIERED,
        currency_code="USD"
    )
)
item_price = response.item_price
```

#### Ruby

```ruby
require 'chargebee'

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

result = ChargeBee::ItemPrice.create({
  :id => "day-pass-USD-monthly",
  :name => "Day Pass USD Monthly",
  :item_id => "day-pass",
  :period => 1,
  :period_unit => "MONTH",
  :pricing_model => "TIERED",
  :currency_code => "USD",
  :tiers => [
    {
      :starting_unit => 1,
      :ending_unit => 10,
      :price => 100
    },
    {
      :starting_unit => 11,
      :ending_unit => 20,
      :price => 300
    },
    {
      :starting_unit => 21,
      :price => 500
    }
  ]
})

item_price = result.item_price
```

## Sample Response

```json
{
  "item_price": {
    "created_at": 1594106928,
    "currency_code": "USD",
    "external_name": "silver USD",
    "free_quantity": 0,
    "id": "silver-USD-monthly",
    "is_taxable": true,
    "item_id": "silver",
    "item_type": "plan",
    "name": "silver USD monthly",
    "object": "item_price",
    "period": 1,
    "period_unit": "month",
    "price": 1000,
    "pricing_model": "per_unit",
    "resource_version": 1594106928574,
    "status": "active",
    "updated_at": 1594106928
  }
}
```

## URL Format

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

## Input Parameters

- `id` (required, string, max chars=100)
  The identifier for the item price. It is unique and immutable.

- `name` (required, string, max chars=100)
  A unique display name for the item price in the Chargebee UI. If `external_name` is not provided, this is also used in customer-facing pages and documents such as [invoices](/docs/api/invoices) and [hosted pages](/docs/api/hosted_pages) .

- `description` (optional, string, max chars=2000)
  Description of the item price.

- `item_id` (required, string, max chars=100)
  The id of the item that the item price belongs to.

- `invoice_notes` (optional, string, max chars=2000)
  A customer-facing note added to all invoices associated with this API resource. This note becomes one among [all the notes](/docs/api/invoices/invoice-object#notes) displayed on the invoice PDF.

- `proration_type` (optional, enumerated string)
  Specifies how to manage charges or credits for the addon item price during a [subscription update](/docs/api/subscriptions/update-subscription-for-items) or [estimating](/docs/api/estimates/estimate-for-updating-a-subscription) a subscription update.
  Possible enum values:
    - `site_default`
      Use the [site-wide proration setting](https://www.chargebee.com/docs/2.0/proration.html#proration-for-subscription-change) .
    - `partial_term`
      Prorate the charges or credits for the rest of the current term.
    - `full_term`
      Charge the full price of the addon item price or give the full credit. Don't apply any proration.

- `external_name` (optional, string, max chars=100)
  The name of the item price used in customer-facing pages and documents. These include [invoices](/docs/api/invoices) and [hosted pages](/docs/api/hosted_pages). If not provided, then `name` is used.

- `currency_code` (optional, string, max chars=3)
  The currency code ([ISO 4217 format](https://www.chargebee.com/docs/supported-currencies.html) ) for the item price. Is required when multiple currencies have been enabled.

- `price_variant_id` (optional, string, max chars=100)
  An immutable unique identifier of a [price variant](/docs/api/price_variants).

- `is_taxable` (optional, boolean, default=true)
  Specifies whether taxes apply to this item price. This value is set and returned even if [Taxes](https://www.chargebee.com/docs/tax.html) have been disabled in Chargebee. However, the value is effective only while Taxes are enabled.

- `free_quantity` (optional, integer, default=0, min=0)
  Free quantity the subscriptions of this **plan** `item_price` will have. Only the quantity exceeding this value will be charged in the subscription.
  
  **Note:**
  
  -   `free_quantity` is currently supported only for [plan](/docs/api/items/item-object#type) `item_price`.
  -   `free_quantity` is not supported for the [Usage-Based Billing](https://www.chargebee.com/docs/2.0/understanding-usages.html) (UBB). All included or free quantities should be configured exclusively through [entitlements](/docs/api/entitlements) .

- `free_quantity_in_decimal` (optional, string, max chars=33)
  The quantity of the item that is available free-of-charge, represented in decimal. When a subscription is created for this plan or when the plan of a subscription is changed to this one, only the quantity above this number is charged for. Applicable for quantity-based plans and only when [multi-decimal pricing](/docs/api/getting-started) is enabled.

- `metadata` (optional, jsonobject)
  A collection of key-value pairs that provides extra information about the item price.
  
  **Note:** There's a character limit of 65,535.
  
  [Learn more](/docs/api/advanced-features#metadata) .

- `show_description_in_invoices` (optional, boolean, default=false)
  Whether the item price's description should be shown on [invoice PDFs](/docs/api/invoices/retrieve-invoice-as-pdf). If this Boolean is changed, only invoices generated (or [regenerated](https://www.chargebee.com/docs/invoice-operations.html#actions-for-payment-due-not-paid-invoices_regenerate-invoice) ) after the change are affected; past invoices are not.

- `show_description_in_quotes` (optional, boolean, default=false)
  Whether the item price's description should be shown on [quote PDFs](/docs/api/quotes/retrieve-quote-as-pdf). If this Boolean is changed, only quotes created after the change are affected; past quotes are not.

- `usage_accumulation_reset_frequency` (optional, enumerated string)
  Specifies the frequency at which the usage counter needs to be reset.
  
  **Note:** Changes to the `usage_accumulation_reset_frequency` parameter for `item_price` is not allowed if the `item` is already linked to a subscription.
  
  .
  Possible enum values:
    - `never`
      Accumulates usage without ever resetting it.
    - `subscription_billing_frequency`
      Accumulates usage until the subscription's billing frequency ends.

- `business_entity_id` (optional, string, max chars=50)
  The unique ID of the [business entity](/docs/api/business_entities) for this `item_price`. 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 means of a [custom HTTP header](/docs/api/advanced-features#mbe-header-main).

- `pricing_model` (optional, enumerated string, default=flat_fee)
  The [pricing scheme](https://www.chargebee.com/docs/2.0/plans.html#pricing-models) for this item price. If subscriptions, invoices or [differential prices](/docs/api/differential_prices) exist for this item price, `pricing_model` cannot be changed.
  Possible enum values:
    - `flat_fee`
      A fixed price that is not quantity-based.
    - `per_unit`
      A fixed price per unit quantity.
    - `tiered`
      There are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers.
    - `volume`
      The per unit price is based on the tier that the total quantity falls in.
    - `stairstep`
      A quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in.

- `price` (optional, in cents, min=0)
  The cost of the item price when the pricing model is `flat_fee`. When the pricing model is `per_unit` , it is the price per unit quantity of the item. Not applicable for the other pricing models. The value is in the [minor unit of the currency](/docs/api/getting-started) .

- `price_in_decimal` (optional, string, max chars=39)
  The price of the item when the pricing\_model is `flat_fee`. When the pricing model is `per_unit` , it is the price per unit quantity of the item. Not applicable for the other pricing models. The value is in decimal and in major units of the currency. Also, this is only applicable when [multi-decimal pricing](/docs/api/getting-started) is enabled.

- `period_unit` (optional, enumerated string)
  The unit of time for `period`. If subscriptions or invoices exist for this item price, `period_unit` cannot be changed. The `period_unit` is mandatory when the item `type` is `plan` or `addon` .
  
  **Important:** The `period` + `period_unit` pair must match a _configured billing frequency_ on your site. The API does not create new frequencies. To use a new frequency (for example, 3 months or 2 weeks), add it in the site settings first. Requests with non-configured combinations fail validation.
  
  -   Monthly: `period=1`, `period_unit=month` (available by default)
  -   Quarterly: `period=3`, `period_unit=month` (_enable 3-month frequency in settings_)
  -   Weekly: `period=1`, `period_unit=week` (available by default) See [how billing periods apply](https://www.chargebee.com/docs/billing/2.0/subscriptions/addons-billingcycle) .
  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.

- `period` (optional, integer, min=1)
  -   When the item `type` is `plan`: The billing period of the plan in `period_unit`s. For example, create a 6 month plan by providing `period` as 6 and `period_unit` as month.
  -   When item `type` is `addon`: The period of the addon in `period_unit`s. For example, create an addon with a 2 month `period` by providing period as 2 and `period_unit` as `month`. The period of an addon is the duration for which its `price` applies. When attached to a plan, the addon is billed for the billing period of the plan. [Learn more.](https://www.chargebee.com/docs/2.0/addons-billingcycle.html)
  
  If subscriptions or invoices exist for this item price, `period` cannot be changed. The `period` is mandatory when the item `type` is `plan` or `addon`.
  
  **Important:** The `period` value, together with `period_unit`, must equal one of your site's _configured billing frequencies_. If the combination does not exist, the request fails with an invalid billing period configuration error. Configure the frequency in site settings and retry. See [Addons and billing cycle](https://www.chargebee.com/docs/billing/2.0/subscriptions/addons-billingcycle).

- `trial_period_unit` (optional, enumerated string)
  The unit of time for `trial_period` .
  Possible enum values:
    - `day`
      A period of 24 hours.
    - `month`
      A period of 1 calendar month.

- `trial_period` (optional, integer, min=0)
  The trial period of the plan in `trial_period_unit` s. You can also set [trial periods for addons](https://www.chargebee.com/docs/2.0/addons-trial.html) ; contact [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) to enable that feature.

- `shipping_period` (optional, integer, min=1)
  Defines the shipping frequency. Example: to bill customer every 2 weeks, provide "2" here.

- `shipping_period_unit` (optional, enumerated string)
  Defines the shipping frequency in association with shipping 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.

- `billing_cycles` (optional, integer, min=1)
  The default number of billing cycles a subscription to the plan must run. Can be [overridden](/docs/api/subscriptions) for a subscription. Addons can also [have billing cycles](https://www.chargebee.com/docs/2.0/addons-billingcycle.html). Also, for addons, you can [override this](/docs/api/attached_items) while attaching it to a plan. However, if you provide the value while [applying the addon to a subscription](/docs/api/subscriptions/subscription-object#subscription_items_item_type), then that value takes still higher precedence. If subscriptions, invoices or [differential prices](/docs/api/differential_prices) exist for this item price, `billing_cycles` cannot be changed.
  
  **Note:** If you want to change the `billing_cycles` to unlimited renewals, enter an empty string. This value can only be updated if the `item_price` is not attached to a subscription or invoice. If no `billing_cycles` value is entered, then by default the value will be set as unlimited `billing_cycles` renewals.

- `trial_end_action` (optional, enumerated string)
  Applicable only when [End-of-trial Action](https://www.chargebee.com/docs/2.0/trial_periods_hidden.html#how-to-define-the-end-of-trial-actions-for-subscriptions) has been enabled for the site. Specifies the operation to be carried out for the subscription once the trial ends. Whenever the `item.type` is `plan` and a trial period is defined for this item price, this attribute (parameter) is returned (required). This can be overridden at the [subscription-level](/docs/api/subscriptions/subscription-object#trial_end_action) .
  Possible enum values:
    - `site_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.

- `tax_detail` (optional, string)
  Parameters for tax\_detail
  - `tax_profile_id` (optional, string, max chars=50)
    The tax profile of the item price.
  - `avalara_tax_code` (optional, string, max chars=50)
    The [Avalara tax codes](https://taxcode.avatax.avalara.com) for the item price. Applicable only if you use [AvaTax for Sales integration](https://www.chargebee.com/docs/2.0/avatax-for-sales.html) .
  - `hsn_code` (optional, string, max chars=50)
    The [HSN code](https://cbic-gst.gov.in/gst-goods-services-rates.html) to which the item is mapped for calculating the customer's tax in India. Applicable only when both of the following conditions are true:
    
    -   [**India**](https://www.chargebee.com/docs/indian-gst.html#configuring-indian-gst) has been enabled as a **Tax Region**. (An error is returned when this condition is not true.)
    -   The [**AvaTax for Sales** integration](https://www.chargebee.com/docs/avalara.html) has been enabled in Chargebee.
  - `avalara_sale_type` (optional, enumerated string)
    Indicates the [Avalara sale type](https://developer.avalara.com/communications/dev-guide_rest_v2/customizing-transactions/sample-transactions/transaction-information/#lineitem) for the item price. Applicable only if you use the [AvaTax for Communications integration](https://www.chargebee.com/docs/2.0/avatax-for-communication.html) .
    Possible enum values:
      - `wholesale`
        Transaction is a sale to another company that will resell your product or service to another consumer
      - `retail`
        Transaction is a sale to an end user
      - `consumed`
        Transaction is for an item that is consumed directly
      - `vendor_use`
        Transaction is for an item that is subject to vendor use tax
  - `avalara_transaction_type` (optional, integer)
    Indicates the [Avalara transaction type](https://developer.avalara.com/communications/dev-guide_rest_v2/customizing-transactions/sample-transactions/transaction-information/#lineitem) for the item price. Applicable only if you use the [AvaTax for Communications integration](https://www.chargebee.com/docs/2.0/avatax-for-communication.html) .
  - `avalara_service_type` (optional, integer)
    Indicates the [Avalara service type](https://developer.avalara.com/communications/dev-guide_rest_v2/customizing-transactions/sample-transactions/transaction-information/#lineitem) for the item price. Applicable only if you use the [AvaTax for Communications integration](https://www.chargebee.com/docs/2.0/avatax-for-communication.html) .
  - `taxjar_product_code` (optional, string, max chars=50)
    The [TaxJar product code](https://developers.taxjar.com/api/reference/#get-list-tax-categories) for the item price. Applicable only if you use [TaxJar integration](https://www.chargebee.com/docs/2.0/taxjar.html) .

- `accounting_detail` (optional, string)
  Parameters for accounting\_detail
  - `sku` (optional, string, max chars=100)
    This maps to the sku or product name in the accounting integration.
  - `accounting_code` (optional, string, max chars=100)
    The identifier of the chart of accounts under which the item price falls in the accounting system.
  - `accounting_category1` (optional, string, max chars=100)
    Used exclusively with the following [accounting integrations](https://www.chargebee.com/docs/2.0/finance-integration-index.html )
    
    -   [**Xero:**](https://www.chargebee.com/docs/2.0/xero.html ) If you've categorized your products in Xero, provide the category name and option. Use the format: `:` . For example:`Location: Singapore.`
    -   [**QuickBooks:**](https://www.chargebee.com/docs/2.0/quickbooks.html ) If you've categorized your product sales in QuickBooks according to Classes, provide the class name here. Use the following format: `::...`
    -   [**NetSuite:**](https://www.chargebee.com/docs/2.0/netsuite.html ) If you've categorized your products in NetSuite under Classes, provide the class name here. Use the following format: `: : ....` For example: `Services: Plan.`
    -   [**Intacct:**](https://www.chargebee.com/docs/2.0/intacct.html ) If you've classified your products in Intacct under Locations, provide the name of the Location here.
  - `accounting_category2` (optional, string, max chars=100)
    Used exclusively with the following [accounting integrations](https://www.chargebee.com/docs/1.0/finance-integration-index.html )
    
    -   [**Xero:**](https://www.chargebee.com/docs/1.0/xero.html ) If you've categorized your products in Xero, then provide the second category name and option here. Use the format: `: ....` For example, `Region: South`
    -   [**QuickBooks:**](https://www.chargebee.com/docs/1.0/quickbooks.html ) If you've categorized your product sales in QuickBooks according to Location, provide the Location name here. Use the following format: `::....` For example: `Location: North America: Canada`
    -   [**NetSuite:**](https://www.chargebee.com/docs/1.0/netsuite.html ) If you've categorized your products in NetSuite under Locations, provide the location name here. Use the following format `: : ....` For example: `NA:US:CA`
    -   [**Intacct:**](https://www.chargebee.com/docs/1.0/intacct.html ) If you've classified your products in Intacct under Dimensions, provide the value of the Dimension here.
  - `accounting_category3` (optional, string, max chars=100)
    Used exclusively with the following [accounting integrations](https://www.chargebee.com/docs/1.0/finance-integration-index.html )
    
    -   [**NetSuite:**](https://www.chargebee.com/docs/1.0/netsuite.html ) If you've categorized your products in NetSuite under Departments, pass the department name here. Use the following format: `: : ....` For example: `Production: Assembly.`
    -   [**Intacct:**](https://www.chargebee.com/docs/1.0/intacct.html ) If you've classified your products in Intacct under multiple Dimensions, provide the value of the second Dimension here.
  - `accounting_category4` (optional, string, max chars=100)
    Used exclusively with the following [accounting integrations](https://www.chargebee.com/docs/1.0/finance-integration-index.html )
    
    -   [**NetSuite:**](https://www.chargebee.com/docs/1.0/netsuite.html ) Provide the "Revenue Recognition Rule Id" for the product from NetSuite.
    -   [**Intacct:**](https://www.chargebee.com/docs/1.0/intacct.html ) If you have configured "Revenue Recognition Templates" for products in Intacct, provide the template ID for the product.

- `tiers` (optional, array)
  Parameters for tiers
  - `starting_unit` (optional, integer)
    The lower limit of a range of units for the tier
  - `ending_unit` (optional, integer)
    The upper limit of a range of units for the tier
  - `price` (optional, in cents)
    The per-unit price for the tier when the `pricing_model` is `tiered` or `volume` ; the total cost for the item price when the `pricing_model` is `stairstep`. The value is in the [minor unit of the currency](/docs/api/getting-started) .
  - `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/currencies) 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/currencies) 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 addon. The value is in major units of the currency. Returned when the plan is quantity-based and [multi-decimal pricing](/docs/api/currencies) 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.

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

## Returns

- `item_price` (Item price object)
  Resource object representing item\_price
