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.

Products (admin API)

Admin routes of the products 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 products (admin)

Parameters:

  • brand in query (string, optional).
  • categoryId in query (string, optional).
  • isFeatured in query (boolean, optional).
  • page in query (number, min 1, optional).
  • pageSize in query (number, min 1, max 100, optional).
  • productTypeId in query (string, optional).
  • search in query (string, optional).
  • sortBy in query (string, optional).

Responses:

  • 200: Products retrieved.
  • 401: Unauthorized.
  • 403: Insufficient permissions.

Create new product

Request body: CreateProductAdminDto.

Responses:

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

Delete product

Parameters:

  • id in path (string, required).

Responses:

  • 204: Product deleted.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • 404: Product not found.

Get product by ID (admin)

Parameters:

  • id in path (string, required).

Responses:

  • 200: Product retrieved.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • 404: Product not found.

Update product

Parameters:

  • id in path (string, required).

Request body: UpdateProductAdminDto.

Responses:

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

Update product assets

Parameters:

  • id in path (string, required).

Request body: UpdateProductAssetsAdminDto.

Responses:

  • 204: Assets updated.
  • 400: Invalid input.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • 404: Product not found.

Create product FAQ

Parameters:

  • id in path (string, required).

Request body: CreateProductFaqAdminDto.

Responses:

  • 201: FAQ created.
  • 400: Invalid input.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • 404: Product not found.

DELETE /v1/admin/products/{id}/faqs/{faqId}

Section titled “DELETE /v1/admin/products/{id}/faqs/{faqId}”

Delete product FAQ

Parameters:

  • faqId in path (string, required).
  • id in path (string, required).

Responses:

  • 204: FAQ deleted.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • 404: FAQ not found.

PATCH /v1/admin/products/{id}/faqs/{faqId}

Section titled “PATCH /v1/admin/products/{id}/faqs/{faqId}”

Update product FAQ

Parameters:

  • faqId in path (string, required).
  • id in path (string, required).

Request body: UpdateProductFaqAdminDto.

Responses:

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

Restore archived product

Parameters:

  • id in path (string, required).

Responses:

  • 200: Product restored.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • 404: Product not found.

Replace product specifications

Parameters:

  • id in path (string, required).

Request body: ReplaceProductSpecsAdminDto.

Responses:

  • 200: Specifications replaced.
  • 400: Invalid input, duplicate or empty folded key.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • 404: Product not found.

Stock for every variant of a product

Parameters:

  • id in path (string, required).

Responses:

  • 200: Stock returned.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • 404: Product not found.

Create product variant

Parameters:

  • id in path (string, required).

Request body: CreateProductVariantAdminDto.

Responses:

  • 201: Variant created.
  • 400: Invalid input.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • 404: Product not found.

DELETE /v1/admin/products/{id}/variants/{variantId}

Section titled “DELETE /v1/admin/products/{id}/variants/{variantId}”

Delete product variant

Parameters:

  • id in path (string, required).
  • variantId in path (string, required).

Responses:

  • 204: Variant deleted.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • 404: Variant not found.
  • 409: Cannot delete last variant.

PATCH /v1/admin/products/{id}/variants/{variantId}

Section titled “PATCH /v1/admin/products/{id}/variants/{variantId}”

Update product variant

Parameters:

  • id in path (string, required).
  • variantId in path (string, required).

Request body: UpdateProductVariantAdminDto.

Responses:

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

Bulk update variant prices

Request body: BulkUpdatePricesAdminDto.

Responses:

  • 204: Prices updated.
  • 400: Invalid input.
  • 401: Unauthorized.
  • 403: Insufficient permissions.

Bulk update product statuses

Request body: BulkUpdateStatusAdminDto.

Responses:

  • 204: Statuses updated.
  • 400: Invalid input.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • assetId (string, required).
  • sortOrder (number, min 0, required).
  • isPrimary (boolean, required).
  • variantId (string, required).
  • price (number, min 0, required).
  • productIds (array of string, required).
  • status (object, required).
  • sku (string, required).
  • price (number, min 0, required).
  • compareAtPrice (number, min 0, optional).
  • costPrice (number, min 0, optional).
  • weight (number, min 0, optional).
  • length (number, min 0, optional).
  • width (number, min 0, optional).
  • height (number, min 0, optional).
  • barcode (string, optional).
  • isDefault (boolean, optional).
  • isActive (boolean, optional).
  • maxDownloads (number, min 1, optional).
  • downloadExpiryDays (number, min 1, optional).
  • licenseKey (string, optional).
  • attributeValueIds (array of string, optional).
  • default (string, optional).
  • fr (string, optional).
  • en (string, optional).
  • ar (string, optional).
  • default (string, required).
  • fr (string, optional).
  • en (string, optional).
  • ar (string, optional).