# Example code from docs for cart not working

**URL:** <https://forum.shopware.com/t/example-code-from-docs-for-cart-not-working/65576>\
**Category:** Programmierung\
**Created:** [18. März 2020 um 13:47 UTC](https://forum.shopware.com/t/example-code-from-docs-for-cart-not-working/65576 "2020-03-18T13:47:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![novacreator](https://avatars.discourse-cdn.com/v4/letter/n/df788c/32.png) [@novacreator](https://forum.shopware.com/u/novacreator)\
**Post date:** [18. März 2020 um 13:47 UTC](https://forum.shopware.com/t/example-code-from-docs-for-cart-not-working/65576/1 "2020-03-18T13:47:11Z")

</div>

Hello Folks,

i have trouble to get the example from here running&nbsp;[https://docs.shopware.com/en/shopware-platform-dev-en/api/sales-channel-cart-api?category=shopware-platform-dev-en/api](https://docs.shopware.com/en/shopware-platform-dev-en/api/sales-channel-cart-api?category=shopware-platform-dev-en/api)

I copied the code at the end to a html file and created a demo shop througt the shopware demo shop link at the top of this forum. After that i put in the needed credits and let the script run it fails to load the countries with 404 Not Found.

The code is below

```
 function getCountry(iso3) {
        const url = `${baseUrl}/sales-channel-api/v1/sales-channel/countries?filter[iso3]=${iso3}`;
        return fetch(url, { method: 'GET', headers })
            .then((resp) => resp.json())
            .then(({ data }) => data[0]);
    }

```

I checked if the ‚deu‘ country is setup for the sales channel … it is. In addition to that i tried to load it with lowercase and uppercase letters (‚deu‘ and ‚DEU‘). Same result.  
To get things further i just got the id for the german countrie from the database and just put it into the order creation code.

After that i setted up a local dev environment and tried to run the same code again. Same results. As far is i can see for order creation the DataBag does not contain any data so the request fails what seems natural to me … but why is it empty?

In addition to that i get the following stack trace response:&nbsp;[https://pastebin.com/e1ahnqvD](https://pastebin.com/e1ahnqvD)

Thanks in&nbsp;advance

&nbsp;
