# Delete a subscription ramp

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


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

Batch

Deletes the specified subscription ramp. However, Chargebee only allows deleting a ramp if it does not conflict with future ramps on the subscription. The following checks are performed to ensure compatibility:

Condition

Restriction

The ramp contains `items_to_add[]`

The ramp cannot be deleted if any of the items in `items_to_add[]` are scheduled to be updated or removed in a subsequent ramp.

The ramp contains `coupons_to_add[]`

The ramp cannot be deleted if any of the coupons in `coupons_to_add[]` are scheduled to be removed in a subsequent ramp.

The ramp contains `discounts_to_add[]`

The ramp cannot be deleted if any of the discounts in `discounts_to_add[]` are scheduled to be removed in a subsequent ramp.

## Sample Request

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/ramps/__test__rHsiT4rY2hC1A/delete \
     -X POST  \
     -u {site_api_key}:
```

#### .NET

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

ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = Ramp.Delete("__test__rHsiT4rY2hC1A").Request();

Ramp ramp = result.Ramp;
```

#### Go

```go
package main
import (
    "fmt"
    "github.com/chargebee/chargebee-go/v3"
    rampAction "github.com/chargebee/chargebee-go/v3/actions/ramp"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := rampAction.Delete("__test__rHsiT4rY2hC1A").Request()
    if err != nil {
        fmt.Println(err)
    } else {
        Ramp := res.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)
  
  res, err := client.Ramp.Delete("__test__rHsiT4rY2hC1A")
      if err != nil {
        fmt.Println(err)
    } else {
        Ramp := res.Ramp
    }
}
```

#### 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 = Ramp.delete("__test__rHsiT4rY2hC1A").request();

        Ramp ramp = result.ramp();
    }
}
```

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.ramp.Ramp;
import com.chargebee.v4.models.ramp.params.RampDeleteParams;
import com.chargebee.v4.models.ramp.responses.RampDeleteResponse;

public class RampDelete {

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

        RampDeleteResponse response = client.ramps().delete("__test__rHsiT4rY2hC1A");

        Ramp ramp = response.getRamp();
    }
}
```

#### Node.js

```node
import Chargebee from "chargebee";

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

try {
    const result = await chargebee.ramp.delete("__test__rHsiT4rY2hC1A");

    console.log(result);
    const ramp = result.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()->delete("__test__rHsiT4rY2hC1A");
$ramp = $result->ramp;
```

#### Python

```python
from chargebee import Chargebee

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
response = cb_client.Ramp.delete("__test__rHsiT4rY2hC1A")
ramp = response.ramp
```

#### Ruby

```ruby
require 'chargebee'

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

result = ChargeBee::Ramp.delete("__test__rHsiT4rY2hC1A")

ramp = result.ramp
```

## Sample Response

```json
{
  "ramp": {
    "id": "__test__rHsiT4rY2hC1A",
    "effective_from": "1635054328",
    "subscription_id": "__test__8asukSOXdv6kOj",
    "status": "scheduled",
    "description": "Schedule for first ramp",
    "created_at": "1635054328",
    "deleted": true,
    "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

**POST** https://[site].chargebee.com/api/v2/ramps/{ramp-id}/delete

## Returns

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