A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hi i need to update product Variant images paths via API from my ERP integrations. please let me know if it is possible to attach product image links at variants level. any help in this regards will help us. thanks
Hi @naveedshahidecs
Using Shopify API you can add an existing image to an existing product variant. Is that what you are looking for?
If yes, I think you can use this https://shopify.dev/api/admin-rest/2022-01/resources/product-variant#put-variants-variant-id
use Shopify\Rest\Admin2022_01\Variant;
use Shopify\Utils;
$this->test_session = Utils::loadCurrentSession(
$requestHeaders,
$requestCookies,
$isOnline
);
$variant = new Variant($this->test_session);
$variant->id = 808950810;
$variant->image_id = 562641783;
$variant->save(
true, // Update Object
);
If you are looking for something else, then please let me know and I'll to help you.