Image path updating using API at SKU level

Shopify Partner
2 0 0

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




Reply 1 (1)

Shopify Partner
16 2 62

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 

use Shopify\Rest\Admin2022_01\Variant;
use Shopify\Utils;
$this->test_session = Utils::loadCurrentSession(
$variant = new Variant($this->test_session);
$variant->id = 808950810;
$variant->image_id = 562641783;
true, // Update Object

If you are looking for something else, then please let me know and I'll to help you.