Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

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

How to update product via REST without loosing images?

Solved

How to update product via REST without loosing images?

friendoftheroot
Shopify Partner
55 5 8

Hello,

 

I built an importer for products and variations with images.

Everything works fine.
Sometimes I want to update that data more regularily and avoid pushing the images. However it seems images get overwritten. 
What is the solution here, do I have to get the imageids first?
I would like to avoid that as it increases he number of calls quite significantly.

Accepted Solution (1)

friendoftheroot
Shopify Partner
55 5 8

This is an accepted solution.

If not handing over the media id the original images get deleted. I got this sorted with a seperate call to get the media id. It is a bit cumbersome, as it increases the number of calls to the api. Would be much better just to set a flag, but it is what it is.

 

View solution in original post

Replies 2 (2)

friendoftheroot
Shopify Partner
55 5 8

I solved this one.

friendoftheroot
Shopify Partner
55 5 8

This is an accepted solution.

If not handing over the media id the original images get deleted. I got this sorted with a seperate call to get the media id. It is a bit cumbersome, as it increases the number of calls to the api. Would be much better just to set a flag, but it is what it is.