Development discussions around Shopify APIs
Hello i am new in developping shopify apps
i am trying to update the image of product using the REST api
following the doc to update the image of product we should create a put request
PUT /admin/api/2020-01/products/#{product_id}/images/#{image_id}.json
{ "image": { "id": 850703190, "position": 2, "alt": "new alt tag content" } }
but i want to update the image it self by doing
PUT /admin/api/2020-01/products/#{product_id}/images/850703190.json
{ "image": { "id": 850703190, "src": "my_custom_link" } }
but it's seems not working, i receive no error and the image is not updated, is there anyway to update the image product without deleting the original image and adding the new image.
thks,
Solved! Go to the solution
This is an accepted solution.
Hey @sefiani,
The image content can't be updated, you'll need to remove it and add a new one.
Scott | Developer Support @ 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.
Hey @sefiani,
The image content can't be updated, you'll need to remove it and add a new one.
Scott | Developer Support @ 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
thanks for the answer, so to emulate the replace i have also to take position, alt tag and variants ids from the original image and put it in the new image, that right?
hi SBD_
you say that the image content can't be updated and you add a link to the api documentation
but i don't see on the documentation any reference that the image content can't be updated...
could you please clarify this ?
thanks
User | RANK |
---|---|
8 | |
7 | |
3 | |
3 | |
3 |
Connect your PayPal account to allow your customers to checkout using the PayPal gateway a...
ByYour online store speed can enhance your store’s discoverability, boost conversion rates a...
ByShopping is at our fingertips with mobile devices. Is your theme optimized to be user-frie...
By