# REST API - Kann keine Bestellung erstellen. Fehler "details.statusId"

**URL:** <https://forum.shopware.com/t/rest-api-kann-keine-bestellung-erstellen-fehler-details-statusid/45924>\
**Category:** Programmierung\
**Created:** [23. Mai 2017 um 11:32 UTC](https://forum.shopware.com/t/rest-api-kann-keine-bestellung-erstellen-fehler-details-statusid/45924 "2017-05-23T11:32:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alfapack](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@alfapack](https://forum.shopware.com/u/alfapack)\
**Post date:** [23. Mai 2017 um 11:32 UTC](https://forum.shopware.com/t/rest-api-kann-keine-bestellung-erstellen-fehler-details-statusid/45924/1 "2017-05-23T11:32:24Z")

</div>

Hallo,

ich versuche per API eine Bestellung zu erzeugen, bekomme allerdings als Fehlermeldung immer “details.statusId” zurück. Im Shopware5 Log steht folgendes:

```
Shopware\Components\Api\Exception\NotFoundException: details.statusId in /engine/Shopware/Components/Api/Resource/Order.php:486 Stack trace:
#0 /engine/Shopware/Components/Api/Resource/Order.php(308): Shopware\Components\Api\Resource\Order->prepareCreateOrderDetailsData(Array)
#1 /engine/Shopware/Components/Api/Resource/Order.php(192): Shopware\Components\Api\Resource\Order->prepareCreateOrderData(Array)
#2 /engine/Shopware/Controllers/Api/Orders.php(82): Shopware\Components\Api\Resource\Order->create(Array)
#3 /engine/Library/Enlight/Controller/Action.php(159): Shopware_Controllers_Api_Orders->postAction()
#4 /engine/Library/Enlight/Controller/Dispatcher/Default.php(523): Enlight_Controller_Action->dispatch('postAction')
#5 /engine/Library/Enlight/Controller/Front.php(223): Enlight_Controller_Dispatcher_Default->dispatch(Object(Enlight_Controller_Request_RequestHttp), Object(Enlight_Controller_Response_ResponseHttp))
#6 /engine/Shopware/Kernel.php(182): Enlight_Controller_Front->dispatch()
#7 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(491): Shopware\Kernel->handle(Object(Enlight_Controller_Request_RequestHttp), 1, true)
#8 /engine/Shopware/Components/HttpCache/AppCache.php(266): Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL)
#9 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(258): Shopware\Components\HttpCache\AppCache->forward(Object(Symfony\Component\HttpFoundation\Request), true)
#10 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(275): Symfony\Component\HttpKernel\HttpCache\HttpCache->pass(Object(Symfony\Component\HttpFoundation\Request), true)
#11 /engine/Shopware/Components/HttpCache/AppCache.php(141): Symfony\Component\HttpKernel\HttpCache\HttpCache->invalidate(Object(Symfony\Component\HttpFoundation\Request), true)
#12 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(206): Shopware\Components\HttpCache\AppCache->invalidate(Object(Symfony\Component\HttpFoundation\Request), true)
#13 /engine/Shopware/Components/HttpCache/AppCache.php(114): Symfony\Component\HttpKernel\HttpCache\HttpCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#14 /var/www/html/shopware/shopware.php(117): Shopware\Components\HttpCache\AppCache->handle(Object(Symfony\Component\HttpFoundation\Request))
#15 {main}

```

&nbsp;

Nun verstehe ich darunter, das der Wert “statusId” in meinem Array der Artikel fehlt. Dieser ist aber gesetzt.

&nbsp;

```
          $order_products[] = array(
            'articleId' => $product->field_interne_produkt_id[LANGUAGE_NONE][0]['value'],
            'taxId' => ($product->commerce_price[LANGUAGE_NONE][0]['data']['include_tax'] == 'mwst_19') ? 1 : 4,
            'taxRate' => ($product->commerce_price[LANGUAGE_NONE][0]['data']['include_tax'] == 'mwst_19') ? 19 : 7,
            'articleNumber' => $product->sku,
            'price' => $product->commerce_price[LANGUAGE_NONE][0]['amount'] / 100,
            'quantity' => number_format($line_item->quantity, 0),
            'articleName' => $product->title,
            'shipped' => 0,
            'shippedGroup' => 0,
            'mode' => 0,
            'esdArticle' => 0,
            'statusId' => 0,
          );

```

Die einzelnen Produkte sind doch die Orderdetails, oder irre ich mich da ?

Wäre über eine Hilfe, bzw einen Tipp sehr dankbar, da ich langsam daran verzweifle.

Schonmal vielen dank im vorraus.

Gruß

Alfapack

---

<div class="post-metadata">

**Author:** ![TimmeHosting](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/timmehosting/32/15580_2.png) [@TimmeHosting](https://forum.shopware.com/u/TimmeHosting)\
**Post date:** [23. Mai 2017 um 11:48 UTC](https://forum.shopware.com/t/rest-api-kann-keine-bestellung-erstellen-fehler-details-statusid/45924/2 "2017-05-23T11:48:30Z")

</div>

Hast Du schon versucht, den Shopware-Cache zu leeren?

![](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/1X/385eaa628505df573ebf33722f780335f53ac1b2.png)

Timme Hosting - schnelles nginx-Hosting

[www.timmehosting.de](https://timmehosting.de/)

---

<div class="post-metadata">

**Author:** ![alfapack](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@alfapack](https://forum.shopware.com/u/alfapack)\
**Post date:** [23. Mai 2017 um 12:46 UTC](https://forum.shopware.com/t/rest-api-kann-keine-bestellung-erstellen-fehler-details-statusid/45924/3 "2017-05-23T12:46:43Z")

</div>

Ja, habe den Cache schon komplett geleert, Fehler besteht leider weiterhin

---

<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:** [23. Mai 2017 um 23:18 UTC](https://forum.shopware.com/t/rest-api-kann-keine-bestellung-erstellen-fehler-details-statusid/45924/4 "2017-05-23T23:18:34Z")

</div>

Hallo,

Kannst du schreiben wie hast du die Order Array bauen?

VG,

Ahmad

---

<div class="post-metadata">

**Author:** ![alfapack](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@alfapack](https://forum.shopware.com/u/alfapack)\
**Post date:** [24. Mai 2017 um 06:07 UTC](https://forum.shopware.com/t/rest-api-kann-keine-bestellung-erstellen-fehler-details-statusid/45924/5 "2017-05-24T06:07:41Z")

</div>

Habe das Problem gefunden, hatte das Order-Details Array nochmal in einem Array verschachtelt, sodass er die Keys nicht richtig auslesen konnte und einen Fehler ausgegeben hat.

Trotzdem vielen dank für eure Hilfe! 🙂
