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

# Retrieve 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 a single active and non-deleted company record by its document\_id. Supports field selection and relation population via query parameters.

## Endpoint

```
GET /api/v3/product/company/{documentId}
```

## Authentication

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

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

## Path Parameters

<ParamField name={'documentId'} required={true} type={'uuid'} visibility={'public'}>
  The unique document identifier of the company record to retrieve. Must be a valid UUID format.
</ParamField>

## 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={'populate'} type={'string'} visibility={'public'}>
  Comma-separated list of relations to populate.

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

## Response

### Success Response (200 OK)

Returns the requested company record.

```json theme={null}
{
  "message": "Company record 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"
  }
}
```

### Error Responses

**400 Bad Request** - Invalid field provided or invalid UUID format

```json theme={null}
{
  "error": {
    "code": "BAD_REQUEST",
    "message": "Invalid field: 'invalid_field'. The specified field does not exist in the table."
  },
  "meta": {
    "correlation": "...",
    "status": 400,
    "timestamp": "..."
  }
}
```

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

**403 Forbidden** - Insufficient permissions

**404 Not Found** - Record not found, inactive, or deleted

```json theme={null}
{
  "error": {
    "code": "NOT_FOUND",
    "message": "Record with document_id '550e8400-e29b-41d4-a716-446655440000' not found"
  },
  "meta": {
    "correlation": "...",
    "status": 404,
    "timestamp": "..."
  }
}
```

## Examples

### Basic Request

```bash theme={null}
curl -X GET 'https://api.bbrands.io/api/v3/product/company/550e8400-e29b-41d4-a716-446655440000' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```

### With Field Selection

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

### With Relations

```bash theme={null}
curl -X GET 'https://api.bbrands.io/api/v3/product/company/550e8400-e29b-41d4-a716-446655440000?populate=relation1,relation2' \
  -H 'Authorization: Bearer YOUR_TOKEN'
```
