# Delete a quote

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


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

Delete a quote using this API.

## Sample Request

#### cURL

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

#### .NET

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

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

Quote quote = result.Quote;
QuotedSubscription quotedSubscription = result.QuotedSubscription;
QuotedCharge quotedCharge = result.QuotedCharge;
QuotedRamp quotedRamp = result.QuotedRamp;
```

#### Go

```go
package main
import (
    "fmt"
    "github.com/chargebee/chargebee-go/v3"
    quoteAction "github.com/chargebee/chargebee-go/v3/actions/quote"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := quoteAction.Delete("2", nil).Request()
    if err != nil {
        fmt.Println(err)
    } else {
        Quote := res.Quote
        QuotedSubscription := res.QuotedSubscription
        QuotedCharge := res.QuotedCharge
        QuotedRamp := res.QuotedRamp
    }
}
```

#### 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.QuoteDeleteRequest{}
  res, err := client.Quote.Delete("2", req)
      if err != nil {
        fmt.Println(err)
    } else {
        Quote := res.Quote
        QuotedSubscription := res.QuotedSubscription
        QuotedCharge := res.QuotedCharge
        QuotedRamp := res.QuotedRamp
    }
}
```

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

        Quote quote = result.quote();
        QuotedSubscription quotedSubscription = result.quotedSubscription();
        QuotedCharge quotedCharge = result.quotedCharge();
        QuotedRamp quotedRamp = result.quotedRamp();
    }
}
```

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.quote.Quote;
import com.chargebee.v4.models.quote.params.QuoteDeleteParams;
import com.chargebee.v4.models.quote.responses.QuoteDeleteResponse;
import com.chargebee.v4.models.quotedCharge.QuotedCharge;
import com.chargebee.v4.models.quotedRamp.QuotedRamp;
import com.chargebee.v4.models.quotedSubscription.QuotedSubscription;

public class QuoteDelete {

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

        QuoteDeleteResponse response = client.quotes().delete("2");

        Quote quote = response.getQuote();
        QuotedSubscription quotedSubscription = response.getQuotedSubscription();
        QuotedCharge quotedCharge = response.getQuotedCharge();
        QuotedRamp quotedRamp = response.getQuotedRamp();
    }
}
```

#### Node.js

```node
import Chargebee from "chargebee";

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

try {
    const result = await chargebee.quote.delete("2");

    console.log(result);
    const quote = result.quote;
    const quotedSubscription = result.quoted_subscription;
    const quotedCharge = result.quoted_charge;
    const quotedRamp = result.quoted_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->quote()->delete("2");
$quote = $result->quote;
$quotedSubscription = $result->quoted_subscription;
$quotedCharge = $result->quoted_charge;
$quotedRamp = $result->quoted_ramp;
```

#### Python

```python
from chargebee import Chargebee

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
response = cb_client.Quote.delete("2")
quote = response.quote
quoted_subscription = response.quoted_subscription
quoted_charge = response.quoted_charge
quoted_ramp = response.quoted_ramp
```

#### Ruby

```ruby
require 'chargebee'

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

result = ChargeBee::Quote.delete("2")

quote = result.quote
quoted_subscription = result.quoted_subscription
quoted_charge = result.quoted_charge
quoted_ramp = result.quoted_ramp
```

## Sample Response

```json
{
  "quote": {
    "amount_due": 4500,
    "amount_paid": 0,
    "billing_address": {
      "first_name": "John",
      "last_name": "Doe",
      "object": "billing_address",
      "validation_status": "not_validated"
    },
    "charge_on_acceptance": 4500,
    "credits_applied": 0,
    "currency_code": "USD",
    "customer_id": "__test__8aszcSOcl5L2q",
    "date": 1517494507,
    "id": "2",
    "line_item_discounts": {},
    "line_item_taxes": {},
    "line_items": [
      {
        "amount": 4000,
        "customer_id": "__test__8aszcSOcl5L2q",
        "date_from": 1517494507,
        "date_to": 1517494507,
        "description": "Encryption Charge USD Monthly",
        "discount_amount": 0,
        "entity_id": "encryption-charge-USD",
        "entity_type": "charge_item_price",
        "id": "__test__8aszcSOcl5QU11",
        "is_taxed": false,
        "item_level_discount_amount": 0,
        "object": "line_item",
        "pricing_model": "flat_fee",
        "quantity": 1,
        "tax_amount": 0,
        "unit_amount": 4000
      },
      {..}
    ],
    "object": "quote",
    "operation_type": "onetime_invoice",
    "price_type": "tax_exclusive",
    "resource_version": 1517494507372,
    "status": "open",
    "sub_total": 4500,
    "taxes": {},
    "total": 4500,
    "total_payable": 4500,
    "updated_at": 1517494507,
    "valid_till": 1526134507,
    "version": 1
  }
}
```

## URL Format

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

## Input Parameters

- `comment` (optional, string, max chars=300)
  Reason for deleting quote. This comment will be added to the subscription entity if the quote belongs to a subscription or added to the customer entity if the quote is associated only with a customer.

## Returns

- `quote` (Quote object)
  Resource object representing quote

- `quoted_subscription` (Quoted subscription object)
  Resource object representing quoted\_subscription

- `quoted_charge` (Quoted charge object)
  Resource object representing quoted\_charge

- `quoted_ramp` (Quoted ramp object)
  Resource object representing quoted\_ramp
