# Api Category import

**URL:** <https://forum.shopware.com/t/api-category-import/103763>\
**Category:** Shopware 6 (German)\
**Created:** [18. April 2024 um 18:04 UTC](https://forum.shopware.com/t/api-category-import/103763 "2024-04-18T18:04:21Z")\
**Posts on this page:** 7\
**Page:** 2

<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:** [21. April 2024 um 13:39 UTC](https://forum.shopware.com/t/api-category-import/103763/21 "2024-04-21T13:39:24Z")

</div>

Nee, es wird dann einfach nur ignoriert 😂

afterCategoryId muss es lauten.

---

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [21. April 2024 um 13:41 UTC](https://forum.shopware.com/t/api-category-import/103763/22 "2024-04-21T13:41:22Z")

</div>

Wenn afterCategoryId bekomme ich eine Error-Meldung:

```auto
{
    "errors": [
        {
            "status": "400",
            "code": "CONTENT__AFTER_CATEGORY_NOT_FOUND",
            "title": "Bad Request",
            "detail": "Category to insert after not found.",
            "meta": {
                "parameters": []
            }
        }
    ]
}

```

Shopwre 6.6.1.0

---

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [21. April 2024 um 13:43 UTC](https://forum.shopware.com/t/api-category-import/103763/23 "2024-04-21T13:43:29Z")

</div>

afterCategoryVersionId so jetzt haben wir es 😛

Also geht beides:

- afterCategoryVersionId
- after\_category\_version\_id

---

<div class="post-metadata">

**Author:** ![EikeBrandtWarneke](https://avatars.discourse-cdn.com/v4/letter/e/cdc98d/32.png) [@EikeBrandtWarneke](https://forum.shopware.com/u/EikeBrandtWarneke)\
**Post date:** [21. April 2024 um 13:48 UTC](https://forum.shopware.com/t/api-category-import/103763/24 "2024-04-21T13:48:34Z")

</div>

Zur Klarstellung: die API kennt immer nur den „property name“ einer Eigenschaft einer entity definition. Am Beispiel einer Kategorie: [shopware/src/Core/Content/Category/CategoryDefinition.php at trunk · shopware/shopware · GitHub](https://github.com/shopware/shopware/blob/trunk/src/Core/Content/Category/CategoryDefinition.php#L117)

Die API kennt also NUR „afterCategoryVersionId“ und NICHT „after\_category\_version\_id“ (den storage name = der Name der Spalte in der Tabelle). Alle nicht bekannten Schlüssel werden von der API schlichtweg ignoriert.

Viele Grüße

---

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [21. April 2024 um 13:51 UTC](https://forum.shopware.com/t/api-category-import/103763/25 "2024-04-21T13:51:37Z")

</div>

Ok, dann werde ich es so verwenden, aktuell geht das noch mit after\_category\_version\_id aber wenn du sagst es sollte nicht, dann mach ich es lieber richtig wie du es beschrieben hast.

Verbesserungsvorschlag für Shopware:  
Als result bekommt man afterCategoryId, aber man kann es nur als afterCategoryVersionId POSTen. Da wäre ein konsequentere Parameterbeschreibung gut.

---

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [21. April 2024 um 16:08 UTC](https://forum.shopware.com/t/api-category-import/103763/26 "2024-04-21T16:08:08Z")

</div>

Ich muss mich korrigieren, nur so funktioniert es:

```auto
{
  "displayNestedProducts": true,
  "type": "page",
  "productAssignmentType": "product",
  "name": "Hallo",
  "parentId": "018d131737217262b7f66a47ecbfa580",
  "afterCategoryId":"018d131737217262b7f66a47ecbfa580"
}

```

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/3X/2/9/29c7587ba660f00e4995d1743162782e5d6d8653.svg) [@system](https://forum.shopware.com/u/system)\
**Post date:** [21. Mai 2024 um 16:08 UTC](https://forum.shopware.com/t/api-category-import/103763/27 "2024-05-21T16:08:16Z")

</div>

Dieses Thema wurde automatisch 30 Tage nach der letzten Antwort geschlossen. Es sind keine neuen Antworten mehr erlaubt.

[Vorherige Seite](https://forum.shopware.com/t/api-category-import/103763.md?page=1)
