Admin Catalog: Attributes

Upload an option swatch image

Changed on

Stores the image as the option's swatch value. Only for attributes whose swatch type is image. Send multipart/form-data with swatch_value (bmp, jpeg, jpg, png, webp). Optional swatch_file_name names the stored file and swatch_alt is saved for the locale sent (or the default locale). Returns the full attribute detail.

post/catalog/attributes/{attributeId}/options/{optionId}/swatch

Request

Path parameters

attributeIdinteger required
Example:23

Attribute ID.

optionIdinteger required
Example:45

Option ID.

Request body multipart/form-data

swatch_valuestring binary required
swatch_file_namestring
swatch_altstring
localestring

Example request

{
  "swatch_file_name": "navy-blue",
  "swatch_alt": "Navy blue fabric",
  "locale": "en"
}

Response

Swatch stored. Returns the full attribute detail.

Changes