Update variant products via REST SyncAPI

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:

 [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:

"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

1 „Gefällt mir“

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

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

Funny, because Product Data | Admin API also has the „configuratorSettings“ with only optionIds.

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.

1 „Gefällt mir“