Skip to content

getAvailableShippingCountries(): Country[]

The getAvailableShippingCountries method allows to retrieve the list of available shipping countries.

Returned value

A returned value has a type of Country[] where Country represents the Country model.

Example

In this example we make a basketShippingsApi call to retrieve the list of available shipping countries.

useStorefront(async (storefront) => {
    let basketShippingsApi = storefront.getApiSync('basketShippingsApi');

    if (!basketShippingsApi) {
        const featureSystemApi = this.getApiSync(FEATURE_SYSTEM_API_NAME);
        await featureSystemApi.registerDynamic('basket');

        basketShippingsApi = storefront.getApiSync('basketShippingsApi');
    }

    const availableShippingCountries = basketShippingsApi.getAvailableShippingCountries();
});

Basket Address API methods reference

Models reference