Shopware API item preview image and Item variant.

HI,

I’ am new to shopware and i’m trying to create articles via REST API provided by Shopware and mapping the images with variations.

I wanted to create article with 3 varaints (White-S,  Red-S, Red-M) and 2 groups color(white, red) and size(S, M). But I have problem in mapping images to variant. Instead of showing only red image, It shows all the images. I’m not sure what is wrong with this code.

 

 

Can anyone check json data and let me know what is the problem. Below is my json text.

{“name”: “Testing Article”,   “mainDetail”: {   “number”: “TEST181”,   “images”: [  {  “link”: “http://Test.de/TEST181_02-2XL.jpg” }   ],“configuratorOptions”: [{ “name”: “S”, “group”: “Größe”, “option”: “S” }, { “name”: “rot”, “group”: “Farbe”, “option”: “rot” }  ]   }, 
“images”: [ {  “link”: “http://test.de/TEST181_01-2XL.jpg”,   “description”: “weiss”, “options”: [ [ { “name”: “M”}, {“name”: “weiss”} ] ] }, { “link”: “http://test.de/TEST181_02-2XL.jpg”, “description”: “rot”, “options”: [ [ { “name”: “S” },{  “name”: “rot”  }],[{  “name”: “M” }, {   “name”: “rot” } ] ] } ],“configuratorSet”: { “groups”: [ { “name”: “Farbe”,  “options”: [  {   “name”: “weiss” }, {   “name”: “rot” } ] }, { “name”: “Größe”, “options”: [ {  “name”: “M” },{ “name”: “S”}]}] }, “variants”: [{ “number”: “TEST181_01-S”,            “configuratorOptions”: [ { “group”: “Größe”,  “option”: “S”}, { “group”: “Farbe”, “option”: “weiss” }]}, { “number”: “TEST181_02-M”,         “configuratorOptions”: [{ “group”: “Größe”, “option”: “M” }, { “group”: “Farbe”, “option”: “rot” }]},{ “number”: “TEST181_02-S”,“configuratorOptions”: [ { “group”: “Größe”, “option”: “S”}, { “group”: “Farbe”, “option”: “rot”
 }   ], }  ] }