# API Fehler beim Artikelupdate

**URL:** <https://forum.shopware.com/t/api-fehler-beim-artikelupdate/33089>\
**Category:** Programmierung\
**Created:** [17. Dezember 2015 um 16:44 UTC](https://forum.shopware.com/t/api-fehler-beim-artikelupdate/33089 "2015-12-17T16:44:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RedEars](https://avatars.discourse-cdn.com/v4/letter/r/8edcca/32.png) [@RedEars](https://forum.shopware.com/u/RedEars)\
**Post date:** [17. Dezember 2015 um 16:44 UTC](https://forum.shopware.com/t/api-fehler-beim-artikelupdate/33089/1 "2015-12-17T16:44:16Z")

</div>

Hallo, ich bekomme bei dem Aufruf der Artikel API beim Update folgenden Fehler zurück: `Cannot unset string offsets in **/pfad/engine/Shopware/Components/Api/Resource/Article.php** on line **1047**  
` Die betroffene Zeile versucht die Steuer (tax) Option zu unseten, aber eigentlich dürfte es nicht mal in das else reingehen, da ich die TaxID übertrage. Hat jemand das gleiche problem und konnte es lösen? Wie es aussieht bin ich nicht alleine mit dem Problem: [post145790.html#p145790](http://forum.shopware.com/post145790.html#p145790)

---

<div class="post-metadata">

**Author:** ![RedEars](https://avatars.discourse-cdn.com/v4/letter/r/8edcca/32.png) [@RedEars](https://forum.shopware.com/u/RedEars)\
**Post date:** [17. Dezember 2015 um 17:19 UTC](https://forum.shopware.com/t/api-fehler-beim-artikelupdate/33089/2 "2015-12-17T17:19:44Z")

</div>

Außerdem erhalte ich neuerdings folgende Meldung wenn ich einem Artikel Varianten per Update übermittel: `{"success":true,"data":{"taxId":{"success":false,"message":"Object(Shopware\\Models\\Article\\Article).name:\n This value should not be blank.\nObject(Shopware\\Models\\Article\\Article).tax:\n This value should not be blank.\nObject(Shopware\\Models\\Article\\Article).mainDetail.number:\n This value should not be blank."` Dabei werden alle erforderlichen Daten übertragen. Selbst mit dem Beispiel aus der Dokumentation klappt es nicht. Da es am Anfang geklappt hat gehe ich davon aus dass der Fehler bei Shopware liegt? Siehe: ` $updateArticle = array( 'name' =\> $product-\>ebayTitle, 'taxId' =\> 1, 'mainDetail' =\> array( 'number' =\> $product-\>productId, 'active' =\> 1, 'inStock' =\> $product-\>inStock, 'prices' =\> array( array( 'customerGroupKey' =\> 'EK', 'price' =\> $product-\>price, ), ) ), 'configuratorSet' =\> array( 'groups' =\> array( array( 'name' =\> 'Größe', 'options' =\> array( array('name' =\> 'S'), array('name' =\> 'M'), array('name' =\> 'L'), array('name' =\> 'XL'), array('name' =\> 'XXL'), ) ), array( 'name' =\> 'Farbe', 'options' =\> array( array('name' =\> 'Weiß'), array('name' =\> 'Gelb'), array('name' =\> 'Blau'), array('name' =\> 'Schwarz'), array('name' =\> 'Rot'), ) ), ) ), 'taxId' =\> 1, 'variants' =\> array( array( 'isMain' =\> true, 'number' =\> 'turn', 'inStock' =\> 15, 'additionaltext' =\> 'L / Schwarz', 'configuratorOptions' =\> array( array('group' =\> 'Größe', 'option' =\> 'L'), array('group' =\> 'Farbe', 'option' =\> 'Schwarz'), ), 'prices' =\> array( array( 'customerGroupKey' =\> 'EK', 'price' =\> 1999, ), ) ), array( 'isMain' =\> false, 'number' =\> 'turn.1', 'inStock' =\> 15, 'additionnaltext' =\> 'S / Schwarz', 'configuratorOptions' =\> array( array('group' =\> 'Größe', 'option' =\> 'S'), array('group' =\> 'Farbe', 'option' =\> 'Schwarz'), ), 'prices' =\> array( array( 'customerGroupKey' =\> 'EK', 'price' =\> 999, ), ) ), array( 'isMain' =\> false, 'number' =\> 'turn.2', 'inStock' =\> 15, 'additionnaltext' =\> 'S / Rot', 'configuratorOptions' =\> array( array('group' =\> 'Größe', 'option' =\> 'S'), array('group' =\> 'Farbe', 'option' =\> 'Rot'), ), 'prices' =\> array( array( 'customerGroupKey' =\> 'EK', 'price' =\> 999, ), ) ), array( 'isMain' =\> false, 'number' =\> 'turn.3', 'inStock' =\> 15, 'additionnaltext' =\> 'XL / Rot', 'configuratorOptions' =\> array( array('group' =\> 'Größe', 'option' =\> 'XL'), array('group' =\> 'Farbe', 'option' =\> 'Rot'), ), 'prices' =\> array( array( 'customerGroupKey' =\> 'EK', 'price' =\> 999, ), ) ) ) ); $json = json\_decode($res); if ($json-\>success) { $res = $shopwareApi-\>put('articles/' . $product-\>shopwareId, $updateArticle); } `
