# How to update mapped images with it's variant via REST API

**URL:** <https://forum.shopware.com/t/how-to-update-mapped-images-with-its-variant-via-rest-api/61535>\
**Category:** Programmierung\
**Created:** [4. September 2019 um 12:07 UTC](https://forum.shopware.com/t/how-to-update-mapped-images-with-its-variant-via-rest-api/61535 "2019-09-04T12:07:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronaksolanki10](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@ronaksolanki10](https://forum.shopware.com/u/ronaksolanki10)\
**Post date:** [4. September 2019 um 12:07 UTC](https://forum.shopware.com/t/how-to-update-mapped-images-with-its-variant-via-rest-api/61535/1 "2019-09-04T12:07:34Z")

</div>

Hello,

Thank you in advance,

I am creating articles via REST API provided by Shopware and mapping the images with variations. the article creation is working ok. onwards I want to update the article via PUT method of REST API, the details are updating fine but the image is inserting again instead of Updation&nbsp;of image mapping with variants.

---

<div class="post-metadata">

**Author:** ![ronaksolanki10](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@ronaksolanki10](https://forum.shopware.com/u/ronaksolanki10)\
**Post date:** [12. September 2019 um 09:00 UTC](https://forum.shopware.com/t/how-to-update-mapped-images-with-its-variant-via-rest-api/61535/2 "2019-09-12T09:00:02Z")

</div>

@Hahu Smith, so this can not be resolved, I mean we can’t do that right?

Regards,

Ronak Solanki

---

<div class="post-metadata">

**Author:** ![ahmadsaad](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@ahmadsaad](https://forum.shopware.com/u/ahmadsaad)\
**Post date:** [15. September 2019 um 16:06 UTC](https://forum.shopware.com/t/how-to-update-mapped-images-with-its-variant-via-rest-api/61535/3 "2019-09-15T16:06:46Z")

</div>

one way is looking for the image name in database and return the media ID

then use the media ID to upadte the images mapping.

the other way is to use the option ‘\_\_options\_images’&nbsp; =\> [‘replace’ =\> true]

then your call will upload new images with new mapping and replace the old images.

but this will not delete the old images from the media manager , by every call new images will be uploaded

VG,

Tel.: +49 755&nbsp;- 183 990 00 | Email: [info@enbit.de](mailto:info@enbit.de) | Web:&nbsp;[http://enbit.de/](http://enbit.de/)

---

<div class="post-metadata">

**Author:** ![ronaksolanki10](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@ronaksolanki10](https://forum.shopware.com/u/ronaksolanki10)\
**Post date:** [16. September 2019 um 09:23 UTC](https://forum.shopware.com/t/how-to-update-mapped-images-with-its-variant-via-rest-api/61535/4 "2019-09-16T09:23:00Z")

</div>

> [@ahmadsaad schrieb:](https://forum.shopware.com/profile/24684/ahmadsaad "ahmadsaad")
> 
> one way is looking for the image name in database and return the media ID
> 
> then use the media ID to upadte the images mapping.
> 
> the other way is to use the option ‚\_\_options\_images‘&nbsp; =\> [‚replace‘ =\> true]
> 
> then your call will upload new images with new mapping and replace the old images.
> 
> but this will not delete the old images from the media manager , by every call new images will be uploaded
> 
> VG,
> 
> Ahmad&nbsp;
> 
> &nbsp;
> 
> **@[ahmadsaad](https://forum.shopware.com/profile/24684/ahmadsaad), Thank you so much for your reply and I have used your solution and it is working fine and exactly what I was looking for. Thank You so much**
