# Shopware 6 API: Fehler "fromHexToBytes(): Argument #1 ($uuid) must be of type string, null given"

**URL:** <https://forum.shopware.com/t/shopware-6-api-fehler-fromhextobytes-argument-1-uuid-must-be-of-type-string-null-given/106031>\
**Category:** Shopware 6 (German)\
**Tags:** general, programming\
**Created:** [4. Dezember 2024 um 07:52 UTC](https://forum.shopware.com/t/shopware-6-api-fehler-fromhextobytes-argument-1-uuid-must-be-of-type-string-null-given/106031 "2024-12-04T07:52:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dennis\_Konoppa](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/dennis_konoppa/32/27245_2.png) [@Dennis\_Konoppa](https://forum.shopware.com/u/Dennis_Konoppa)\
**Post date:** [4. Dezember 2024 um 07:52 UTC](https://forum.shopware.com/t/shopware-6-api-fehler-fromhextobytes-argument-1-uuid-must-be-of-type-string-null-given/106031/1 "2024-12-04T07:52:01Z")

</div>

Hallo Zusammen,

Bei unseren Kunden importieren wir Daten in den Shop per Shopware Sync API.  
Hin und wieder (und augenscheinlich nur bei bei der Entity „custom\_field“) kommt es zum Fehler

```auto
Status Code: 500 | 
Title: Internal Server Error | 
Detail: Shopware\Core\Framework\Uuid\Uuid::fromHexToBytes(): Argument #1 ($uuid) must be of type string, null given, called in /var/www/html/vendor/shopware/core/Framework/Uuid/Uuid.php on line 105

```

Aktuell stehen wir vor einem Rätsel, warum dies so ist, denn das Payload, welches wir an die Sync API schicken, sieht erstmal richtig aus.

Beispiel:

```auto
POST /api/_action/sync HTTP/1.1

User-Agent: GuzzleHttp/7

Host: <URL des Kundenshops>

Content-Type: application/json

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJhZG1pbmlzdHJhdGlvbiIsImp0aSI6ImFhZmRlZWJmMzY1Nzg5NzFlNDk5Y2E1ZGMyNTBhZjNlZDc1MzI1MjkxZmRmYWI3MWM3NWRmY2ZlZDU0ZmY2OTFhODdmMjkyYjdlYzEyODA1IiwiaWF0IjoxNzMzMjUyODYyLjQ2MDY5NCwibmJmIjoxNzMzMjUyODYyLjQ2MDY5NywiZXhwIjoxNzMzMjUzNDYyLjM5MjMyNCwic3ViIjoiM2IzMDNmMzA2NjFlNDc4ZTk2NjEzM2FiMmYyZWZlYWMiLCJzY29wZXMiOlsid3JpdGUiLCJhZG1pbiJdfQ.zKbsa08wx8UNwsnbkdHK__CijL_vEUkO9sOQtWPmkrW-i_bJDmn8HYxxZhX8Twh6rF4BhHU1xdGBjoyvYUgSYZHqvbNUIyyq106qbdgP2E0RsODrsG23c3Xg1aRXL63n_-W_z2bGSFcrXbv_xfm6ntBoKbiIQRnnpo30zt7-RIEbPKdeOx7WXhHxEfyAnR1Pgi3oGK4qqZbKe6HmomUjbyTu3oifzpCCAVKfekayWR6tDopT4kzba84yXP8-RERGjlAiLMVrzmp4qMnRRbWygWkxIrsZZyE8WYm9d9pLBoZ5SWn7v7yW9HAP9Tzw_00y9BQGvug58Vm8z37MWajvyg

Accept: */*

indexing-behavior: disable-indexing

{"custom_field":{"action":"upsert","entity":"custom_field","payload":[{"name":"kein_postversand","type":"int","id":"01938df2194e737a9059ec6e0c0abb6d"}]}}

```

Hat jemand oder Shopware selbst eine Idee, warum der Fehler auftreten könnte?

Viele Grüße

Dennis Konoppa

---

<div class="post-metadata">

**Author:** ![R4M](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/r4m/32/9983_2.png) [@R4M](https://forum.shopware.com/u/R4M)\
**Post date:** [4. Dezember 2024 um 09:01 UTC](https://forum.shopware.com/t/shopware-6-api-fehler-fromhextobytes-argument-1-uuid-must-be-of-type-string-null-given/106031/2 "2024-12-04T09:01:07Z")

</div>

Muss das eventuell in einem Array als String übergegen werden?

---

<div class="post-metadata">

**Author:** ![Dennis\_Konoppa](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/dennis_konoppa/32/27245_2.png) [@Dennis\_Konoppa](https://forum.shopware.com/u/Dennis_Konoppa)\
**Post date:** [4. Dezember 2024 um 09:11 UTC](https://forum.shopware.com/t/shopware-6-api-fehler-fromhextobytes-argument-1-uuid-must-be-of-type-string-null-given/106031/3 "2024-12-04T09:11:32Z")

</div>

Was genau meinst du?

Wie gesagt, die Syntax ist grundsätzlich korrekt und funktioniert in 99% der Fälle

---

<div class="post-metadata">

**Author:** ![R4M](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/r4m/32/9983_2.png) [@R4M](https://forum.shopware.com/u/R4M)\
**Post date:** [4. Dezember 2024 um 09:40 UTC](https://forum.shopware.com/t/shopware-6-api-fehler-fromhextobytes-argument-1-uuid-must-be-of-type-string-null-given/106031/4 "2024-12-04T09:40:16Z")

</div>

Ich sehe nur, dass die Funktion fromHexToBytes() ein Array erwartet. Da können wohl mehrere UUIDs übergeben werden. Vielleicht passt die Syntax nicht. Ist jetzt nur so eine Vermutung von mir!

---

<div class="post-metadata">

**Author:** ![Dennis\_Konoppa](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/dennis_konoppa/32/27245_2.png) [@Dennis\_Konoppa](https://forum.shopware.com/u/Dennis_Konoppa)\
**Post date:** [4. Dezember 2024 um 10:39 UTC](https://forum.shopware.com/t/shopware-6-api-fehler-fromhextobytes-argument-1-uuid-must-be-of-type-string-null-given/106031/5 "2024-12-04T10:39:23Z")

</div>

CustomFields haben ja erstmal nur ein ID-Feld… die Sync API übergibt ein Array mit den Datensätzen, die aktualisiert werden sollen, somit beinhaltet jedes CustomField, welches per Sync API geschickt wird, am Ende nur die ID und die weiteren Felder, welche aktualisiert werden sollen.
