# Update variant products via REST SyncAPI

**URL:** <https://forum.shopware.com/t/update-variant-products-via-rest-syncapi/97894>\
**Category:** Shopware 6 (English)\
**Created:** [8. Januar 2023 um 18:28 UTC](https://forum.shopware.com/t/update-variant-products-via-rest-syncapi/97894 "2023-01-08T18:28:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![COMASO-IT](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/comaso-it/32/19439_2.png) [@COMASO-IT](https://forum.shopware.com/u/COMASO-IT)\
**Post date:** [8. Januar 2023 um 18:28 UTC](https://forum.shopware.com/t/update-variant-products-via-rest-syncapi/97894/1 "2023-01-08T18:28:20Z")

</div>

Hello all,

I am currently implementing an application that sends products via Showpare6’s SyncApi.  
In general everything works fine and also creating variant products is fine.

However, I get the following error message, whenever I try to upsert an already existing product with variations:

```auto
 [message] => Transaction commit failed because the transaction has been marked for rollback only.
 [code] => 0
 [status] => 500

```

I figured already out, that this is caused by having the „configuratorSettings“ Element in the payload of the parent product:

```json
"configuratorSettings": [
                    { "optionId": "b84f4a2a08701097a126b375cee90b5a" },
                    { "optionId": "c29a7236206bbe969e49bd7821d5a1cb" },
                    { "optionId": "989bfd01a27b2d6a4997109de161401f" },
                    { "optionId": "830622b02a4c07f8846c572d0e25a307" },
                    { "optionId": "9d8cecb6ea7cb577265086e5cbb38a3f" },
                    { "optionId": "56250a139d395b32955e68a3c88aa917" },
                    { "optionId": "3021dc1406a7951808bbbb15fe873722" }
                ],

```

As soon as I remove this part, I can upsert the products without any problems.

Nevertheless, as I only run one SyncCall for inserting and updating the products, I need to have this part in the payload.

Is this a bug, or is it on purpose?

Kindest,  
Luca

---

<div class="post-metadata">

**Author:** ![Toon.van.Doorn](https://avatars.discourse-cdn.com/v4/letter/t/e47c2d/32.png) [@Toon.van.Doorn](https://forum.shopware.com/u/Toon.van.Doorn)\
**Post date:** [16. Februar 2023 um 10:37 UTC](https://forum.shopware.com/t/update-variant-products-via-rest-syncapi/97894/2 "2023-02-16T10:37:28Z")

</div>

If you give an unique ID for each option then the upsert does not enter new records with duplication errors as a result;

```auto
"configuratorSettings":[
{"id":"d8fe32ff39037a71a2f52dee4e27c446","optionId":"ecca2b7e3e02d94b3790394f6eeec48c"},
{"id":"9a09dac2108773733fcfc356360427e5","optionId":"0b7f1ec1ed6a680c3ab8e300173497b0"},
{"id":"8f8a2856fb2baeee2d6c260236a77f90","optionId":"beb162d17eeb312f25d6391ee1a52315"}
]

```

---

<div class="post-metadata">

**Author:** ![gaxweb](https://avatars.discourse-cdn.com/v4/letter/g/ea5d25/32.png) [@gaxweb](https://forum.shopware.com/u/gaxweb)\
**Post date:** [13. Juni 2023 um 09:24 UTC](https://forum.shopware.com/t/update-variant-products-via-rest-syncapi/97894/3 "2023-06-13T09:24:59Z")

</div>

Funny, because [Product Data | Admin API](https://shopware.stoplight.io/docs/admin-api/935c55fbf5072-product-data#configurator-handling) also has the „`configuratorSettings`“ with only `optionId`s.

Only wrong documentation is worse than no documentation at all. So does that mean I have to retrieve the IDs first, if the options already exist in the system?

Edit: I’ve simply set them both to the same value/ID. So far, so good.
