# List price ramps

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


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

Retrieves a list of price ramps for your site. You can filter the results by attributes such as `id`, `item_price_id`, `status`, and `updated_at`, and sort them using `sort_by`.

Only `active` and `archived` price ramps are returned by this operation. `deleted` price ramps are not listed.

### Prerequisites & Constraints

-   [Price Ramps](https://www.chargebee.com/docs/billing/2.0/product-catalog/price-ramps) must be enabled for the 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) to enable them. Until they are enabled, this operation returns `API_RESTRICTED`.

## Sample Request

#### Chargebee CLI

```bash
chargebee price-ramp list \
    -d limit=2
```

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/price_ramps \
     -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 = PriceRamp.List()
		.Limit(2)
		.Request();

foreach (var listItem in result.List){
  PriceRamp priceRamp = listItem.PriceRamp;
}
```

#### Go

```go
package main
import (
    "fmt"
    "github.com/chargebee/chargebee-go/v3"
    pricerampAction "github.com/chargebee/chargebee-go/v3/actions/priceramp"
    "github.com/chargebee/chargebee-go/v3/models/priceramp"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := pricerampAction.List(&priceramp.ListRequestParams{
        Limit : chargebee.Int32(2),
    }).ListRequest()
    if err != nil {
        fmt.Println(err)
    } else {
        for idx := 0; idx < len(res.List); idx++ {
            PriceRamp := res.List[idx].PriceRamp
        }
    }
}
```

#### 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.PriceRampListRequest{
    Limit : chargebee.Int32(2),
}
  res, err := client.PriceRamp.List(req)
      if err != nil {
        fmt.Println(err)
    } else {
        for idx := 0; idx < len(res.List); idx++ {
            PriceRamp := res.List[idx].PriceRamp
        }
    }
}
```

#### 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 = PriceRamp.list()
            .limit(2)
            .request();

        for (ListResult.Entry entry : result) {
            PriceRamp priceRamp = entry.priceRamp();
        }
    }
}
```

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.priceRamp.PriceRamp;
import com.chargebee.v4.models.priceRamp.params.PriceRampListParams;
import com.chargebee.v4.models.priceRamp.responses.PriceRampListResponse;
import java.util.List;

public class PriceRampList {

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

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

        PriceRampListResponse response = client.priceRamps().list(params);
    }
}
```

#### Node.js

```node
import Chargebee from "chargebee";

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

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

#### Python

```python
from chargebee import Chargebee, Filters

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

#### Ruby

```ruby
require 'chargebee'

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

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

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

## Sample Response

```json
{
  "list": [
    {
      "price_ramp": {
        "id": "3b930dda-1444-44f1-b79b-8de01fd9c139",
        "item_price_id": "basic-USD-Monthly",
        "status": "active",
        "object": "price_ramp",
        "ramp_intervals": [
          {
            "starting_billing_cycle": 1,
            "ending_billing_cycle": 1,
            "price": 99
          },
          {
            "starting_billing_cycle": 2,
            "ending_billing_cycle": 4,
            "price": 499
          },
          {
            "starting_billing_cycle": 5,
            "apply_catalog_price": true,
            "price": 999
          }
        ],
        "resource_version": 1594110587730,
        "created_at": 1594110587,
        "updated_at": 1594110587
      }
    }
  ]
}
```

## URL Format

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

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

- `price_ramp` (Price ramp object)
