> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# RemoveProductMediaFromChoices

# Package: catalogV1

# Namespace: CatalogWriteApi

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/catalog/remove-product-media-from-choices.md

## Permission Scopes:
Manage Products: SCOPE.DC-STORES.MANAGE-PRODUCTS

## Introduction

Removes media items from all or some of a product's choices.
(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).)

---

## REST API

### Schema

```
 Method: removeProductMediaFromChoices
 Description: Removes media items from all or some of a product's choices. (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).)
 URL: https://www.wixapis.com/stores/v1/products/{id}/choices/media/delete
 Method: POST
 Method parameters:
   param name: media | type: array<media> | description: Media to remove from choices.  | validation: minItems 1, maxItems 10
              - name: option | type: string | description: Option name.  | validation: minLength 1, maxLength 50
              - name: choice | type: string | description: Choice name.  | validation: minLength 1, maxLength 50
              - name: mediaIds | type: array<string> | description: Media GUIDs (available via the Query Product endpoint).  | validation: maxItems 50
 Return type: RemoveProductMediaFromChoicesResponse
  EMPTY-OBJECT {}


```

### Examples

### RemoveProductMediaFromChoices
```curl
~~~cURL
curl -X POST \
   'https://www.wixapis.com/stores/v1/products/1044e7e4-37d1-0705-c5b3-623baae212fd/choices/media/delete' \
    --data-binary '{
                     "option": "Color",
                     "choice": "blue",
                     "mediaIds": [
                         "9cc22d8b8d5244aba9ed73fb1783fc26.jpg",
                         "fljseif3l4ij3l4ijl3r32fwfwf23234.jpg"
                     ]
                   }' \
   -H 'Content-Type: application/json' \
   -H 'Authorization: <AUTH>'
~~~
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.stores.products.removeProductMediaFromChoices(_id, media)
 Description: Removes media items from all or some of a product's choices. (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).)
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  _id, media
 Method parameters: 
   param name: _id | type: string | description: Product GUID from whose choices to remove media items. | required: true 
   param name: media | type: array<MediaAssignmentToChoice> | description: Media to remove from choices. | required: true | validation: minItems 1, maxItems 10
              - name: option | type: string | description: Option name.  | validation: minLength 1, maxLength 50
              - name: choice | type: string | description: Choice name.  | validation: minLength 1, maxLength 50
              - name: mediaIds | type: array<string> | description: Media GUIDs (available via the Query Product endpoint).  | validation: maxItems 50
 Return type: PROMISE<RemoveProductMediaFromChoicesResponse>
  EMPTY-OBJECT {}


```

### Examples

### Remove media items from product choices
```javascript
/**************************************
 * Backend code - products.web.js/ts *
 **************************************/

import { Permissions, webMethod } from '@wix/web-methods';
import { products } from '@wix/stores';

export const removeProductMediaFromChoices = webMethod(Permissions.Anyone, (_id, media) => {
  return products.removeProductMediaFromChoices(_id, media);
});

/*************
 * Page code *
 *************/
import { removeProductMediaFromChoices } from 'backend/products.web';

// ...

const _id = "1a11aaa3-...-111a1aaa111";
const media = [{
  "option": "Color",
  "choice": "Blue"
}];

removeProductMediaFromChoices(_id, media)
  .then(() => {
    // media items removed from the product choices 
  })
  .catch(error => {
    // media items not removed from the product choices
  });

```

### removeProductMediaFromChoices (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { products } from '@wix/stores';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { products },
  // Include the auth strategy and host as relevant
});


async function removeProductMediaFromChoices(_id,media) {
  const response = await myWixClient.products.removeProductMediaFromChoices(_id,media);
};
```

---