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

# GetCategoryById

> Retrieves a single category by its ID.



**query** `GetCategoryById(categoryId: ID!): CategoryDetails!`

## Arguments

**`categoryId`**: `ID!` (required)

## Returns

`CategoryDetails!`

**`id`**: `ID!`

The ID of the category.

---

**`parentId`**: `ID`

The ID of the parent category.

---

**`sortNumber`**: `Int!`

The sort number of the category.

---

**`descriptions`**: `[CategoryDetailsDescription!]!`

The descriptions of the category.

---

**`activeSalesChannelIds`**: `[ID]!`

The sales channels this category is activated for. Tenant-local, composite identifiers, not UUIDs. Valid values are listed by the sales channel endpoint (GET). May be empty.

## Examples

```graphql Query
query GetCategoryById($categoryId: ID!) {
  GetCategoryById(categoryId: $categoryId) {
    id
    parentId
    sortNumber
    descriptions {
      categoryId
      salesChannelId
      languageId
      name
      description
      metaDescription
    }
    activeSalesChannelIds
  }
}
```

```json Variables
{
  "categoryId": "id"
}
```

```json Response
{
  "data": {
    "GetCategoryById": {
      "id": "id",
      "parentId": "id",
      "sortNumber": 1,
      "descriptions": [
        {
          "categoryId": "id",
          "salesChannelId": "id",
          "languageId": "id",
          "name": "string",
          "description": "string",
          "metaDescription": "string"
        }
      ],
      "activeSalesChannelIds": [
        "id"
      ]
    }
  }
}
```
