Images bulk upload to existing products and its variants

nartundra
Shopify Partner
1 0 0

Hi,

Is it possible to upload images to not only products but simultaneously to its variants too?
Currently I see the solution by using combination of productCreateMedia and productVariantAppendMedia. From productCreateMedia I get mediaIds of uploaded images and use them in productVariantAppendMedia. Is there any api or shortcut so that I can specify productVariant in upload? F.e some kind of 

 

 

mutation productCreateMedia($productId: ID!, $media: [CreateMediaInput!]!) {
      productCreateMedia(productId: $productId, media: $media) {
        media {
          alt
          id
        }
        mediaUserErrors {
          code
          field
          message
        }
        product {
          id
        }
      }
    }

 

 

with 3rd parameter as variantIds or smth like that?

Thanks in advance!

Replies 0 (0)