# The api don't get new added attributes at the order

**URL:** <https://forum.shopware.com/t/the-api-dont-get-new-added-attributes-at-the-order/60173>\
**Category:** Shopware 5\
**Created:** [26. Juni 2019 um 16:03 UTC](https://forum.shopware.com/t/the-api-dont-get-new-added-attributes-at-the-order/60173 "2019-06-26T16:03:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![robert\_baum](https://avatars.discourse-cdn.com/v4/letter/r/fbc32d/32.png) [@robert\_baum](https://forum.shopware.com/u/robert_baum)\
**Post date:** [26. Juni 2019 um 16:03 UTC](https://forum.shopware.com/t/the-api-dont-get-new-added-attributes-at-the-order/60173/1 "2019-06-26T16:03:02Z")

</div>

i added there free text field to s\_order\_attribute but the api just get the atrributes from atrribute1 to&nbsp;atrribute6 and dont get the new added attribute

---

<div class="post-metadata">

**Author:** ![shyim](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/shyim/32/7681_2.png) [@shyim](https://forum.shopware.com/u/shyim)\
**Post date:** [26. Juni 2019 um 17:40 UTC](https://forum.shopware.com/t/the-api-dont-get-new-added-attributes-at-the-order/60173/2 "2019-06-26T17:40:07Z")

</div>

clear all caches

---

<div class="post-metadata">

**Author:** ![robert\_baum](https://avatars.discourse-cdn.com/v4/letter/r/fbc32d/32.png) [@robert\_baum](https://forum.shopware.com/u/robert_baum)\
**Post date:** [27. Juni 2019 um 07:24 UTC](https://forum.shopware.com/t/the-api-dont-get-new-added-attributes-at-the-order/60173/3 "2019-06-27T07:24:42Z")

</div>

> [@Shyim schrieb:](https://forum.shopware.com/profile/20792/Shyim "Shyim")
> 
> clear all caches

I cleared it but the same result

does the added&nbsp;free text field attribute supported at the API?

---

<div class="post-metadata">

**Author:** ![robert\_baum](https://avatars.discourse-cdn.com/v4/letter/r/fbc32d/32.png) [@robert\_baum](https://forum.shopware.com/u/robert_baum)\
**Post date:** [27. Juni 2019 um 10:38 UTC](https://forum.shopware.com/t/the-api-dont-get-new-added-attributes-at-the-order/60173/4 "2019-06-27T10:38:32Z")

</div>

Hi I created the free text field by a plugin and it appeared at there places but the API couldn’t retrieve&nbsp;&nbsp;theme even after clear cache,

but after adding another&nbsp;free text field&nbsp; from the backend &nbsp;all the attribute begin&nbsp;appearing&nbsp;&nbsp;

I thought there is a problem, and there is a code must be implemented at the plugin to update doctrine or another think ?!

because after uninstalling the plugin and uninstall the free text filed the uninstaller of the plugin for example (the order trying to find the removed field) and the problem goes when&nbsp;I add some free text field or remove anyone.

the backend do something to refresh the framework.&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![robert\_baum](https://avatars.discourse-cdn.com/v4/letter/r/fbc32d/32.png) [@robert\_baum](https://forum.shopware.com/u/robert_baum)\
**Post date:** [27. Juni 2019 um 10:43 UTC](https://forum.shopware.com/t/the-api-dont-get-new-added-attributes-at-the-order/60173/5 "2019-06-27T10:43:33Z")

</div>

ah yes I found the code that must implemented after adding or removing the attribute&nbsp;

```
		$metaDataCache = Shopware()->Models()->getConfiguration()->getMetadataCacheImpl();
		$metaDataCache->deleteAll();
		Shopware()->Models()->generateAttributeModels(['s_order_attributes']);

```

&nbsp;

---

<div class="post-metadata">

**Author:** ![Moritz\_Naczenski](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/moritz_naczenski/32/7792_2.png) [@Moritz\_Naczenski](https://forum.shopware.com/u/Moritz_Naczenski)\
**Post date:** [27. Juni 2019 um 17:30 UTC](https://forum.shopware.com/t/the-api-dont-get-new-added-attributes-at-the-order/60173/6 "2019-06-27T17:30:12Z")

</div>

The attributes are cached, but this cache won’t be cleared via backend, only when called in a plugin installation (like you mentioned in your last answer), by generating attribute models in the free text field module and by clearing the cache manually on the server.
