Skip to content
You are reading the unreleased documentation. No version is released yet, and these pages describe code that is not in a release.

Categories (admin API)

Admin routes of the categories module. Every route needs a staff session and the permission named on it; send X-Resolve-Locale: false to receive every locale of a translatable field for editing.

Get category tree (admin)

Responses:

  • 200: Category tree retrieved.
  • 401: Unauthorized.
  • 403: Insufficient permissions.

Create category

Request body: CreateCategoryAdminDto.

Responses:

  • 201: Category created.
  • 400: Invalid input.
  • 401: Unauthorized.
  • 403: Insufficient permissions.

Delete category

Parameters:

  • id in path (string, required).

Responses:

  • 204: Category deleted.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • 404: Category not found.
  • 409: Category has products.

Update category

Parameters:

  • id in path (string, required).

Request body: UpdateCategoryAdminDto.

Responses:

  • 200: Category updated.
  • 400: Invalid input.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • 404: Category not found.

Reorder categories

Request body: ReorderCategoriesAdminDto.

Responses:

  • 204: Categories reordered.
  • 400: Invalid input.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • default (string, optional).
  • fr (string, optional).
  • en (string, optional).
  • ar (string, optional).
  • id (string, required).
  • sortOrder (number, min 0, required).
  • default (string, required).
  • fr (string, optional).
  • en (string, optional).
  • ar (string, optional).