# List subscription ramps

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


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

Lists the subscription ramps that match the criteria provided in the filter parameters.

**Note** By default, the ramps are returned [sorted](/docs/api/ramps/list-ramps) in descending order (latest first) by `[updated_at](/docs/api/ramps/ramp-object#updated_at)`.

## Sample Request

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/ramps \
     -G  \
     -u {site_api_key}:\
     --data-urlencode limit=12 \
     --data-urlencode "subscription_id[in]"='["__test__8asukSOXdv6kOj"]'
```

#### .NET

```dotnet
using ChargeBee.Api;
using ChargeBee.Models;
using Newtonsoft.Json.Linq;

ApiConfig.Configure("{site}","{site_api_key}");
ListResult result = Ramp.List()
		.Limit(12)
		.SubscriptionId().In("__test__8asukSOXdv6kOj")
		.Request();

foreach (var listItem in result.List){
  Ramp ramp = listItem.Ramp;
}
```

#### Go

```go
package main
import (
    "fmt"
    "github.com/chargebee/chargebee-go/v3"
    "github.com/chargebee/chargebee-go/v3/filter"
    rampAction "github.com/chargebee/chargebee-go/v3/actions/ramp"
    "github.com/chargebee/chargebee-go/v3/models/ramp"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := rampAction.List(&ramp.ListRequestParams{
        Limit : chargebee.Int32(12),
        SubscriptionId : &filter.StringFilter{
            In : []string{"__test__8asukSOXdv6kOj"},
        },
    }).ListRequest()
    if err != nil {
        fmt.Println(err)
    } else {
        for idx := 0; idx < len(res.List); idx++ {
            Ramp := res.List[idx].Ramp
        }
    }
}
```

#### 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.RampListRequest{
    Limit : chargebee.Int32(12),
    SubscriptionId : &chargebee.StringFilter{
        In : []string{"__test__8asukSOXdv6kOj"},
    },
}
  res, err := client.Ramp.List(req)
      if err != nil {
        fmt.Println(err)
    } else {
        for idx := 0; idx < len(res.List); idx++ {
            Ramp := res.List[idx].Ramp
        }
    }
}
```

#### 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 = Ramp.list()
            .limit(12)
            .subscriptionId().in("__test__8asukSOXdv6kOj")
            .request();

        for (ListResult.Entry entry : result) {
            Ramp ramp = entry.ramp();
        }
    }
}
```

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.ramp.Ramp;
import com.chargebee.v4.models.ramp.params.RampListParams;
import com.chargebee.v4.models.ramp.responses.RampListResponse;
import java.util.List;

public class RampList {

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

        RampListParams params = RampListParams.builder()
            .limit(12)
            .subscriptionId()
            .in("[\"__test__8asukSOXdv6kOj\"]")
            .build();

        RampListResponse response = client.ramps().list(params);
    }
}
```

#### Node.js

```node
import Chargebee from "chargebee";

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

try {
    const result = await chargebee.ramp.list({
        limit: 12,
        subscription_id: {
            in: ["__test__8asukSOXdv6kOj"]
        }
    });
    result.list.forEach((entry) => {
        console.log(entry);
        const ramp = entry.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->ramp()->all([
    "limit" => 12,
    "subscription_id" => [
        "in" => ["__test__8asukSOXdv6kOj"]
    ]
]);
foreach($result->list as $entry) {
    $ramp = $entry->ramp;
}
```

#### Python

```python
from chargebee import Chargebee, Filters

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
entries = cb_client.Ramp.list(
    cb_client.Ramp.ListParams(
        limit=12,
        subscription_id=Filters.StringFilter(IN=["__test__8asukSOXdv6kOj"])
    )
)
for entry in entries.list:
    ramp = entry.ramp
```

#### Ruby

```ruby
require 'chargebee'

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

list = ChargeBee::Ramp.list({
  :limit => 12,
  "subscription_id[in]" => "[\"__test__8asukSOXdv6kOj\"]"
})

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

## Sample Response

```json
{
  "list": [
    {
      "ramp": {
        "id": "__test__rHsiT4rY2hC1A",
        "effective_from": "1635054328",
        "subscription_id": "__test__8asukSOXdv6kOj",
        "status": "scheduled",
        "description": "Schedule for first ramp",
        "created_at": "1635054328",
        "deleted": false,
        "updated_at": "1635054328",
        "items_to_remove": [
          "basicAddon1-USD-Monthly",
          {..}
        ],
        "items_to_add": [
          {
            "item_price_id": "basicAddon2-USD-Monthly",
            "quantity": 2
          },
          {..}
        ],
        "discounts_to_add": [
          {
            "duration_type": "one_time",
            "apply_on": "invoice_amount",
            "percentage": 5
          },
          {..}
        ],
        "items_to_update": [
          {
            "item_price_id": "basicPlan-USD-Monthly",
            "unit_price": 20000
          },
          {..}
        ]
      }
    },
    {..}
  ]
}
```

## URL Format

**GET** https://[site].chargebee.com/api/v2/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.

- `include_deleted` (optional, boolean, default=false)
  Specifies whether to include deleted resources in the response. Deleted resources are those with the `[deleted](/docs/api/ramps/ramp-object#deleted)` attribute set to `true`.
  
  **Caution** `status` or `effective_from` filters must not be passed when `include_deleted` is set to `true`.
  
  .

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

- `ramp` (Ramp object)
  Resource object representing ramp
