Admin Catalog: Attributes
Upload an option swatch image
Changed onStores 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
- Base URLhttp://localhost:8000/api/admin
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
attributeIdinteger required
Example:23
Attribute ID.
optionIdinteger required
Example:45
Option ID.
Request body multipart/form-data
Example request
{
"swatch_file_name": "navy-blue",
"swatch_alt": "Navy blue fabric",
"locale": "en"
}Response
Swatch stored. Returns the full attribute detail.
Changes
- info
endpoint added
- info