---
description: This API provides the specific Category Details based on ID.
---

# Category Details by ID

<mark style="color:purple;">`GET`</mark> `{{Base_url}}/rest/V1/categories`

This endpoint retrieves detailed information for a specific category by its ID. The response includes metadata such as name, parent ID, active status, position, creation date, custom attributes, and hierarchical details. It’s ideal for obtaining and managing specific category information.

{% tabs %}
{% tab title="Curl" %}
```json
curl --location '{{Base_url}}/rest/V1/categories/73' \
--header 'Authorization: Bearer eyJraWQiOiIxIiwiYWxnIjoiSFMyNTYifQ.eyJ1aWQiOjU1LCJ1dHlwaWQiOjIsImlhdCI6MTczNTI5NzMxOCwiZXhwIjoxNzM1MzAwOTE4fQ.6yN-uGjVd1SEbzrLmp8OJywW7ECTUPTpdtqpzcD8qlo' \
--header 'Cookie: PHPSESSID=06uefebf3h3ncaqq0vbiodklgu'
```
{% endtab %}
{% endtabs %}



**Response Codes:**

* **200 OK:** Category details retrieved successfully.
* **401 Unauthorized:** Invalid or missing authentication token.
* **404 Not Found:** Category with the specified ID does not exist.

**Responses**

{% tabs %}
{% tab title="Success Response 200" %}
```json
{
    "id": 73,
    "parent_id": 2,
    "name": "Electronics",
    "is_active": true,
    "position": 2,
    "level": 2,
    "children": "15,21,44,69,78,87,88,92,162,281,723,811",
    "created_at": "2021-09-15 06:23:21",
    "updated_at": "2024-12-06 07:28:44",
    "path": "1/2/73",
    "available_sort_by": [
        "name",
        "price"
    ],
    "include_in_menu": true,
    "custom_attributes": [
        {
            "attribute_code": "image",
            "value": "/media/catalog/category/Gift_Cards_1440_360_px__1_3_11.png"
        },
        {
            "attribute_code": "display_mode",
            "value": "PRODUCTS"
        },
        {
            "attribute_code": "is_anchor",
            "value": "1"
        },
        {
            "attribute_code": "path",
            "value": "1/2/73"
        },
        {
            "attribute_code": "children_count",
            "value": "153"
        },
        {
            "attribute_code": "default_sort_by",
            "value": "price"
        },
        {
            "attribute_code": "custom_use_parent_settings",
            "value": "0"
        },
        {
            "attribute_code": "custom_apply_to_products",
            "value": "0"
        },
        {
            "attribute_code": "url_key",
            "value": "electronics"
        },
        {
            "attribute_code": "url_path",
            "value": "electronics"
        },
        {
            "attribute_code": "sw_menu_hide_item",
            "value": "0"
        },
        {
            "attribute_code": "sw_menu_block_left_width",
            "value": "0"
        },
        {
            "attribute_code": "sw_menu_block_right_width",
            "value": "0"
        },
        {
            "attribute_code": "sw_ocat_hide_this_item",
            "value": "0"
        },
        {
            "attribute_code": "ks_include_in_marketplace",
            "value": "0"
        }
    ]
}
```
{% endtab %}
{% endtabs %}

#### **Top-Level Attributes**

1. **id**
   * **Definition**: A unique identifier for the category.
   * **Example**: `"id": 73`
     * The category **Electronics** is uniquely identified by the ID `73`.
2. **parent\_id**
   * **Definition**: The ID of the parent category to which this category belongs.
   * **Example**: `"parent_id": 2`
     * The parent category of **Electronics** is identified by the ID `2`.
3. **name**
   * **Definition**: The display name of the category.
   * **Example**: `"name": "Electronics"`
     * The category is named **Electronics**.
4. **is\_active**
   * **Definition**: Indicates whether the category is active (true) or inactive (false).
   * **Example**: `"is_active": true`
     * The **Electronics** category is active and will appear in the application.
5. **position**
   * **Definition**: Specifies the position of the category among its siblings under the same parent.
   * **Example**: `"position": 2`
     * **Electronics** appears second under its parent category.
6. **level**
   * **Definition**: The hierarchy level of the category in the catalog.
   * **Example**: `"level": 2`
     * **Electronics** is a second-level category.
7. **children**
   * **Definition**: A comma-separated list of IDs for all immediate child categories.
   * **Example**: `"children": "15,21,44,69,78,87,88,92,162,281,723,811"`
     * The **Electronics** category has child categories with IDs `15, 21, 44, etc.`.
8. **created\_at**
   * **Definition**: The date and time when the category was created.
   * **Example**: `"created_at": "2021-09-15 06:23:21"`
     * The **Electronics** category was created on **September 15, 2021, at 6:23 AM UTC**.
9. **updated\_at**
   * **Definition**: The date and time when the category was last updated.
   * **Example**: `"updated_at": "2024-12-06 07:28:44"`
     * The **Electronics** category was last updated on **December 6, 2024, at 7:28 AM UTC**.
10. **path**
    * **Definition**: A hierarchical representation of the category path, listing all parent category IDs.
    * **Example**: `"path": "1/2/73"`
      * The **Electronics** category is a child of ID `2`, which is itself a child of ID `1`.
11. **available\_sort\_by**
    * **Definition**: Lists the sorting options available for products in this category.
    * **Example**: `"available_sort_by": ["name", "price"]`
      * Products in the **Electronics** category can be sorted by **name** or **price**.
12. **include\_in\_menu**
    * **Definition**: Indicates whether the category should be displayed in the navigation menu.
    * **Example**: `"include_in_menu": true`
      * The **Electronics** category will be included in the menu.

***

#### **custom\_attributes**

The `custom_attributes` array contains additional details about the category, specified as key-value pairs.

1. **image**
   * **Definition**: The path to the image representing this category.
   * The image for the **Electronics** category is located at `/media/catalog/category/Gift_Cards_1440_360_px__1_3_11.png`.
2. **display\_mode**
   * **Definition**: Specifies how the category is displayed (e.g., "PRODUCTS").
   * The Electronics category displays products.
3. **is\_anchor**
   * **Definition**: Indicates whether the category acts as an anchor for filtering.
   * The **Electronics** category is an anchor category (value `1` means true).
4. **path**
   * **Definition**: Same as the top-level `path` attribute.
   * **Example**: `"value": "1/2/73"`
5. **children\_count**
   * **Definition**: Total count of all child categories under this category.
   * The **Electronics** category has `153` total child categories.
6. **default\_sort\_by**
   * **Definition**: The default sorting option for products in this category.
   * Products in **Electronics** are sorted by **price** by default.
7. **custom\_use\_parent\_settings**
   * **Definition**: Indicates whether this category inherits settings from its parent.
   * The **Electronics** category does **not** inherit parent settings (value `0`).
8. **custom\_apply\_to\_products**
   * **Definition**: Indicates if custom settings apply to products in this category.
   * Custom settings do **not** apply to products in this category.
9. **url\_key**
   * **Definition**: The unique key for constructing the category URL.
   * The URL key for the **Electronics** category is **electronics**.
10. **url\_path**
    * **Definition**: The full path used in the category URL.
    * **Example**: `"value": "electronics"`
11. **sw\_menu\_hide\_item**
    * **Definition**: Indicates whether this category is hidden in the menu.
    * The **Electronics** category is **not** hidden in the menu (value `0`).
12. **ks\_include\_in\_marketplace**
    * **Definition**: Indicates if the category is included in the marketplace.
    * The **Electronics** category is **not** included in the marketplace.

***

{% tabs %}
{% tab title="Invalid Token  401 " %}
```javascript
{
    "message": "The consumer isn't authorized to access %resources.",
    "parameters": {
        "resources": "Magento_Catalog::categories"
    }
}
```
{% endtab %}

{% tab title="Invalid End Point  404" %}
```python
{
    "message": "No such entity with %fieldName = %fieldValue",
    "parameters": {
        "fieldName": "id",
        "fieldValue": 101
    }
}
```
{% endtab %}
{% endtabs %}
