Adds media items to a specified product, either via URL or existing media ID.
NOTE: The URL is not validated and no event is triggered to indicate if the media was added successfully.
You can only call this method when authenticated as a Wix app or Wix user identity.
function addProductMedia(
_id: string,
media: Array<MediaDataForWrite>,
): Promise<void>;
Product ID.
Sources of media items already uploaded to the Wix site.
import { products } from "@wix/stores";
async function addProductMedia(id, media) {
const response = await products.addProductMedia(id, media);
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.