Skip to content
You are reading the pinned copy of v1.0, which is also the latest release. Read the latest.

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.
  • fr (string, optional).
  • en (string, optional).
  • ar (string, optional).
  • default (string, optional).
  • id (string, required).
  • sortOrder (number, min 0, required).
  • fr (string, optional).
  • en (string, optional).
  • ar (string, optional).
  • default (string, required).
As seen on Open Source Alternatives The Merchant Engine badge