# REst Api insert prodct to special category

**URL:** <https://forum.shopware.com/t/rest-api-insert-prodct-to-special-category/43409>\
**Category:** International (English Only)\
**Tags:** programming\
**Created:** [4. Februar 2017 um 18:18 UTC](https://forum.shopware.com/t/rest-api-insert-prodct-to-special-category/43409 "2017-02-04T18:18:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![import2shop](https://avatars.discourse-cdn.com/v4/letter/i/c0e974/32.png) [@import2shop](https://forum.shopware.com/u/import2shop)\
**Post date:** [4. Februar 2017 um 18:18 UTC](https://forum.shopware.com/t/rest-api-insert-prodct-to-special-category/43409/1 "2017-02-04T18:18:34Z")

</div>

Hi,

i need to add some products into special categories. How should i get the correct categorie from REst API.

&nbsp;

For example i have 2 categories called „Keyboards“ The category tree looks like:

Apple&nbsp;

- 
  - extensions

- -&nbsp;- keyboards

HP

- 
  - wired extensions

- 
  - keyboards

I want to put a new product in Apple \> extensions \> Keyboards

From the API i get all Kategories, but how schould i use them?

Is there a best pratic how to do this?

---

<div class="post-metadata">

**Author:** ![NextMike](https://avatars.discourse-cdn.com/v4/letter/n/838e76/32.png) [@NextMike](https://forum.shopware.com/u/NextMike)\
**Post date:** [6. Februar 2017 um 09:31 UTC](https://forum.shopware.com/t/rest-api-insert-prodct-to-special-category/43409/2 "2017-02-06T09:31:55Z")

</div>

Your script have to know the categoryID. Either you have a mapping table, you store the categoryID in your PIM.&nbsp;Or you look up the categories via api on the fly.
