Skip to main content

Set Attribute Option Swatch

POST 

/api/attributes/:attributeId/option-swatch

Sets the swatch (image URL and/or colour hex) on a single option value of an attribute, creating the option value if it does not exist yet. The swatch is shared by every product variant that selects this value.

Request body:

  • value (string, required): the option value to attach the swatch to, e.g. "Blue".
  • swatch_image_url (string, optional): public image URL for the swatch (max 500 chars).
  • swatch_hex (string, optional): colour hex for the swatch (max 20 chars).

Authentication: Requires Bearer token.

Request

Responses

OK

Response Headers
    Content-Type