Personalized checkout and custom promotions with Shopify Scripts
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
using the shopify api,
i can add product variant like this $product->variants = [ [ "option1" => "color" "price" => "1.23", "sku" => "abc" ] ]; $shopify->Product->post($p);
But how can i add image to the same variant, i tried with
"image" => $p->image
"images" => $p->image
"imageSrc" => $p->image
"attachment" => base64_encode($r)
but no one is working
Thanks
Seem that the only way is to add the image to a product then get it's imageId and update the variant image_id.