Catalog - Product variants
Create a Product Variant Image
POST /stores/{store_hash}/v3/catalog/products/{product_id}/variants/{variant_id}/image
Request
Creates a Variant Image.
Only one image can be explicitly associated with a Variant. If the Variant already has an associated image, overwrites the existing Variant Image.
The image displays on the storefront when the Variant is selected.
Required Fields
- image_file: Form posts. Files larger than 1 MB are not accepted
- image_url: Any publicly available URL
Authentication
- X-Auth-Token in headerrequired
Parameters
- store_hash in path - string
- Content-Type in header with default of application/json - stringrequired
The MIME type of the request body.
Body
object | application/json
An object containing a publicly accessible image URL, or a form post that contains an image file.
image_urlstring
A public URL for a GIF, JPEG, or PNG image. Limit of 8MB per file.
example
Response
image_url
is returned for both image_file
and image_url
.
Body
object | application/json
Image Response returns for:
- Create Variant Image
- Create Modifier Image
- Create Category Image
- Create Brand Image
dataobject
An object containing a publicly accessible image URL, or a form post that contains an image file.
metaobject
Response metadata.
example
Did you find what you were looking for?