Skip to main content
Anchor to productVariantAppendMedia

productVariantAppendMedia

mutation

Requires write_products access scope. Also: The user must have a permission to append media to variants.

Appends existing media from a product to specific variants of that product, creating associations between media files and particular product options. This allows different variants to showcase relevant images or videos.

For example, a t-shirt product might have color variants where each color variant displays only the images showing that specific color, helping customers see exactly what they're purchasing.

Use ProductVariantAppendMedia to:

  • Associate specific images with product variants for accurate display
  • Build variant-specific media management in product interfaces
  • Implement automated media assignment based on variant attributes

The operation links existing product media to variants without duplicating files, maintaining efficient media storage while enabling variant-specific displays.

Learn more about product variants.

•ID!
required

Specifies the product associated to the media.

•[ProductVariantAppendMediaInput!]!
required

A list of pairs of variants and media to be attached to the variants.


Was this section helpful?

Anchor to ProductVariantAppendMediaPayload returnsProductVariantAppendMediaPayload returns

•Product

The product associated with the variants and media.

•[ProductVariant!]

The product variants that were updated.

•[MediaUserError!]!
non-null

The list of errors that occurred from executing the mutation.


Was this section helpful?