newgennerd
newgennerd

Reputation: 1078

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

Upvotes: 0

Views: 591

Answers (1)

Valerio8787
Valerio8787

Reputation: 905

You can use GET /store-api/v3/country?associations[states][] endpoint.

Upvotes: 1

Related Questions