# Unterstützt die API einen PUT Batch mit ?useNumberAsId=true ?

**URL:** <https://forum.shopware.com/t/unterstutzt-die-api-einen-put-batch-mit-usenumberasid-true/44179>\
**Category:** Programmierung\
**Created:** [2. März 2017 um 15:28 UTC](https://forum.shopware.com/t/unterstutzt-die-api-einen-put-batch-mit-usenumberasid-true/44179 "2017-03-02T15:28:19Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Argee](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@Argee](https://forum.shopware.com/u/Argee)\
**Post date:** [2. März 2017 um 15:28 UTC](https://forum.shopware.com/t/unterstutzt-die-api-einen-put-batch-mit-usenumberasid-true/44179/1 "2017-03-02T15:28:19Z")

</div>

Hallo liebe Leute,

Ich weiß, dass ich das nicht über die URL regeln kann, aber gibt es eine Möglichkeit, mehrere Artikel gleichzeitig anhand ihrer Artikelnummer upzudaten? In der Doku wird das nur über IDs gemacht.

Vielen Dank für die Unterstützung&nbsp; ![Smile](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/1X/bac5f5766b6a20565a8fb995345b4e41d24daac0.png "Smile")

---

<div class="post-metadata">

**Author:** ![ahmadsaad](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@ahmadsaad](https://forum.shopware.com/u/ahmadsaad)\
**Post date:** [3. März 2017 um 08:30 UTC](https://forum.shopware.com/t/unterstutzt-die-api-einen-put-batch-mit-usenumberasid-true/44179/2 "2017-03-03T08:30:09Z")

</div>

Hallo&nbsp;Argee,

ja dass ist Möglich, aber Sie dürfen die nummer in mainDetail array

```
 $data['mainDetail']['number'] = ArtikelNummer.

```

VG,

Ahmad

---

<div class="post-metadata">

**Author:** ![Argee](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@Argee](https://forum.shopware.com/u/Argee)\
**Post date:** [3. März 2017 um 09:22 UTC](https://forum.shopware.com/t/unterstutzt-die-api-einen-put-batch-mit-usenumberasid-true/44179/3 "2017-03-03T09:22:42Z")

</div>

Ah, perfekt, danke! 🙂

---

<div class="post-metadata">

**Author:** ![Argee](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@Argee](https://forum.shopware.com/u/Argee)\
**Post date:** [3. März 2017 um 10:52 UTC](https://forum.shopware.com/t/unterstutzt-die-api-einen-put-batch-mit-usenumberasid-true/44179/4 "2017-03-03T10:52:22Z")

</div>

Also sollte die Antwort tatsächlich stimmen, bin ich zu blöde^^ Ich bekomme eine Fehlermeldung, dass ein Artikel mit der Artikelnummer bereits existiert, obwohl ich eine put- und keine&nbsp;post-request sende…

folgendes versuche ich gerade:

```
$testUpdateArray = array(
	array(
		"taxId" => 4,
		"mainDetail" => array(
			"number" => 1)
		),
	array(
		"taxId" => 4,
		"mainDetail" => array(
			"number" => 3)
		)
	);

$putBatchResponse = $shopwareClient->put("articles", $testUpdateArray);
print_r($putBatchResponse);

```

ändere ich das $testUpdateArray zu

```
$testUpdateArray = array(
	array(
		"taxId" => 4,
		"id" => 10
		),
	array(
		"taxId" => 4,
		"id" => 11
		)
	);

```

läuft die Geschichte wieder…

---

<div class="post-metadata">

**Author:** ![ahmadsaad](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@ahmadsaad](https://forum.shopware.com/u/ahmadsaad)\
**Post date:** [3. März 2017 um 11:37 UTC](https://forum.shopware.com/t/unterstutzt-die-api-einen-put-batch-mit-usenumberasid-true/44179/5 "2017-03-03T11:37:28Z")

</div>

Hallo,

du muss pass die aktulle&nbsp;mainDetail nummer.

ob du pass andere variant nummer , dann du hast dies Fehlermeldung.

VG,

Ahmad.

---

<div class="post-metadata">

**Author:** ![Argee](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@Argee](https://forum.shopware.com/u/Argee)\
**Post date:** [3. März 2017 um 13:08 UTC](https://forum.shopware.com/t/unterstutzt-die-api-einen-put-batch-mit-usenumberasid-true/44179/6 "2017-03-03T13:08:24Z")

</div>

What do you mean with mainDetail nummer? The field number in mainDetail or the mainDetailId? Since I only have those two articles in my test-shop, I figure the api-call should work.

What would be a different variant number? I didn’t deal with variants at all in the test-shop… ![Undecided](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/1X/8ae622c50104e84c5003fedfcc22572813a67b41.png "Undecided")

---

<div class="post-metadata">

**Author:** ![ahmadsaad](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@ahmadsaad](https://forum.shopware.com/u/ahmadsaad)\
**Post date:** [3. März 2017 um 13:11 UTC](https://forum.shopware.com/t/unterstutzt-die-api-einen-put-batch-mit-usenumberasid-true/44179/7 "2017-03-03T13:11:36Z")

</div>

Hallo,

can you call one article via the API , then post the return array hier.

VG,

Ahmad

---

<div class="post-metadata">

**Author:** ![ahmadsaad](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@ahmadsaad](https://forum.shopware.com/u/ahmadsaad)\
**Post date:** [3. März 2017 um 13:13 UTC](https://forum.shopware.com/t/unterstutzt-die-api-einen-put-batch-mit-usenumberasid-true/44179/8 "2017-03-03T13:13:46Z")

</div>

and if you can the exact error message from the put call

post the return data will be better.

thank’s

---

<div class="post-metadata">

**Author:** ![Argee](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@Argee](https://forum.shopware.com/u/Argee)\
**Post date:** [3. März 2017 um 13:14 UTC](https://forum.shopware.com/t/unterstutzt-die-api-einen-put-batch-mit-usenumberasid-true/44179/9 "2017-03-03T13:14:06Z")

</div>

Sure. Here is the data of an article by a get request:

```
{
  "data": {
    "id": 11,
    "mainDetailId": 4,
    "supplierId": 3,
    "taxId": 4,
    "priceGroupId": null,
    "filterGroupId": null,
    "configuratorSetId": null,
    "name": "Bohnen",
    "description": "Bohnen \u2714 45% vol. \u2714 700ml \u2714 7,00\u20ac \u2714 Perola-Shop - Premium Spirituosen g\u00fcnstig bestellen - Ab 29\u20ac versandkostenfrei \u2714",
    "descriptionLong": "Alkoholgehalt in % vol.:45Herkunftsland:(noch ausf\u00fcllen)Lebensmittelunternehmer:(noch ausf\u00fcllen)Bezeichnung des Lebensmittels:(noch ausf\u00fcllen)Farbstoffe:(noch ausf\u00fcllen)Allergenhinweise:enth\u00e4lt Sulfite",
    "added": "2017-03-03T00:00:00+0100",
    "active": false,
    "pseudoSales": 0,
    "highlight": false,
    "keywords": null,
    "metaTitle": "Bohnen, 45% vol., 700ml, 7,00\u20ac",
    "changed": "2017-03-03T10:10:03+0100",
    "priceGroupActive": false,
    "lastStock": true,
    "crossBundleLook": 0,
    "notification": false,
    "template": "",
    "mode": 0,
    "availableFrom": null,
    "availableTo": null,
    "mainDetail": {
      "id": 4,
      "articleId": 11,
      "unitId": 6,
      "number": "3",
      "supplierNumber": null,
      "kind": 1,
      "additionalText": null,
      "active": false,
      "inStock": 0,
      "stockMin": null,
      "weight": "100.000",
      "width": null,
      "len": null,
      "height": null,
      "ean": "7898221141755",
      "purchasePrice": "0",
      "position": 0,
      "minPurchase": 1,
      "purchaseSteps": null,
      "maxPurchase": null,
      "purchaseUnit": "0.7000",
      "referenceUnit": "1.000",
      "packUnit": "Flasche(n)",
      "shippingFree": false,
      "releaseDate": null,
      "shippingTime": null,
      "prices": [
        
      ],
      "attribute": {
        "id": 3,
        "articleId": 11,
        "articleDetailId": 4,
        "attr1": null,
        "attr2": null,
        "attr3": null,
        "attr4": null,
        "attr5": null,
        "attr6": null,
        "attr7": null,
        "attr8": null,
        "attr9": null,
        "attr10": null,
        "attr11": null,
        "attr12": null,
        "attr13": null,
        "attr14": null,
        "attr15": null,
        "attr16": null,
        "attr17": null,
        "attr18": null,
        "attr19": null,
        "attr20": null
      },
      "configuratorOptions": [
        
      ]
    },
    "tax": {
      "id": 4,
      "tax": "7.00",
      "name": "7 %"
    },
    "propertyValues": [
      
    ],
    "supplier": {
      "id": 3,
      "name": "Array",
      "image": "",
      "link": "",
      "description": null,
      "metaTitle": null,
      "metaDescription": null,
      "metaKeywords": null,
      "changed": "2017-03-03T10:10:03+0100"
    },
    "propertyGroup": null,
    "customerGroups": [
      
    ],
    "images": [
      
    ],
    "configuratorSet": null,
    "links": [
      
    ],
    "downloads": [
      
    ],
    "categories": [
      
    ],
    "similar": null,
    "related": null,
    "details": [
      
    ],
    "seoCategories": [
      
    ]
  },
  "success": true
}
```

---

<div class="post-metadata">

**Author:** ![Argee](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@Argee](https://forum.shopware.com/u/Argee)\
**Post date:** [3. März 2017 um 13:16 UTC](https://forum.shopware.com/t/unterstutzt-die-api-einen-put-batch-mit-usenumberasid-true/44179/10 "2017-03-03T13:16:53Z")

</div>

And here is the error response:

```
Array
(
    [success] => 1
    [data] => Array
        (
            [0] => Array
                (
                    [success] => 
                    [message] => A variant with the given order number "1" already exists.
                    [trace] => #0 C:\xampp\htdocs\shopware5\engine\Shopware\Components\Api\Resource\Variant.php(427): Shopware\Components\Api\Resource\Variant->prepareData(Array, Object(Shopware\Proxies\ __CG__ \Shopware\Models\Article\Article), Object(Shopware\Models\Article\Detail))
#1 C:\xampp\htdocs\shopware5\engine\Shopware\Components\Api\Resource\Article.php(760): Shopware\Components\Api\Resource\Variant->prepareMainVariantData(Array, Object(Shopware\Proxies\ __CG__ \Shopware\Models\Article\Article), Object(Shopware\Models\Article\Detail))
#2 C:\xampp\htdocs\shopware5\engine\Shopware\Components\Api\Resource\Article.php(737): Shopware\Components\Api\Resource\Article->prepareMainDetail(Array, Object(Shopware\Proxies\ __CG__ \Shopware\Models\Article\Article))
#3 C:\xampp\htdocs\shopware5\engine\Shopware\Components\Api\Resource\Article.php(612): Shopware\Components\Api\Resource\Article->prepareAssociatedData(Array, Object(Shopware\Proxies\ __CG__ \Shopware\Models\Article\Article))
#4 C:\xampp\htdocs\shopware5\engine\Shopware\Components\Api\Resource\Resource.php(521): Shopware\Components\Api\Resource\Article->update(10, Array)
#5 C:\xampp\htdocs\shopware5\engine\Shopware\Controllers\Api\Rest.php(78): Shopware\Components\Api\Resource\Resource->batch(Array)
#6 C:\xampp\htdocs\shopware5\engine\Library\Enlight\Controller\Action.php(159): Shopware_Controllers_Api_Rest->batchAction()
#7 C:\xampp\htdocs\shopware5\engine\Library\Enlight\Controller\Dispatcher\Default.php(523): Enlight_Controller_Action->dispatch('batchAction')
#8 C:\xampp\htdocs\shopware5\engine\Library\Enlight\Controller\Front.php(223): Enlight_Controller_Dispatcher_Default->dispatch(Object(Enlight_Controller_Request_RequestHttp), Object(Enlight_Controller_Response_ResponseHttp))
#9 C:\xampp\htdocs\shopware5\engine\Shopware\Kernel.php(179): Enlight_Controller_Front->dispatch()
#10 C:\xampp\htdocs\shopware5\vendor\symfony\http-kernel\HttpCache\HttpCache.php(487): Shopware\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#11 C:\xampp\htdocs\shopware5\engine\Shopware\Components\HttpCache\AppCache.php(255): Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL)
#12 C:\xampp\htdocs\shopware5\vendor\symfony\http-kernel\HttpCache\HttpCache.php(258): Shopware\Components\HttpCache\AppCache->forward(Object(Symfony\Component\HttpFoundation\Request), true)
#13 C:\xampp\htdocs\shopware5\vendor\symfony\http-kernel\HttpCache\HttpCache.php(275): Symfony\Component\HttpKernel\HttpCache\HttpCache->pass(Object(Symfony\Component\HttpFoundation\Request), true)
#14 C:\xampp\htdocs\shopware5\engine\Shopware\Components\HttpCache\AppCache.php(133): Symfony\Component\HttpKernel\HttpCache\HttpCache->invalidate(Object(Symfony\Component\HttpFoundation\Request), true)
#15 C:\xampp\htdocs\shopware5\vendor\symfony\http-kernel\HttpCache\HttpCache.php(206): Shopware\Components\HttpCache\AppCache->invalidate(Object(Symfony\Component\HttpFoundation\Request), true)
#16 C:\xampp\htdocs\shopware5\engine\Shopware\Components\HttpCache\AppCache.php(114): Symfony\Component\HttpKernel\HttpCache\HttpCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 C:\xampp\htdocs\shopware5\shopware.php(117): Shopware\Components\HttpCache\AppCache->handle(Object(Symfony\Component\HttpFoundation\Request))
#18 {main}
                )

            [1] => Array
                (
                    [success] => 
                    [message] => A variant with the given order number "3" already exists.
                    [trace] => #0 C:\xampp\htdocs\shopware5\engine\Shopware\Components\Api\Resource\Variant.php(427): Shopware\Components\Api\Resource\Variant->prepareData(Array, Object(Shopware\Proxies\ __CG__ \Shopware\Models\Article\Article), Object(Shopware\Models\Article\Detail))
#1 C:\xampp\htdocs\shopware5\engine\Shopware\Components\Api\Resource\Article.php(760): Shopware\Components\Api\Resource\Variant->prepareMainVariantData(Array, Object(Shopware\Proxies\ __CG__ \Shopware\Models\Article\Article), Object(Shopware\Models\Article\Detail))
#2 C:\xampp\htdocs\shopware5\engine\Shopware\Components\Api\Resource\Article.php(737): Shopware\Components\Api\Resource\Article->prepareMainDetail(Array, Object(Shopware\Proxies\ __CG__ \Shopware\Models\Article\Article))
#3 C:\xampp\htdocs\shopware5\engine\Shopware\Components\Api\Resource\Article.php(612): Shopware\Components\Api\Resource\Article->prepareAssociatedData(Array, Object(Shopware\Proxies\ __CG__ \Shopware\Models\Article\Article))
#4 C:\xampp\htdocs\shopware5\engine\Shopware\Components\Api\Resource\Resource.php(521): Shopware\Components\Api\Resource\Article->update(11, Array)
#5 C:\xampp\htdocs\shopware5\engine\Shopware\Controllers\Api\Rest.php(78): Shopware\Components\Api\Resource\Resource->batch(Array)
#6 C:\xampp\htdocs\shopware5\engine\Library\Enlight\Controller\Action.php(159): Shopware_Controllers_Api_Rest->batchAction()
#7 C:\xampp\htdocs\shopware5\engine\Library\Enlight\Controller\Dispatcher\Default.php(523): Enlight_Controller_Action->dispatch('batchAction')
#8 C:\xampp\htdocs\shopware5\engine\Library\Enlight\Controller\Front.php(223): Enlight_Controller_Dispatcher_Default->dispatch(Object(Enlight_Controller_Request_RequestHttp), Object(Enlight_Controller_Response_ResponseHttp))
#9 C:\xampp\htdocs\shopware5\engine\Shopware\Kernel.php(179): Enlight_Controller_Front->dispatch()
#10 C:\xampp\htdocs\shopware5\vendor\symfony\http-kernel\HttpCache\HttpCache.php(487): Shopware\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#11 C:\xampp\htdocs\shopware5\engine\Shopware\Components\HttpCache\AppCache.php(255): Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL)
#12 C:\xampp\htdocs\shopware5\vendor\symfony\http-kernel\HttpCache\HttpCache.php(258): Shopware\Components\HttpCache\AppCache->forward(Object(Symfony\Component\HttpFoundation\Request), true)
#13 C:\xampp\htdocs\shopware5\vendor\symfony\http-kernel\HttpCache\HttpCache.php(275): Symfony\Component\HttpKernel\HttpCache\HttpCache->pass(Object(Symfony\Component\HttpFoundation\Request), true)
#14 C:\xampp\htdocs\shopware5\engine\Shopware\Components\HttpCache\AppCache.php(133): Symfony\Component\HttpKernel\HttpCache\HttpCache->invalidate(Object(Symfony\Component\HttpFoundation\Request), true)
#15 C:\xampp\htdocs\shopware5\vendor\symfony\http-kernel\HttpCache\HttpCache.php(206): Shopware\Components\HttpCache\AppCache->invalidate(Object(Symfony\Component\HttpFoundation\Request), true)
#16 C:\xampp\htdocs\shopware5\engine\Shopware\Components\HttpCache\AppCache.php(114): Symfony\Component\HttpKernel\HttpCache\HttpCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 C:\xampp\htdocs\shopware5\shopware.php(117): Shopware\Components\HttpCache\AppCache->handle(Object(Symfony\Component\HttpFoundation\Request))
#18 {main}
                )

        )

)

```

&nbsp;

---

<div class="post-metadata">

**Author:** ![ahmadsaad](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@ahmadsaad](https://forum.shopware.com/u/ahmadsaad)\
**Post date:** [3. März 2017 um 13:26 UTC](https://forum.shopware.com/t/unterstutzt-die-api-einen-put-batch-mit-usenumberasid-true/44179/11 "2017-03-03T13:26:52Z")

</div>

Hallo,

dass ist nur lustig.

probier mal dieses Code und gib mir bescheid&nbsp;

```
$testUpdateArray = array(
	array(
		"taxId" => 4,
		"mainDetail" => array(
			"number" => "1")
		),
	array(
		"taxId" => 4,
		"mainDetail" => array(
			"number" => "3")
		)
	);

$putBatchResponse = $shopwareClient->put("articles", $testUpdateArray);
print_r($putBatchResponse);

```

&nbsp;

---

<div class="post-metadata">

**Author:** ![Argee](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@Argee](https://forum.shopware.com/u/Argee)\
**Post date:** [3. März 2017 um 13:37 UTC](https://forum.shopware.com/t/unterstutzt-die-api-einen-put-batch-mit-usenumberasid-true/44179/12 "2017-03-03T13:37:12Z")

</div>

HAHAHAHAAAA! No way! Awesome ![Grin](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/1X/70033cde8e8ff79cfa538293ae71318d6f788423.png "Grin")&nbsp;Works perfectly.&nbsp;Just because of the Quotes^^ really, that should almost be considered to be a bug. Thanks a lot!

---

<div class="post-metadata">

**Author:** ![ahmadsaad](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@ahmadsaad](https://forum.shopware.com/u/ahmadsaad)\
**Post date:** [3. März 2017 um 13:40 UTC](https://forum.shopware.com/t/unterstutzt-die-api-einen-put-batch-mit-usenumberasid-true/44179/13 "2017-03-03T13:40:40Z")

</div>

ja lustig.

artikel nummer ist string und 1==‚1‘ =\> true &nbsp;aber 1 === ‚1‘ =\> false

und sie benutzen ===

VG,

Ahmad

---

<div class="post-metadata">

**Author:** ![Argee](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@Argee](https://forum.shopware.com/u/Argee)\
**Post date:** [3. März 2017 um 13:48 UTC](https://forum.shopware.com/t/unterstutzt-die-api-einen-put-batch-mit-usenumberasid-true/44179/14 "2017-03-03T13:48:50Z")

</div>

Wow, daran hätte ich noch Jahre gesessen. Danke dir!

---

<div class="post-metadata">

**Author:** ![Magnum](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@Magnum](https://forum.shopware.com/u/Magnum)\
**Post date:** [15. Dezember 2018 um 01:54 UTC](https://forum.shopware.com/t/unterstutzt-die-api-einen-put-batch-mit-usenumberasid-true/44179/15 "2018-12-15T01:54:46Z")

</div>

Hallo,

tut mir leid das ich das Fass hier wieder aufmache, ich versteh zwar das Problem, aber ich weiß nicht wie ich es lösen soll!

Folgend baue ich meinen Array für die Call Funktion auf&nbsp;&nbsp;

```
$updateArticle = array(
                array(
                    "mainDetail" => array(
                        "number" => $ergebnis[1],
                        "name" => "Artikel ".$ergebnis[1],
                    ),
                    'taxId' => 1,
                    'configuratorSet' => array(
                        'groups' => array(
                            array('name' => 'Seriennummer',
                                'options' => $options[$artikelnummer])
                        )
                    )
                )
            );

```

Der teil&nbsp; **“number” =\> $ergebnis[1]**&nbsp;&nbsp;erstellt ein **“number” =\> 12345.** Ich brauche aber ein&nbsp; **“number” =\> “12345”.&nbsp;**

```
 [message] =\> A variant with the given order number 12345 already exists.

```

Ich habe jetzt verschiedenste Wege ausprobiert den Wert umzuwandeln, aber dann krieg ich immer ein

[message] =\> A variant with the given order number “12345” already exists.

Weiß jemand rat?

Beste Grüße Magnum

&nbsp;

---

<div class="post-metadata">

**Author:** ![stormerMike](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@stormerMike](https://forum.shopware.com/u/stormerMike)\
**Post date:** [17. Dezember 2018 um 09:28 UTC](https://forum.shopware.com/t/unterstutzt-die-api-einen-put-batch-mit-usenumberasid-true/44179/16 "2018-12-17T09:28:10Z")

</div>

Bei mir funktioniert ein [Batch PUT ohne usenumberasid](https://forum.shopware.com/discussion/comment/238519/#Comment_238519)

Zu deinem Problem im Code:  
Du solltest bei ’ oder " bleiben und diese nicht unbedingt mischen. Der Wert für „name“ ist auch nicht korrekt geschloßen.

```
$updateArticle = array(
                array(
                    "mainDetail" => array(
                        "number" => "' . $ergebnis[1] . '",
                        "name" => "Artikel '.$ergebnis[1].'",
                    ),
                    "taxId" => 1,
                    "configuratorSet" => array(
                        "groups" => array(
                            array("name" => "Seriennummer",
                                "options" => $options[$artikelnummer])
                        )
                    )
                )
            );

```

Funktioniert das PUT z.B. in Postman mit dem selben JSON-Payload?  
Zu dem „A variant with the given order number…“ kann ich nur sagen das ein Hauptvarianten wechsel mit der API hier problematisch ist. Ich bin daher dazu über gegangen mir eine Dummy-Hauptvariante (immer inStock=0) zu halten die somit in den API-Calls immer konstant bleibt. Probier da mal rum mit Hauptvarianten oder nicht, bin mir sicher das es bei dir auf das selbe Problem raus läuft.

---

<div class="post-metadata">

**Author:** ![ahmadsaad](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@ahmadsaad](https://forum.shopware.com/u/ahmadsaad)\
**Post date:** [17. Dezember 2018 um 10:45 UTC](https://forum.shopware.com/t/unterstutzt-die-api-einen-put-batch-mit-usenumberasid-true/44179/17 "2018-12-17T10:45:53Z")

</div>

Hallo @Magnum‍,

du kannst einfach beim number die folgend code benutzen:

```
                        "number" => '' . $ergebnis[1],
oder:
                        "number" => (string)$ergebnis[1],

```

beim Name glaube ich du brauchst keine Ändernugne.

VG,

Tel.: +49 755&nbsp;- 183 990 00 | Web:&nbsp;[http://enbit.de/](http://enbit.de/)
