> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bbrands.io/llms.txt
> Use this file to discover all available pages before exploring further.

# List Company

export const ParamField = ({default: defaultValue, deprecated = false, children, name, required = false, rules, type, unique = false, visibility = 'public'}) => <div className="pt-2.5 pb-5 my-2.5 border-gray-50 dark:border-gray-800/50 border-b">
    <div className="flex font-mono text-sm group/param-head param-head">
      <div className="flex-1 flex content-start py-0.5 mr-5">
        <div className="flex items-center flex-wrap gap-2">
          <div className="absolute h-0 w-0">
            <a href="#param-commercial-activity" className="-ml-10 flex items-center opacity-0 border-0 group-hover/param-head:opacity-100 py-2 [.expandable-content_&]:-ml-[2.1rem]" aria-label="Navigate to header">
              <div className="w-6 h-6 text-gray-400 rounded-md flex items-center justify-center zinc-box bg-white ring-1 ring-gray-400/30 dark:ring-gray-700/25 hover:ring-gray-400/60 dark:hover:ring-white/20">
                <svg xmlns="http://www.w3.org/2000/svg" fill="gray" height="12px" viewBox="0 0 576 512">
                  <path d="M0 256C0 167.6 71.6 96 160 96h72c13.3 0 24 10.7 24 24s-10.7 24-24 24H160C98.1 144 48 194.1 48 256s50.1 112 112 112h72c13.3 0 24 10.7 24 24s-10.7 24-24 24H160C71.6 416 0 344.4 0 256zm576 0c0 88.4-71.6 160-160 160H344c-13.3 0-24-10.7-24-24s10.7-24 24-24h72c61.9 0 112-50.1 112-112s-50.1-112-112-112H344c-13.3 0-24-10.7-24-24s10.7-24 24-24h72c88.4 0 160 71.6 160 160zM184 232H392c13.3 0 24 10.7 24 24s-10.7 24-24 24H184c-13.3 0-24-10.7-24-24s10.7-24 24-24z"></path>
                </svg>
              </div>
            </a>
          </div>
          <div className="font-semibold text-primary dark:text-primary-light cursor-pointer">{name}</div>
          <div className="flex items-center space-x-2 text-xs font-medium">
            {type && <span className="px-2 py-0.5 rounded-md bg-gray-100/50 dark:bg-white/5 text-gray-600 dark:text-gray-200 font-medium">
                {type}
              </span>}
            {defaultValue && <span className="px-2 py-0.5 rounded-md bg-gray-100/50 dark:bg-white/5 text-gray-600 dark:text-gray-200 font-medium">
                <span className="text-gray-400 dark:text-gray-500">default:</span>"{defaultValue}"
              </span>}
            {visibility && <span className="px-2 py-0.5 rounded-md bg-gray-100/50 dark:bg-white/5 text-blue-600 dark:text-blue-300 font-medium">
                {visibility === 'private' ? 'private' : 'public'}
              </span>}
            {unique && <span className="px-2 py-0.5 rounded-md bg-gray-100/50 dark:bg-white/5 text-blue-600 dark:text-blue-300 font-medium">
                unique
              </span>}
            {required && <span className="px-2 py-0.5 rounded-md bg-red-100/50 dark:bg-red-400/10 text-red-600 dark:text-red-300 font-medium">
                required
              </span>}
            {deprecated && <span className="px-2 py-0.5 rounded-md bg-amber-100/50 dark:bg-amber-400/10 text-amber-600 dark:text-amber-300 font-medium">
                deprecated
              </span>}
          </div>
        </div>
      </div>
    </div>
    {children && <div className="mt-4 prose-sm prose-gray dark:prose-invert [&_.prose>p:first-child]:mt-0 [&_.prose>p:last-child]:mb-0">
        {children}
      </div>}
    {rules && <div className="mt-2 prose-sm prose-gray dark:prose-invert [&_.prose>p:first-child]:mt-0 [&_.prose>p:last-child]:mb-0">
        <b>Rules</b>: <span>{rules}</span>
      </div>}
  </div>;

Retrieves all active and non-deleted company records from the database. Supports field selection, dynamic filtering, relation population, and pagination via query parameters.

## Endpoint

```
GET /api/v3/product/company
```

## Authentication

This endpoint requires authentication. Include a valid bearer token in the Authorization header.

**Permission Required**: `company:find-all`

## Query Parameters

<ParamField name={'fields'} type={'string'} visibility={'public'}>
  Comma-separated list of fields to select. If not provided, all fields are returned.

  **Example**: `fields=name,internal,description`
</ParamField>

<ParamField name={'filters'} type={'string'} visibility={'public'}>
  Comma-separated filter conditions using "|" delimiter.

  **Format**: `field|operator|value`

  **Supported Operators**: `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `like`, `ilike`, `in`, `is`

  **Example**: `filters=name|eq|Acme Corp,is_actived|eq|true`
</ParamField>

<ParamField name={'populate'} type={'string'} visibility={'public'}>
  Comma-separated list of relations to populate.

  **Example**: `populate=relation1,relation2`
</ParamField>

<ParamField name={'page'} type={'number'} visibility={'public'}>
  Page number (1-based). If provided, enables pagination mode. Default: 1
</ParamField>

<ParamField name={'pageSize'} type={'number'} visibility={'public'}>
  Page size. Default: 20 when page is provided. Maximum: 1000
</ParamField>

<ParamField name={'maxPageSizeOverride'} type={'number'} visibility={'public'}>
  Maximum page size override. Default: 1000
</ParamField>

<ParamField name={'orderBy'} type={'string'} visibility={'public'}>
  Comma-separated order by clauses.

  **Format**: `field:direction,field2:direction2`

  **Direction**: `asc` or `desc` (default: `asc`)

  **Example**: `orderBy=name:asc,created_at:desc`
</ParamField>

## Response

### Success Response (200 OK)

Returns an array of company records or a paginated result if `page` parameter is provided.

```json theme={null}
{
  "message": "Data retrieved successfully",
  "data": [
    {
      "document_id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Acme Corporation",
      "internal": "ACME",
      "description": "A leading technology company",
      "image": "https://example.com/logo.png",
      "is_actived": true,
      "is_deleted": false,
      "created_at": "2024-01-01T00:00:00.000Z",
      "updated_at": "2024-01-01T00:00:00.000Z",
      "deleted_at": null
    }
  ],
  "meta": {
    "correlation": "29146752-ef3a-4569-b397-ff2144412c4a",
    "status": 200,
    "timestamp": "2024-01-01T00:00:00.000Z"
  }
}
```

### Paginated Response (200 OK)

When `page` parameter is provided:

```json theme={null}
{
  "message": "Data retrieved successfully",
  "data": {
    "items": [...],
    "pagination": {
      "currentPage": 1,
      "itemsPerPage": 20,
      "totalItems": 100,
      "totalPages": 5
    }
  },
  "meta": {
    "correlation": "29146752-ef3a-4569-b397-ff2144412c4a",
    "status": 200,
    "timestamp": "2024-01-01T00:00:00.000Z"
  }
}
```

### Error Responses

**400 Bad Request** - Invalid filter or orderBy format

```json theme={null}
{
  "message": "Invalid filters format",
  "error": "Invalid operator: xyz",
  "hint": "Format: field|operator|value. Example: field|eq|value",
  "meta": {
    "correlation": "...",
    "status": 400,
    "timestamp": "..."
  }
}
```

**401 Unauthorized** - Missing or invalid authentication token

**403 Forbidden** - Insufficient permissions

## Examples

### Basic Request

```bash theme={null}
curl -X GET 'https://api.bbrands.io/api/v3/product/company' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### With Filters

```bash theme={null}
curl -X GET 'https://api.bbrands.io/api/v3/product/company?filters=name|like|Acme,is_actived|eq|true' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### With Pagination

```bash theme={null}
curl -X GET 'https://api.bbrands.io/api/v3/product/company?page=1&pageSize=10&orderBy=name:asc' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### With Field Selection

```bash theme={null}
curl -X GET 'https://api.bbrands.io/api/v3/product/company?fields=name,internal,description' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```
