# List quotes

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


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

**Important**  
For sites where both [legacy and latest](/docs/api/v2/pcv-1/upgrade#retrieving-api-responses-in-latest-api-format) product catalog versions are active, GET API requests return responses in a `compat` format by default. This format works with both latest and legacy Product Catalog.

**Override options:**

-   `chargebee-response-schema-type: items` → Return response in latest product catalog format only.
-   `chargebee-response-schema-type: plans_addons` → Return response in legacy product catalog format only.

List all quotes.

## Sample Request

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/quotes \
     -G  \
     -u {site_api_key}:\
     --data-urlencode limit=3 \
     --data-urlencode "status[in]"='["accepted"]' \
     --data-urlencode "sort_by[asc]"="date"
```

#### .NET

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

ApiConfig.Configure("{site}","{site_api_key}");
ListResult result = Quote.List()
		.Limit(3)
		.Status().In(Quote.StatusEnum.Accepted)
		.SortByDate(SortOrderEnum.Asc)
		.Request();

foreach (var listItem in result.List){
  Quote quote = listItem.Quote;
  QuotedSubscription quotedSubscription = listItem.QuotedSubscription;
  QuotedRamp quotedRamp = listItem.QuotedRamp;
}
```

#### Go

```go
package main
import (
    "fmt"
    "github.com/chargebee/chargebee-go/v3"
    "github.com/chargebee/chargebee-go/v3/filter"
    quoteAction "github.com/chargebee/chargebee-go/v3/actions/quote"
    "github.com/chargebee/chargebee-go/v3/models/quote"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := quoteAction.List(&quote.ListRequestParams{
        Limit : chargebee.Int32(3),
        Status : &filter.EnumFilter{
            In : []interface{}{"accepted"},
        },
        SortBy : &filter.SortFilter{
            Asc : "date",
        },
    }).ListRequest()
    if err != nil {
        fmt.Println(err)
    } else {
        for idx := 0; idx < len(res.List); idx++ {
            Quote := res.List[idx].Quote
            QuotedSubscription := res.List[idx].QuotedSubscription
            QuotedRamp := res.List[idx].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.QuoteListRequest{
    Limit : chargebee.Int32(3),
    Status : &chargebee.EnumFilter{
        In : []interface{}{"accepted"},
    },
    SortBy : &chargebee.SortFilter{
        Asc : "date",
    },
}
  res, err := client.Quote.List(req)
      if err != nil {
        fmt.Println(err)
    } else {
        for idx := 0; idx < len(res.List); idx++ {
            Quote := res.List[idx].Quote
            QuotedSubscription := res.List[idx].QuotedSubscription
            QuotedRamp := res.List[idx].QuotedRamp
        }
    }
}
```

#### Java

```java
import com.chargebee.*;
import com.chargebee.ListResult;
import com.chargebee.filters.enums.SortOrder;
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 = Quote.list()
            .limit(3)
            .status().in(Quote.Status.ACCEPTED)
            .sortByDate(SortOrder.ASC)
            .request();

        for (ListResult.Entry entry : result) {
            Quote quote = entry.quote();
            QuotedSubscription quotedSubscription = entry.quotedSubscription();
            QuotedRamp quotedRamp = entry.quotedRamp();
        }
    }
}
```

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.quote.Quote;
import com.chargebee.v4.models.quote.params.QuoteListParams;
import com.chargebee.v4.models.quote.responses.QuoteListResponse;
import com.chargebee.v4.models.quotedRamp.QuotedRamp;
import com.chargebee.v4.models.quotedSubscription.QuotedSubscription;
import java.util.List;

public class QuoteList {

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

        QuoteListParams params = QuoteListParams.builder()
            .limit(3)
            .status()
            .in(QuoteListParams.Status.ACCEPTED)
            .sortBy()
            .date()
            .asc()
            .build();

        QuoteListResponse response = client.quotes().list(params);
    }
}
```

#### Node.js

```node
import Chargebee from "chargebee";

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

try {
    const result = await chargebee.quote.list({
        limit: 3,
        status: {
            in: ["accepted"]
        },
        "sort_by[asc]": "date"
    });
    result.list.forEach((entry) => {
        console.log(entry);
        const quote = entry.quote;
        const quotedSubscription = entry.quoted_subscription;
        const quotedRamp = entry.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()->all([
    "limit" => 3,
    "status" => [
        "in" => ["accepted"]
    ],
    "sort_by" => [
        "asc" => "date"
    ]
]);
foreach($result->list as $entry) {
    $quote = $entry->quote;
    $quotedSubscription = $entry->quoted_subscription;
    $quotedRamp = $entry->quoted_ramp;
}
```

#### Python

```python
import chargebee
from chargebee import Chargebee, Filters

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
entries = cb_client.Quote.list(
    cb_client.Quote.ListParams(
        limit=3,
        status=Filters.EnumFilter(IN=[chargebee.Quote.Status.ACCEPTED]),
        sort_by=Filters.SortFilter(ASC="date")
    )
)
for entry in entries.list:
    quote = entry.quote
    quoted_subscription = entry.quoted_subscription
    quoted_ramp = entry.quoted_ramp
```

#### Ruby

```ruby
require 'chargebee'

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

list = ChargeBee::Quote.list({
  :limit => 3,
  "status[in]" => "[\"accepted\"]",
  "sort_by[asc]" => "date"
})

list.each do |entry|
  quote = entry.quote
  quoted_subscription = entry.quoted_subscription
  quoted_ramp = entry.quoted_ramp
end
```

## Sample Response

```json
{
  "list": [
    {
      "quote": {
        "amount_due": 500,
        "amount_paid": 0,
        "billing_address": {
          "first_name": "John",
          "last_name": "Doe",
          "object": "billing_address",
          "validation_status": "not_validated"
        },
        "charge_on_acceptance": 500,
        "credits_applied": 0,
        "currency_code": "USD",
        "customer_id": "__test__KyVnHhSBWTMYaBr",
        "date": 1517501498,
        "id": "7",
        "line_item_discounts": {},
        "line_item_taxes": {},
        "line_items": [
          {
            "amount": 500,
            "customer_id": "__test__KyVnHhSBWTMYaBr",
            "date_from": 1517501498,
            "date_to": 1517501498,
            "description": "Service Charge",
            "discount_amount": 0,
            "entity_type": "adhoc",
            "id": "__test__KyVnHhSBWTMbVC0",
            "is_taxed": false,
            "item_level_discount_amount": 0,
            "object": "line_item",
            "pricing_model": "flat_fee",
            "quantity": 1,
            "tax_amount": 0,
            "unit_amount": 500
          },
          {..}
        ],
        "object": "quote",
        "operation_type": "onetime_invoice",
        "price_type": "tax_exclusive",
        "resource_version": 1517501498000,
        "status": "accepted",
        "sub_total": 500,
        "taxes": {},
        "total": 500,
        "total_payable": 500,
        "updated_at": 1517501498,
        "valid_till": 1517596199,
        "version": 1
      }
    },
    {..}
  ]
}
```

## URL Format

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

## 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)
  If set to true, includes the deleted resources in the response. For the deleted resources in the response, the '**deleted** ' attribute will be '**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`.

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

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

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