# List item prices

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


[Eventually Consistent](/docs/api/read-consistency)

Returns a list of item prices satisfying **all** the conditions specified in the filter parameters below. The list is sorted by the date of creation in descending order.

### Use Cases

##### Filter by custom fields[](#filter-by-custom-fields)

**Note:** Custom field filters are turned off by default. To turn them on for your site, 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).

You can filter the response by [custom fields](/docs/api/advanced-features#filtering-by-custom-field-values) configured on item prices. After they're turned on for your site, the filter parameters are visible on this page when you're logged in. For the supported operators and limits, see [Filtering by custom field values](/docs/api/advanced-features#filtering-by-custom-field-values).

Item prices inherit the type of their parent item (`plan`, `addon`, or `charge`), and each type can have its own custom fields. As a result, the filter parameter is scoped per item price type rather than shared across item prices.

Use one of the following forms, where `cf_CUSTOM_FIELD_NAME` is the exact, case-sensitive API name of a custom field configured on the corresponding item price type:

For example, to filter plan item prices by the custom field `cf_region`, pass it as a query parameter:

## Sample Request

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/item_prices \
     -G  \
     -u {site_api_key}:\
     --data-urlencode limit=2
```

#### .NET

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

ApiConfig.Configure("{site}","{site_api_key}");
ListResult result = ItemPrice.List()
		.Limit(2)
		.Request();

foreach (var listItem in result.List){
  ItemPrice itemPrice = listItem.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"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := itempriceAction.List(&itemprice.ListRequestParams{
        Limit : chargebee.Int32(2),
    }).ListRequest()
    if err != nil {
        fmt.Println(err)
    } else {
        for idx := 0; idx < len(res.List); idx++ {
            ItemPrice := res.List[idx].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.ItemPriceListRequest{
    Limit : chargebee.Int32(2),
}
  res, err := client.ItemPrice.List(req)
      if err != nil {
        fmt.Println(err)
    } else {
        for idx := 0; idx < len(res.List); idx++ {
            ItemPrice := res.List[idx].ItemPrice
        }
    }
}
```

#### Java

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

public class Sample {

    public static void main(String args[]) throws IOException, Exception {
        Environment.configure("{site}", "{site_api_key}");
        ListResult result = ItemPrice.list()
            .limit(2)
            .request();

        for (ListResult.Entry entry : result) {
            ItemPrice itemPrice = entry.itemPrice();
        }
    }
}
```

#### Java

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

public class ItemPriceList {

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

        ItemPriceListParams params = ItemPriceListParams.builder()
            .limit(2)
            .build();

        ItemPriceListResponse response = client.itemPrices().list(params);
    }
}
```

#### Node.js

```node
import Chargebee from "chargebee";

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

try {
    const result = await chargebee.itemPrice.list({
        limit: 2
    });
    result.list.forEach((entry) => {
        console.log(entry);
        const itemPrice = entry.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()->all([
    "limit" => 2
]);
foreach($result->list as $entry) {
    $itemPrice = $entry->item_price;
}
```

#### Python

```python
from chargebee import Chargebee, Filters

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
entries = cb_client.ItemPrice.list(
    cb_client.ItemPrice.ListParams(
        limit=2
    )
)
for entry in entries.list:
    item_price = entry.item_price
```

#### Ruby

```ruby
require 'chargebee'

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

list = ChargeBee::ItemPrice.list({
  :limit => 2
})

list.each do |entry|
  item_price = entry.item_price
end
```

## Sample Response

```json
{
  "list": [
    {
      "item_price": {
        "created_at": 1594106932,
        "currency_code": "USD",
        "external_name": "Day Pass USD Monthly",
        "free_quantity": 0,
        "id": "day-pass-USD-monthly",
        "is_taxable": true,
        "item_id": "day-pass",
        "item_type": "addon",
        "name": "Day Pass USD Monthly",
        "object": "item_price",
        "period": 1,
        "period_unit": "month",
        "pricing_model": "tiered",
        "resource_version": 1594106932518,
        "status": "active",
        "tiers": [
          {
            "ending_unit": 10,
            "price": 100,
            "starting_unit": 1
          },
          {..}
        ],
        "updated_at": 1594106932
      }
    },
    {..}
  ]
}
```

## URL Format

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

## Input Parameters

- `limit` (optional, integer, default=10, min=1, max=100)
  The number of resources to be returned.

- `offset` (optional, string, max chars=1000)
  Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set `offset` to the value of `next_offset` obtained in the previous iteration of the API call.

## Returns

- `next_offset` (optional, string, max chars=1000)
  This attribute is returned only if more resources are present. To fetch the next set of resources use this value for the input parameter `offset`.

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