首页 > 解决方案 > Shopware 6: Query country states using the store api

问题描述

I want to query country states via the store-API (https://docs.shopware.com/en/shopware-platform-dev-en/store-api-guide/sales-channel?category=shopware-platform-dev-en/store-api-guide) In the documentation I don't see anything regarding countries, but I have the following reference: GET /store-api/v3/context gives

{
    ...
    salesChannel: {
        countries: [
            {
                ...
                state: null
                ...
            }
        ]
    }
}

As you can see, this doesn't include the country states...

Shopware Version 6.3.3.1

标签: apishopware

解决方案


您可以使用GET /store-api/v3/country?associations[states][]端点。


推荐阅读