Skip to main content

Get Children Categories

Retrieves the child categories of a specified category ID with pagination support.

Request

POST /v2/admin/categories/{categoryID}/children/search

Parameters

NameTypeInDescription
categoryIDstringpathRequired. The ID of the parent category

Headers

NameDescription
AuthorizationRequired. Bearer token for authentication
Content-TypeRequired. Must be application/json

Request Body

FieldTypeDescriptionValidation
pageintegerRequired. Page numberMust be greater than or equal to 1
per_pageintegerRequired. Number of items per pageMust be between 1 and 100

Example

curl --request POST \
--url '\{\{baseUrl\}\}/v2/admin/categories/123456789/children/search' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' \
--header 'Content-Type: application/json' \
--data '{
"page": 1,
"per_page": 10
}'

Response

{
"data": [
{
"id": "987654321",
"parent_id": "123456789",
"name": {
"en": "Smartphones",
"tr": "Akıllı Telefonlar"
},
"path": "electronics/smartphones",
"int_id": 2,
"image_svg": "data:image/svg+xml;base64,...",
"is_leaf": true,
"created_at": "2024-03-20T10:00:00Z"
}
],
"total": 1,
"page": 1,
"per_page": 10
}

Response Fields

Pagination Object

FieldTypeDescription
dataarrayArray of category objects
totalintegerTotal number of items
pageintegerCurrent page number
per_pageintegerNumber of items per page

Category Object

FieldTypeDescription
idstringUnique ID of the category
parent_idstringParent category ID
nameobjectCategory name translations
name.enstringCategory name in English
name.trstringCategory name in Turkish
pathstringURL path of the category
int_idintegerNumeric ID of the category
image_svgstringSVG data of the category icon
is_leafbooleanWhether the category contains subcategories
created_atstringCategory creation date

Status Codes

Status CodeDescription
200Success - Child categories retrieved successfully
400Bad Request - Invalid request parameters
401Unauthorized - Invalid or missing authentication token
404Not Found - Parent category does not exist
500Internal Server Error