# List business entities

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


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

Returns a list of `business_entity` resources configured for the site, meeting all the conditions specified in the filter parameters below. By default, this list is sorted by `id` in ascending order.

## Sample Request

#### Chargebee CLI

```bash
chargebee business-entity list
```

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/business_entities \
     -u {site_api_key}:
```

#### .NET

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

ApiConfig.Configure("{site}","{site_api_key}");
ListResult result = BusinessEntity.List().Request();

foreach (var listItem in result.List){
  BusinessEntity businessEntity = listItem.BusinessEntity;
}
```

#### Go

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

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

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

        for (ListResult.Entry entry : result) {
            BusinessEntity businessEntity = entry.businessEntity();
        }
    }
}
```

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.businessEntity.BusinessEntity;
import com.chargebee.v4.models.businessEntity.params.BusinessEntityListParams;
import com.chargebee.v4.models.businessEntity.responses.BusinessEntityListResponse;
import java.util.List;

public class BusinessEntityList {

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

        BusinessEntityListResponse response = client.businessEntities().list();
    }
}
```

#### Node.js

```node
import Chargebee from "chargebee";

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

try {
    const result = await chargebee.businessEntity.list();
    result.list.forEach((entry) => {
        console.log(entry);
        const businessEntity = entry.business_entity;
    });
} 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->businessEntity()->all();
foreach($result->list as $entry) {
    $businessEntity = $entry->business_entity;
}
```

#### Python

```python
from chargebee import Chargebee, Filters

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
entries = cb_client.BusinessEntity.list()
for entry in entries.list:
    business_entity = entry.business_entity
```

#### Ruby

```ruby
require 'chargebee'

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

list = ChargeBee::BusinessEntity.list()

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

## Sample Response

```json
{
  "list": [
    {
      "business_entity": {
        "id": "__test__KyVnHhSBWl8Ni2bt",
        "name": "Acme EU",
        "object": "business_entity",
        "resource_version": 1517505733000,
        "status": "active",
        "updated_at": 1517505733,
        "created_at": 1517505733,
        "deleted": false
      }
    },
    {..}
  ]
}
```

## URL Format

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

## 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`, the list of business entities returned includes those that have been deleted.

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

- `business_entity` (Business entity object)
  Resource object representing `business_entity` .
