Skip to main content
mutation

Requires write_products access scope. Also: The user must have a permission to create media for a product.

Deprecated. Use productUpdate or productSet instead.

Adds media files to a Product, such as images, videos, or 3D models. Media files enhance product listings by providing visual representations that help customers understand the product.

The mutation accepts an array of CreateMediaInput objects, each specifying the source URL, content type, and optional alt text.

You can add multiple media files in a single request. The mutation adds all valid files and returns errors for any invalid ones.

•[CreateMediaInput!]!
required

List of new media to be added to a product.

•ID!
required

Specifies the product associated with the media.


Was this section helpful?

Anchor to ProductCreateMediaPayload returnsProductCreateMediaPayload returns

•[Media!]

The newly created media.

•[MediaUserError!]!
non-null

The list of errors that occurred from executing the mutation.

•Product

The product associated with the media.

•[UserError!]!
non-nullDeprecated

The list of errors that occurred from executing the mutation.


Was this section helpful?