# Fehler bei Api-Abfrage

**URL:** <https://forum.shopware.com/t/fehler-bei-api-abfrage/95203>\
**Category:** Programmierung\
**Created:** [8. Juli 2022 um 12:09 UTC](https://forum.shopware.com/t/fehler-bei-api-abfrage/95203 "2022-07-08T12:09:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Klimax](https://avatars.discourse-cdn.com/v4/letter/k/848f3c/32.png) [@Klimax](https://forum.shopware.com/u/Klimax)\
**Post date:** [8. Juli 2022 um 12:09 UTC](https://forum.shopware.com/t/fehler-bei-api-abfrage/95203/1 "2022-07-08T12:09:45Z")

</div>

Hi,  
seit Shopware 6.4 funktioniert bei uns das Updaten eines Produkts via API nicht mehr.

Der Payload sieht wie folgt aus:

```auto
 ["type"]=>
  string(7) "product"
  ["taxId"]=>
  string(32) "08702a89b4884942ba7dff6e8509dcf9"
  ["price"]=>
  array(1) {
    [0]=>
    array(4) {
      ["currencyId"]=>
      string(32) "b7d2554b0ce847cd82f3ac9bd1c0dfca"
      ["gross"]=>
      float(89.95)
      ["net"]=>
      float(75.58823529411765)
      ["linked"]=>
      bool(true)
    }
  }
  ["stock"]=>
  float(1)
  ["parentId"]=>
  string(32) "b912c79d34a24eb7a6adb0d6e00030bc"
  ["active"]=>
  bool(true)
  ["isCloseout"]=>
  bool(true)
  ["ean"]=>
  string(13) "4064502748446"
  ["productNumber"]=>
  string(30) "14-1907 10814320-4064502748446"
  ["options"]=>
  array(2) {
    [0]=>
    array(1) {
      ["id"]=>
      string(32) "646aa8a53ef547ce94b45de378c5ee10"
    }
    [1]=>
    array(1) {
      ["id"]=>
      string(32) "6a3cf7d0a0e24c71a0fbfe2772715470"
    }
  }
  ["id"]=>
  string(32) "0d25cf2fa0194ad1bca7c0aa50756a1d"

```

Dabei kommt folgende Fehlermeldung:

```auto
string(158) "{"errors":[{"status":"400","code":"FRAMEWORK__INVALID_UUID","title":"Bad Request","detail":"Value is not a valid UUID: ","meta":{"parameters":{"input":""}}}]}"

```

Dabei ist es nicht eindeutig, um welche UUID es sich handelt. Kann mir evtl. jemand weiterhelfen?

Nachtrag:  
Bzw. kommt auch folgender Fehler:

```auto
"{"errors":[{"status":"500","code":"FRAMEWORK__WRITE_TYPE_INTEND_ERROR","title":"Internal Server Error","detail":"Expected command for \u0022Shopware\\Core\\Content\\Product\\ProductDefinition\u0022 to be \u0022Shopware\\Core\\Framework\\DataAbstractionLayer\\Write\\Command\\UpdateCommand\u0022. (Got: Shopware\\Core\\Framework\\DataAbstractionLayer\\Write\\Command\\InsertCommand)","meta":{"parameters":{"definition":"Shopware\\Core\\Content\\Product\\ProductDefinition","expectedClass":"Shopware\\Core\\Framework\\DataAbstractionLayer\\Write\\Command\\UpdateCommand","actualClass":"Shopware\\Core\\Framework\\DataAbstractionLayer\\Write\\Command\\InsertCommand"}}}]}"

```

---

<div class="post-metadata">

**Author:** ![Max\_Shop](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Max\_Shop](https://forum.shopware.com/u/Max_Shop)\
**Post date:** [10. Juli 2022 um 16:27 UTC](https://forum.shopware.com/t/fehler-bei-api-abfrage/95203/2 "2022-07-10T16:27:01Z")

</div>

Wenn ich es richtig überflogen habe, dann versuchst du über insert ein update zu machen. Das kann ja nicht funktionieren.

---

<div class="post-metadata">

**Author:** ![Klimax](https://avatars.discourse-cdn.com/v4/letter/k/848f3c/32.png) [@Klimax](https://forum.shopware.com/u/Klimax)\
**Post date:** [11. Juli 2022 um 07:30 UTC](https://forum.shopware.com/t/fehler-bei-api-abfrage/95203/3 "2022-07-11T07:30:39Z")

</div>

Danke für deine Antwort.

Dabei mache ich einen Request mit der Methode „PATCH“.  
Die Url sieht wie folgt aus:  
[https://shopurl.de/api/product/{productid}](https://shopurl.de/api/product/%7Bproductid%7D)

Nachtrag:  
Der Kunde hat die Produkte manuell im Shop gelöscht. Somit waren die UUIDs gar nicht vergeben und das Update konnte nicht durchgeführt werden.
