Focusing on managing products, variants, and collections through the API.
REPOST FOR THE CURRECT PLACE FOR THE POST
Im creating a new product with the rest api like this :
Solved! Go to the solution
This is an accepted solution.
The solution i found was:
As i said i "stole" a product from a different store so it already had imageId's and everything.
so what i needed to do was the remove the imageId from each variant and then after the product is created i put the new created id in place
Hi Harelk1015,
The error message you received indicates that the image IDs you provided in the `images` field of the product object do not exist or do not belong to the specific product. This might be happening due to a mismatch between the image IDs and the images associated with the product.
To troubleshoot this issue, you can follow these steps:
Hope this helps!
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
This is an accepted solution.
The solution i found was:
As i said i "stole" a product from a different store so it already had imageId's and everything.
so what i needed to do was the remove the imageId from each variant and then after the product is created i put the new created id in place
Can you use the product import CSV file to update variant image IDs?
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
sorry, can you explain more plese?
You can specify variant images in the upload products CSV so you could update variant images that way.
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Having the same error, need clarification...
I've made my own mock images but when I delete the stock images provided by printful, then fo to make changes in the description, it says The following image IDs do not exist or do not belong to the product.
Prior to deleting the initial mocks this error does not appear when saving the description. I've tried re uploading the template many times the same thing happens.
I've changed the names to a similar name as the origional file names from Printful but I am still getting the same error. Even if I down load the origional photos from printful and just upload those images I get the error. If i delete all the photos I get the error....
So I simply cant change the description if I delete those origional photos so im stuck having to use them?
I managed to fix the issue by adding the product, and then editing the product and adding the images
Correct.
Programmatically you would need to fetch all variants of a product via GET.
Then assign the referenced image id to null via PUT.
Payload looks like this:
{ "variant": { "id": 4733234164, "image_id": null } }
Hey Liam, How do i find, view and delete existing variant image ID's?
If you're using the GraphQL API, you could use the ProductVariant.media connection to get variant image IDs and then use the productDeleteMedia mutation to delete the images.
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
i am also create product using rest api like this