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

# Get Category by ID

> Retrieve a specific menu category with its hierarchical details

## Purpose

Returns a single category, regardless of whether it is a root or subcategory, and optionally its child nodes.

## HTTP Request

```http theme={null}
GET https://integrations.clopos.com/open-api/v2/categories/{id}
```

<Warning>
  This endpoint requires authentication. Include your JWT in the `x-token` header. See [Authentication](/authentication) for how to obtain a token and [Errors](/errors) for error responses.
</Warning>

## Request Example

<CodeGroup>
  ```bash curl theme={null}
  curl -X GET "https://integrations.clopos.com/open-api/v2/categories/1?include_children=true" \
    -H "x-token: oauth_example_token" \
  ```

  ```javascript javascript theme={null}
  const response = await fetch('https://integrations.clopos.com/open-api/v2/categories/1?include_children=true', {
    headers: {
      'x-token': 'oauth_example_token',
    }
  });

  const category = await response.json();
  ```

  ```python python theme={null}
  import requests

  url = "https://integrations.clopos.com/open-api/v2/categories/1"
  headers = {
      "x-token": "oauth_example_token",
  }
  params = {
      "include_children": True
  }

  response = requests.get(url, headers=headers, params=params)
  category = response.json()
  ```
</CodeGroup>

## Response

### 200 OK — Category found

```json theme={null}
{
  "success": true,
  "data": {
    "id": 1,
    "name": "Pizza",
    "status": 1,
    "hidden": false,
    "type": "PRODUCT",
    "position": null,
    "parent_id": null,
    "depth": 0,
    "color": "00bcd4",
    "children": [],
    "media": [
      {
        "uuid": "1d76f22b-c209-4fac-be3a-cfde7b8f0d74",
        "mime_type": "image/jpeg",
        "size": 87281,
        "urls": {
          "original": "https://cdn.clopos.com/omega/1d76f22b-.../original.jpg",
          "extra_large": "https://cdn.clopos.com/omega/1d76f22b-.../extra_large.jpg",
          "thumb": "https://cdn.clopos.com/omega/1d76f22b-.../thumb.jpg"
        },
        "blur_hash": "LEIpFsE%t1}TxpENEgaK0iowRktQ",
        "dimensions": {
          "width": 612,
          "height": 459
        }
      }
    ],
    "created_at": "2026-01-28T18:23:53.000000Z",
    "updated_at": "2026-01-28T18:23:53.000000Z"
  }
}
```

### 404 Not Found — Category does not exist

```json theme={null}
{
  "success": false,
  "error": "resource_not_found",
  "message": "Category not found"
}
```

## Field Reference

### Category Object

| Field        | Type               | Description                                                                                                    |
| ------------ | ------------------ | -------------------------------------------------------------------------------------------------------------- |
| `id`         | integer            | Unique identifier.                                                                                             |
| `name`       | string             | Category name.                                                                                                 |
| `status`     | integer            | `1` = active, `0` = inactive.                                                                                  |
| `type`       | string             | `PRODUCT`, `INGREDIENT`, or `ACCOUNTING`.                                                                      |
| `position`   | integer (nullable) | Display order position.                                                                                        |
| `parent_id`  | integer (nullable) | Parent category ID, `null` for root categories.                                                                |
| `_lft`       | integer            | Left boundary in the nested-set tree. Useful for ordering and subtree queries.                                 |
| `_rgt`       | integer            | Right boundary in the nested-set tree. A category's descendants have `_lft` and `_rgt` values between its own. |
| `depth`      | integer            | Hierarchy level (`0` = root).                                                                                  |
| `color`      | string             | HEX color code (without `#` prefix).                                                                           |
| `hidden`     | boolean            | Whether the category is hidden from menus.                                                                     |
| `children`   | array              | Subcategories (same structure, nested recursively).                                                            |
| `media`      | array              | Image attachments. See [Media object](/common-objects#media).                                                  |
| `created_at` | string             | Creation timestamp (ISO 8601).                                                                                 |
| `updated_at` | string             | Last update timestamp (ISO 8601).                                                                              |

## Notes

* The `include_children=false` parameter returns only a single category record; recommended for performance in large trees.
* The returned `children` array recursively uses the same schema; be careful when processing the tree structure repeatedly on the client side.
* Based on the `type` field in the response, you can read menu, ingredient, or accounting categories from the same endpoint.
* If the category is not found, it returns `404`; add fallback or remapping logic on the client side.
