Hallo Community,
ich verzweifele aktuell an dem Versuch, via API einen Variantenartikel anzulegen. Ich gehe nach dem Beispiel aus der Doku vor (https://developers.shopware.com/developers-guide/rest-api/examples/article/#step-1-create-a-new-product), d.h. zuerst lege ich den Artikel neu und ohne Varianten an, hier das zugehörige JSON:
{     
     "name": "T-Shirt TEST",
     "active": true,
     "tax": 19,
     "supplier": "Testsupplier",
     "descriptionLong": "Long Description",
     "categories": [],
     "__options_images": "replace",
     "images": [{
       "link": "https:\/\/XYZ.de\/import\/img\/101191.jpg"
      }],
      "mainDetail": {
         "number": "101191001",
         "active": true,
         "prices": [
             { "customerGroupKey": "EK",
                 "price": 9.45
             }]
     }
}
Das funktioniert problemlos, der Artikel wird korrekt angelgt. Aber beim zweiten Schritt, dem Update mit den Varianten, wirft mir Shopware einen Fatal Error:
Call to a member function getNumber() on null in /path-to/engine/Shopware/Components/Api/Resource/Article.php:1130
Mein JSON mit den Varianten, welches ich dem POST-Request mitgebe, sieht so aus:
{
    "configuratorSet": {
        "groups": [
            {
                "name": "Größe", 
                "options": [
                    {
                        "name": "S", 
                        "position": 1
                    }, 
                    {
                        "name": "M", 
                        "position": 2
                    }, 
                    {
                        "name": "L", 
                        "position": 3
                    }, 
                    {
                        "name": "XL", 
                        "position": 4
                    }, 
                    {
                        "name": "XXL", 
                        "position": 5
                    }
                ]
            }
        ]
    }, 
    "taxId": 1,
    "variants": [
        {
            "number": "101191001", 
            "isMain": true, 
            "configuratorOptions": [
                {
                    "group": "Größe", 
                    "option": "S"
                }
            ], 
            "prices": [
                {
                    "customerGroupKey": "EK", 
                    "price": 9.45
                }
            ]
        }, 
        {
            "number": "101191002", 
            "isMain": false, 
            "configuratorOptions": [
                {
                    "group": "Größe", 
                    "option": "M"
                }
            ], 
            "prices": [
                {
                    "customerGroupKey": "EK", 
                    "price": 9.45
                }
            ]
        }, 
        {
            "number": "101191003", 
            "isMain": false, 
            "configuratorOptions": [
                {
                    "group": "Größe", 
                    "option": "L"
                }
            ], 
            "prices": [
                {
                    "customerGroupKey": "EK", 
                    "price": 9.45
                }
            ]
        }, 
        {
            "number": "101191004", 
            "isMain": false, 
            "configuratorOptions": [
                {
                    "group": "Größe", 
                    "option": "XL"
                }
            ], 
            "prices": [
                {
                    "customerGroupKey": "EK", 
                    "price": 9.45
                }
            ]
        }, 
        {
            "number": "101191005", 
            "isMain": false, 
            "configuratorOptions": [
                {
                    "group": "Größe", 
                    "option": "XXL"
                }
            ], 
            "prices": [
                {
                    "customerGroupKey": "EK", 
                    "price": 9.45
                }
            ]
        }
    ]
}
Ich komm einfach nicht drauf was ich hier falsch mache, bzw. was fehlt und bin für jeden Hinweis dankbar!
Gruß, Volker