# Creation of Sales Channel over the API

**URL:** <https://forum.shopware.com/t/creation-of-sales-channel-over-the-api/99825>\
**Category:** Shopware 6 (English)\
**Tags:** programming\
**Created:** [25. Mai 2023 um 09:31 UTC](https://forum.shopware.com/t/creation-of-sales-channel-over-the-api/99825 "2023-05-25T09:31:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sevenfps](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@Sevenfps](https://forum.shopware.com/u/Sevenfps)\
**Post date:** [25. Mai 2023 um 09:31 UTC](https://forum.shopware.com/t/creation-of-sales-channel-over-the-api/99825/1 "2023-05-25T09:31:17Z")

</div>

Hi,

i would like to create a Sales Channel over the API of Shopware 6.  
For that i send the following POST request to the /api/sales-channel Endpoint:

```auto
{
    "typeId": "8a243080f92e4c719546314b577cf82b",
    "languageId": "2fbb5fe2e29a4d70aa5854ce7ce3e20b",
    "customerGroupId": "cfbd5018d38d41d8adca10d94fc8bdd6",
    "currencyId": "b7d2554b0ce847cd82f3ac9bd1c0dfca",
    "paymentMethodId": "79e557a3fe4646e9a0f9ceb45b2f5a7e",
    "countryId": "5dbe147703354d8692101a7cd4a2a6c8",
    "homeEnabled": true,
    "name": "Test Storefront",
    "shippingMethodId": "38456c729c3c4718abe2f7ab998b2527",
    "navigationCategoryId": "912c1bee85e547df9b5ade07aba0daa4",
    "accessKey": " ******************************",
    "languages": [{"localeId": "3f9a85a234dd40c5b201afe4eb1e388d", "name": "English"}],
    "hreflangActive": false
}

```

If I send this request i get the following Error Message:

```auto
{
    "errors": [
        {
            "code": "SYSTEM__NO_GIVEN_DEFAULT_LANGUAGE_ID",
            "status": "400",
            "detail": "The sales channel with id \"bc284a7fceb949bca92756aaa962da1b\" does not have a default sales channel language id in the language list.",
            "template": "The sales channel with id \"{{ salesChannelId }}\" does not have a default sales channel language id in the language list.",
            "meta": {
                "parameters": {
                    "{{ salesChannelId }}": "bc284a7fceb949bca92756aaa962da1b"
                }
            },
            "source": {
                "pointer": "/"
            }
        }
    ]
}

```

Can somebody please help and tell me how to fix this problem?  
Thank you!

---

<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:** [25. Mai 2023 um 10:32 UTC](https://forum.shopware.com/t/creation-of-sales-channel-over-the-api/99825/2 "2023-05-25T10:32:43Z")

</div>

Like it is written in the error message. You have to add the default language (id is in the error) to your sales channel.

---

<div class="post-metadata">

**Author:** ![Sevenfps](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@Sevenfps](https://forum.shopware.com/u/Sevenfps)\
**Post date:** [25. Mai 2023 um 11:42 UTC](https://forum.shopware.com/t/creation-of-sales-channel-over-the-api/99825/3 "2023-05-25T11:42:33Z")

</div>

Hi, i found a solution. You have to add the Ids of the languages you want for the storefront in the languages object. The default language is the language defined in the language id part.

```auto
{
    "typeId": "8a243080f92e4c719546314b577cf82b",
    "languageId": "2fbb5fe2e29a4d70aa5854ce7ce3e20b",
    "customerGroupId": "cfbd5018d38d41d8adca10d94fc8bdd6",
    "currencyId": "b7d2554b0ce847cd82f3ac9bd1c0dfca",
    "paymentMethodId": "79e557a3fe4646e9a0f9ceb45b2f5a7e",
    "countryId": "5dbe147703354d8692101a7cd4a2a6c8",
    "homeEnabled": true,
    "name": "Test Storefront",
    "shippingMethodId": "38456c729c3c4718abe2f7ab998b2527",
    "navigationCategoryId": "912c1bee85e547df9b5ade07aba0daa4",
    "accessKey": "SWUAUW1UZUXLWWEYD1ZDEWXHMW",
    "languages": [{"id": "2fbb5fe2e29a4d70aa5854ce7ce3e20b"}, {"id": "bf1757ea66b54de384768ba9943c4d5c"}],
    "hreflangActive": false
}

```

This is not really documented in the [Endpoint Documentation](https://shopware.stoplight.io/docs/admin-api/1f7446f10ec48-create-a-new-sales-channel-resources), so it was hard to find out.
