commercetools Categories API

Organize products into hierarchical category structures.

Operations 6

GET /{projectKey}/categories List categories #
POST /{projectKey}/categories Create a category #
GET /{projectKey}/categories/{id} Get a category by ID #
POST /{projectKey}/categories/{id} Update a category by ID #
DELETE /{projectKey}/categories/{id} Delete a category by ID #
POST /{projectKey}/categories/import-containers/{importContainerKey} Import categories #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/commercetools-categories-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

commercetools-categories-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Commercetools Categories API
  version: '1.0'
  contact:
    name: commercetools Support
    url: https://support.commercetools.com
  termsOfService: https://commercetools.com/terms-conditions
  description: 'Operations tagged Categories across 2 of this provider''s published API definitions: commercetools-http-api-openapi.yml, commercetools-import-api-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.{region}.commercetools.com
  description: Production Server
  variables:
    region:
      default: us-central1.gcp
      enum:
      - us-central1.gcp
      - us-east-2.aws
      - europe-west1.gcp
      - eu-central-1.aws
      - australia-southeast1.gcp
      description: The deployment region for the commercetools API.
- url: https://import.{region}.commercetools.com
  description: Production Import Server
  variables:
    region:
      default: us-central1.gcp
      enum:
      - us-central1.gcp
      - us-east-2.aws
      - europe-west1.gcp
      - eu-central-1.aws
      - australia-southeast1.gcp
      description: The deployment region.
security:
- bearerAuth: []
tags:
- name: Categories
  description: Organize products into hierarchical category structures.
paths:
  /{projectKey}/categories:
    get:
      operationId: listCategories
      summary: List categories
      description: Returns a paginated list of all categories in the project. Categories can be filtered and sorted using standard query predicates. Use parent references to reconstruct the category hierarchy.
      tags:
      - Categories
      parameters:
      - $ref: '#/components/parameters/projectKey'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      - $ref: '#/components/parameters/where'
      - $ref: '#/components/parameters/sortQuery'
      - $ref: '#/components/parameters/expand'
      responses:
        '200':
          description: A paged list of categories.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CategoryPagedQueryResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      operationId: createCategory
      summary: Create a category
      description: Creates a new category. Categories support localized names, slugs, and metadata, and can optionally reference a parent category to build a hierarchy.
      tags:
      - Categories
      parameters:
      - $ref: '#/components/parameters/projectKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CategoryDraft'
      responses:
        '201':
          description: The created category.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Category'
        '400':
          $ref: '#/components/responses/BadRequest'
    servers:
    - url: https://api.{region}.commercetools.com
      description: Production Server
      variables:
        region:
          default: us-central1.gcp
          enum:
          - us-central1.gcp
          - us-east-2.aws
          - europe-west1.gcp
          - eu-central-1.aws
          - australia-southeast1.gcp
          description: The deployment region for the commercetools API.
  /{projectKey}/categories/{id}:
    get:
      operationId: getCategoryById
      summary: Get a category by ID
      description: Retrieves a single category by its system-generated unique identifier, including its ancestors array representing the full path to the root category.
      tags:
      - Categories
      parameters:
      - $ref: '#/components/parameters/projectKey'
      - $ref: '#/components/parameters/id'
      - $ref: '#/components/parameters/expand'
      responses:
        '200':
          description: The requested category.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Category'
        '404':
          $ref: '#/components/responses/NotFound'
    post:
      operationId: updateCategoryById
      summary: Update a category by ID
      description: Applies update actions to the category with the given ID. Supported actions include changing the name, slug, parent, order hint, and custom fields.
      tags:
      - Categories
      parameters:
      - $ref: '#/components/parameters/projectKey'
      - $ref: '#/components/parameters/id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CategoryUpdate'
      responses:
        '200':
          description: The updated category.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Category'
    delete:
      operationId: deleteCategoryById
      summary: Delete a category by ID
      description: Permanently deletes the category with the given ID. The current version must be provided. Categories with children or product assignments cannot be deleted until those references are removed.
      tags:
      - Categories
      parameters:
      - $ref: '#/components/parameters/projectKey'
      - $ref: '#/components/parameters/id'
      - $ref: '#/components/parameters/version'
      responses:
        '200':
          description: The deleted category.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Category'
    servers:
    - url: https://api.{region}.commercetools.com
      description: Production Server
      variables:
        region:
          default: us-central1.gcp
          enum:
          - us-central1.gcp
          - us-east-2.aws
          - europe-west1.gcp
          - eu-central-1.aws
          - australia-southeast1.gcp
          description: The deployment region for the commercetools API.
  /{projectKey}/categories/import-containers/{importContainerKey}:
    post:
      operationId: importCategories
      summary: Import categories
      description: Submits a batch of category import requests for asynchronous processing. Categories are matched by key for upsert behavior. Parent category references are resolved after all categories in the batch are processed.
      tags:
      - Categories
      parameters:
      - $ref: '#/components/parameters/projectKey_2'
      - $ref: '#/components/parameters/importContainerKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CategoryImportRequest'
      responses:
        '201':
          description: The import request was accepted for processing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportResponse'
        '400':
          $ref: '#/components/responses/BadRequest_2'
    servers:
    - url: https://import.{region}.commercetools.com
      description: Production Import Server
      variables:
        region:
          default: us-central1.gcp
          enum:
          - us-central1.gcp
          - us-east-2.aws
          - europe-west1.gcp
          - eu-central-1.aws
          - australia-southeast1.gcp
          description: The deployment region.
components:
  responses:
    BadRequest:
      description: The request was malformed or contained invalid parameters.
      content:
        application/json:
          schema:
            type: object
            properties:
              statusCode:
                type: integer
              message:
                type: string
              errors:
                type: array
                items:
                  type: object
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            type: object
            properties:
              statusCode:
                type: integer
              message:
                type: string
    Unauthorized:
      description: The request lacked valid authentication credentials.
      content:
        application/json:
          schema:
            type: object
            properties:
              statusCode:
                type: integer
              message:
                type: string
    BadRequest_2:
      description: The request was malformed or contained invalid parameters.
      content:
        application/json:
          schema:
            type: object
            properties:
              statusCode:
                type: integer
              message:
                type: string
  parameters:
    sortQuery:
      name: sort
      in: query
      required: false
      schema:
        type: string
      description: Sort expression string (e.g., 'createdAt desc'). Multiple sort expressions can be provided as separate parameters.
    expand:
      name: expand
      in: query
      required: false
      schema:
        type: string
      description: Reference expansion path to inline referenced resources in the response (e.g., 'productType', 'categories[*]').
    version:
      name: version
      in: query
      required: true
      schema:
        type: integer
        minimum: 1
      description: Current version of the resource for optimistic concurrency control.
    projectKey:
      name: projectKey
      in: path
      required: true
      schema:
        type: string
      description: The unique key identifying the commercetools project.
    id:
      name: id
      in: path
      required: true
      schema:
        type: string
      description: The system-generated unique identifier of the resource.
    where:
      name: where
      in: query
      required: false
      schema:
        type: string
      description: Query predicate string for filtering results. Uses commercetools predicate syntax (e.g., 'customerEmail = "user@example.com"').
    offset:
      name: offset
      in: query
      required: false
      schema:
        type: integer
        minimum: 0
        maximum: 10000
        default: 0
      description: Number of results to skip for pagination. Maximum 10000.
    limit:
      name: limit
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 500
        default: 20
      description: Maximum number of results to return. Defaults to 20, maximum 500.
    importContainerKey:
      name: importContainerKey
      in: path
      required: true
      schema:
        type: string
      description: The user-defined key of the import container.
    projectKey_2:
      name: projectKey
      in: path
      required: true
      schema:
        type: string
      description: The unique key of the commercetools project.
  schemas:
    Reference:
      type: object
      description: A reference to another resource by its typeId and id.
      required:
      - typeId
      - id
      properties:
        typeId:
          type: string
          description: The type identifier of the referenced resource (e.g., 'product', 'category').
        id:
          type: string
          description: The system-generated unique identifier of the referenced resource.
    CategoryUpdate:
      type: object
      description: Request body for updating a category.
      required:
      - version
      - actions
      properties:
        version:
          type: integer
          description: Current version for optimistic concurrency control.
        actions:
          type: array
          items:
            type: object
          description: List of update actions to apply.
    CategoryPagedQueryResponse:
      type: object
      description: Paginated response containing a list of categories.
      required:
      - limit
      - offset
      - count
      - total
      - results
      properties:
        limit:
          type: integer
        offset:
          type: integer
        count:
          type: integer
        total:
          type: integer
        results:
          type: array
          items:
            $ref: '#/components/schemas/Category'
    Category:
      type: object
      description: A category resource for organizing products in a hierarchical structure.
      required:
      - id
      - version
      - name
      - slug
      - ancestors
      - orderHint
      properties:
        id:
          type: string
          description: System-generated unique identifier.
        version:
          type: integer
          description: Current version for optimistic concurrency control.
        key:
          type: string
          description: User-defined unique identifier.
        name:
          $ref: '#/components/schemas/LocalizedString'
        slug:
          $ref: '#/components/schemas/LocalizedString'
        description:
          $ref: '#/components/schemas/LocalizedString'
        parent:
          $ref: '#/components/schemas/Reference'
        ancestors:
          type: array
          items:
            $ref: '#/components/schemas/Reference'
          description: Ordered list of ancestor category references from root to immediate parent.
        orderHint:
          type: string
          description: Decimal string between 0 and 1 for ordering within siblings.
        metaTitle:
          $ref: '#/components/schemas/LocalizedString'
        metaDescription:
          $ref: '#/components/schemas/LocalizedString'
        createdAt:
          type: string
          format: date-time
          description: ISO 8601 timestamp when the category was created.
        lastModifiedAt:
          type: string
          format: date-time
          description: ISO 8601 timestamp when the category was last modified.
    CategoryDraft:
      type: object
      description: Request body for creating a new category.
      required:
      - name
      - slug
      properties:
        key:
          type: string
          description: User-defined unique identifier.
        name:
          $ref: '#/components/schemas/LocalizedString'
        slug:
          $ref: '#/components/schemas/LocalizedString'
        description:
          $ref: '#/components/schemas/LocalizedString'
        parent:
          $ref: '#/components/schemas/Reference'
        orderHint:
          type: string
          description: Decimal string between 0 and 1 for ordering within siblings.
        metaTitle:
          $ref: '#/components/schemas/LocalizedString'
        metaDescription:
          $ref: '#/components/schemas/LocalizedString'
    LocalizedString:
      type: object
      description: A map of locale keys to string values used for multilingual content. Keys follow IETF language tag format (e.g., 'en', 'de', 'en-US').
      additionalProperties:
        type: string
    ImportResponse:
      type: object
      description: The response returned after submitting an import request batch.
      required:
      - operationStatus
      properties:
        operationStatus:
          type: array
          items:
            $ref: '#/components/schemas/ImportOperationStatus'
          description: Status records for each resource in the submitted batch.
    ErrorObject:
      type: object
      description: An error object describing a validation or processing failure.
      required:
      - code
      - message
      properties:
        code:
          type: string
          description: Machine-readable error code.
        message:
          type: string
          description: Human-readable description of the error.
    ImportOperationStatus:
      type: object
      description: The initial status of a single resource submission in an import batch.
      required:
      - resourceKey
      - state
      properties:
        resourceKey:
          type: string
          description: User-defined key of the resource submitted.
        state:
          type: string
          enum:
          - Accepted
          - ValidationFailed
          description: Initial state of the operation after submission.
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorObject'
          description: Immediate validation errors if the resource failed submission.
    CategoryImport:
      type: object
      description: A single category resource for import.
      required:
      - key
      - name
      - slug
      properties:
        key:
          type: string
          description: User-defined key for matching against existing categories.
        name:
          type: object
          description: Localized name of the category.
        slug:
          type: object
          description: Localized URL-friendly slug.
        description:
          type: object
          description: Localized description of the category.
        parent:
          type: object
          description: Reference to parent category by key.
        orderHint:
          type: string
          description: Decimal ordering hint between 0 and 1.
    CategoryImportRequest:
      type: object
      description: A batch of category resources to import.
      required:
      - type
      - resources
      properties:
        type:
          type: string
          enum:
          - category
          description: The resource type identifier.
        resources:
          type: array
          maxItems: 20
          items:
            $ref: '#/components/schemas/CategoryImport'
          description: Up to 20 category resources.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: OAuth 2.0 Bearer token obtained from the commercetools authentication service at https://auth.{region}.commercetools.com/oauth/token using client credentials flow.
x-refined-from:
- commercetools-http-api-openapi.yml
- commercetools-import-api-openapi.yml