List Categories

List all categories in the shop

🔒

Requires read_product access scope. More access scope

The List Categories API retrieve a list of all product categories in the shop.

This API is especially useful for:

  1. Fetching a complete hierarchy of product categories.
  2. Filtering categories by parent ID or specific category IDs.
  3. Building navigation menus or category-based product filters.

Request Parameters

Public Request Parameters

📘

Path Parameters

ParameterTypeRequiredDescriptionExample
pidstringNoParent category ID to filter child categoriespid=12345
idsarray of stringsNoSpecific category IDs to retrieveids=["1001","1002"]

Response Explanation

Public Response Parameters

📘

Successful Response

ParameterTypeExampleDescription
codestring"success"Status code of the API response
messagestring"Categories retrieved successfully"Descriptive message about the response
data.categoriesarray of objects-Array containing all category objects
data.categories.idstring"1001"Unique identifier for the category
data.categories.namestring"Electronics"Display name of the category
data.categories.pidstring"12345"Parent category ID (empty for root categories)
data.categories.levelint322Depth level in category hierarchy
data.categories.positionint323Sort order position within its level
data.categories.pathstring"1.12.1001"Full hierarchical path of the category
data.categories.google_idint32123456789Corresponding Google product category ID

Error Response

FieldTypeExampleDescription
codestringInvalidParameterError http message
messagestring``Error message

API Structure Overview

Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!