Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Can I add images assigned to one product to a new product I'm creating with an API

Can I add images assigned to one product to a new product I'm creating with an API

Luftwalk
Shopify Partner
15 0 3

Hey,

 

what I'm trying to do when creating a new product with an API is something like this:

 

$image = (
[id] => 40305803559107 -- ID of the already existing image
[position] => 2

)

 

$product($shopifyID)->Image($image)->post()

 

To clarify - $shopifyID is the ID of the newly created product

 

Would the above quasi code work? So far I've been having issues with it but not sure if it's because you can't specify through ID which existing image to take or not.

If this isn't an option...what would be the quickest, least intensive way of adding already existing images to a new product?

 

Thanks for the help

Replies 0 (0)