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.

Product types (admin API)

Admin routes of the product types 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.

List all product types

Parameters:

  • page in query (string, required).
  • pageSize in query (string, required).

Responses:

  • 200: Product types retrieved.
  • 401: Unauthorized.
  • 403: Insufficient permissions.

Create new product type

Request body: CreateProductTypeAdminDto.

Responses:

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

Delete product type

Parameters:

  • id in path (string, required).

Responses:

  • 204: Product type deleted.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • 404: Product type not found.
  • 409: Product type in use.

Update product type

Parameters:

  • id in path (string, required).

Request body: UpdateProductTypeAdminDto.

Responses:

  • 200: Product type updated.
  • 400: Invalid input.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • 404: Product type not found.
  • name (TranslatableDto, required).
  • code (string, pattern /^[a-z0-9]+(?:[_-][a-z0-9]+)*$/, required).
  • taxClassId (string, optional).
  • default (string, required).
  • fr (string, optional).
  • en (string, optional).
  • ar (string, optional).