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.
GET /v1/admin/product-types
Section titled “GET /v1/admin/product-types”List all product types
Parameters:
pagein query (string, required).pageSizein query (string, required).
Responses:
200: Product types retrieved.401: Unauthorized.403: Insufficient permissions.
POST /v1/admin/product-types
Section titled “POST /v1/admin/product-types”Create new product type
Request body: CreateProductTypeAdminDto.
Responses:
201: Product type created.400: Invalid input.401: Unauthorized.403: Insufficient permissions.
DELETE /v1/admin/product-types/{id}
Section titled “DELETE /v1/admin/product-types/{id}”Delete product type
Parameters:
idin path (string, required).
Responses:
204: Product type deleted.401: Unauthorized.403: Insufficient permissions.404: Product type not found.409: Product type in use.
PATCH /v1/admin/product-types/{id}
Section titled “PATCH /v1/admin/product-types/{id}”Update product type
Parameters:
idin path (string, required).
Request body: UpdateProductTypeAdminDto.
Responses:
200: Product type updated.400: Invalid input.401: Unauthorized.403: Insufficient permissions.404: Product type not found.
Schemas
Section titled “Schemas”CreateProductTypeAdminDto
Section titled “CreateProductTypeAdminDto”name(TranslatableDto, required).code(string, pattern/^[a-z0-9]+(?:[_-][a-z0-9]+)*$/, required).taxClassId(string, optional).
TranslatableDto
Section titled “TranslatableDto”default(string, required).fr(string, optional).en(string, optional).ar(string, optional).