Skip to main content

Get All Categories

Retrieves a list of categories. You can filter the list by name, parent category, position in the category tree, visibility, IDs, dates and metafield values.

HTTP Request​

  • URL: /categories
  • Method: GET
  • Headers:
    • accessToken: Required. Your API access token.
  • Required scope: READ_CATEGORY or READ_WRITE_CATEGORY

Query Parameters​

ParameterTypeDescription
pageIntegerPage number to return. Default is 1.
limitIntegerNumber of categories per page. Default is 10.
nameStringFilter categories whose name contains this text (case-insensitive).
parentIdStringReturn the direct subcategories of this category.
parentId:inStringComma-separated list of parent category IDs.
isVisibleBooleanFilter by storefront visibility: true or false.
hasParentBooleantrue returns subcategories; false returns top-level categories.
hasChildrenBooleantrue returns categories that have subcategories; false returns the rest.
idStringReturn only the category with this ID.
id:inStringComma-separated list of category IDs to return.
date_created:minStringReturn categories created on or after this date (for example 2024-05-01).
date_created:maxStringReturn categories created on or before this date.
date_modified:minStringReturn categories last updated on or after this date.
date_modified:maxStringReturn categories last updated on or before this date.
metafields:<code>StringFilter categories whose metafield <code> equals this value, for example metafields:category_pim_id=1045.
metafields-in:<code>StringFilter categories whose metafield <code> matches any of these comma-separated values, for example metafields-in:category_pim_id=1045,1046.

cURL Example​

curl --location '<BASE_URL>/categories?parentId=663a0cbe516313e5bc94aa87&isVisible=true&limit=50' \
--header 'accessToken: <ACCESS_TOKEN>'

Response​

  • 200 OK: The list of categories was returned successfully.
  • 400 Bad Request: The access token is missing, invalid or lacks the required scope, or a filter value is not valid.

Sample JSON Response​

{
"success": true,
"data": [
{
"id": "66acedf2bf8641f96544253b",
"name": "Cordless Drills",
"url": "cordless-drills",
"description": "Battery-powered drills and drivers.",
"image": "https://cdn.example.com/categories/cordless-drills.webp",
"parentCategory": "663a0cbe516313e5bc94aa87",
"path": "/663a0cbe516313e5bc94aa87/66acedf2bf8641f96544253b/",
"hasParent": true,
"hasChildren": false,
"productCount": 42,
"sortOrder": 0,
"isFeatured": false,
"isShow": true,
"isShowNavBar": false,
"seo": {
"pageTitle": "Cordless Drills",
"metaKeywords": "cordless, drill",
"metaDescription": "Shop cordless drills."
},
"metaFields": [],
"createdAt": "2024-08-02T14:32:18.344Z",
"updatedAt": "2024-10-09T13:05:59.036Z"
}
],
"pagination": {
"page": 1,
"total": 1,
"count": 1
}
}

Response Details​

Category Data​

Each item in data is a category. See Get Category for the full list of category fields.

FieldTypeDescription
idStringUnique identifier of the category.
nameStringName of the category.
urlStringURL slug of the category page on the storefront.
parentCategoryStringID of the parent category.
hasParentBooleanWhether the category has a parent category.
hasChildrenBooleanWhether the category has subcategories.
isShowBooleanWhether the category is visible on the storefront.

Pagination Details​

FieldTypeDescription
pageNumberCurrent page number.
totalNumberTotal number of categories matching the filters.
countNumberNumber of categories returned on this page.

Notes​

  • Metafield values are matched as text. If you pass more than one metafield filter, categories matching any of them are returned. See Metafields for the available codes.
  • Use ISO 8601 dates (for example 2024-05-01 or 2024-05-01T00:00:00Z) in date filters.