Skip to main content

Get Category

This endpoint retrieves detailed information about a specific category using its unique ID.

Endpoint

  • URL: /categories/{id}
  • Method: GET

Replace {id} with the specific category ID you want to retrieve.

Authentication

  • Header: accessToken
  • Type: Bearer Token
  • Value: <ACCESS-TOKEN>

Path Parameters

ParameterTypeDescription
idstringThe unique identifier of the category to retrieve.

Request Headers

HeaderTypeDescription
accessTokenstringAccess token for authentication. (required)

Sample Request

curl --location '<BASE-URL>/categories/66acedf2bf8641f96544253b' \
--header 'accessToken: <ACCESS-TOKEN>'

Response

  • Status Code: 200 OK

Sample Response Body

{
"success": true,
"data": {
"createdAt": "2024-08-02T14:32:18.344Z",
"hasChildren": false,
"hasParent": false,
"isShow": false,
"metaFields": [],
"name": "Materials",
"parentCategory": null,
"path": "66acedf2bf8641f96544253b",
"productCount": 0,
"sortOrder": 0,
"updatedAt": "2024-10-09T13:05:59.036Z",
"url": "materials.html",
"id": "66acedf2bf8641f96544253b"
}
}

Response Fields

FieldTypeDescription
successbooleanIndicates whether the request was successful.
dataobjectContains detailed information about the category.

Category Object

FieldTypeDescription
createdAtstringTimestamp when the category was created (ISO 8601 format).
hasChildrenbooleanIndicates if the category has children.
hasParentbooleanIndicates if the category has a parent.
isShowbooleanFlag indicating if the category is visible.
metaFieldsarrayList of additional metadata fields, currently empty.
namestringName of the category.
parentCategorystring?ID of the parent category, if applicable.
pathstringThe hierarchical path representation of the category.
productCountnumberNumber of products in the category.
sortOrdernumberOrder for sorting categories.
updatedAtstringTimestamp when the category was last updated (ISO 8601 format).
urlstringURL path segment for the category.
idstringUnique identifier of the category.

Notes

  • Ensure the accessToken is valid and included in the request header for authentication.
  • This endpoint retrieves detailed information for a single category based on the provided ID.