Search.../
  1. Home
  2. Getting Started
  3. Overview
Generate a test token to explore our APIs

Add Product Media To Choices

Developer Preview

Links media items that are already associated with a specific product to a choice within the same product.

Media items can only be set for choices within one option at a time - e.g., if you set media items for some or all of the choices within the Colors option (blue, green, and red), you won't be able to also assign media items to choices within the Size option (S, M, and L).

To remove all existing media items, call the Remove Product Media From Choices endpoint.

Authorization

This endpoint requires an authorization header - pass the access token from the OAuth installation flow.

Permissions

This endpoint requires the Manage Products permission scope.

PATCH

https://www.wixapis.com/stores/v1/products/{id}/choices/media

Path Params

NAME
TYPE
DESCRIPTION
id
Required

string

Product ID.

Body Params

NAME
TYPE
DESCRIPTION
media

Array<object>

Response Object

Returns an empty object.

Status/Error Codes

The response will include an HTTP status code.

Was this helpful?

Request

curl

Copy Code
1curl -X POST \
2 'https://www.wixapis.com/stores/v1/products/1044e7e4-37d1-0705-c5b3-623baae212fd/choices/media' \
3 --data-binary '{
4 "option": "Color",
5 "choice": "blue",
6 "mediaIds": [
7 "9cc22d8b8d5244aba9ed73fb1783fc26.jpg",
8 "fljseif3l4ij3l4ijl3r32fwfwf23234.jpg"
9 ]
10 }' \
11 -H 'Content-Type: application/json' \
12 -H 'Authorization: <AUTH>'

Response

json

1
2{}