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

Attributes (admin API)

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

Parameters:

  • page in query (string, optional).
  • pageSize in query (string, optional).
  • productTypeId in query (string, optional).

Responses:

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

Create new attribute

Request body: CreateAttributeAdminDto.

Responses:

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

Delete attribute

Parameters:

  • id in path (string, required).

Responses:

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

Update attribute

Parameters:

  • id in path (string, required).

Request body: UpdateAttributeAdminDto.

Responses:

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

Create attribute value

Parameters:

  • id in path (string, required).

Request body: CreateAttributeValueAdminDto.

Responses:

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

DELETE /v1/admin/attributes/{id}/values/{valueId}

Section titled “DELETE /v1/admin/attributes/{id}/values/{valueId}”

Delete attribute value

Parameters:

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

Responses:

  • 204: Attribute value deleted.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • 404: Value not found.
  • 409: Value in use.

PATCH /v1/admin/attributes/{id}/values/{valueId}

Section titled “PATCH /v1/admin/attributes/{id}/values/{valueId}”

Update attribute value

Parameters:

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

Request body: UpdateAttributeValueAdminDto.

Responses:

  • 200: Attribute value updated.
  • 400: Invalid input.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • 404: Value not found.
  • productTypeId (string, required).
  • name (TranslatableDto, required).
  • code (string, pattern ^[a-z0-9]+(?:[_-][a-z0-9]+)*$, required).
  • sortOrder (number, min 0, optional).
  • value (TranslatableDto, required).
  • code (string, pattern ^[a-z0-9]+(?:[_-][a-z0-9]+)*$, required).
  • sortOrder (number, min 0, optional).
  • fr (string, optional).
  • en (string, optional).
  • ar (string, optional).
  • default (string, required).
As seen on Open Source Alternatives The Merchant Engine badge