
import CountryFields from "../../../src/reference/subbly-sdk/types/Country.mdx";

<SdkPage group="countries" />

<Method id="list" signature="subbly.countries.list()">

Gets every country Subbly supports, with its regions. Use it to fill a country
select, and use the `id` of the chosen country as `countryId` in addresses and
in `subbly.cart.getShippingMethods`.

This is the full list. The countries your shop actually ships to are in
`subbly.shop.shippingCountries`, which has the same shape.

<Returns type="Promise<Country[]>">
The countries.
<Properties label="country" collapsed>
  <CountryFields />
</Properties>
</Returns>

<Example>

```js title="List the countries"
const countries = await subbly.countries.list()
```

```js title="Offer only the countries the shop ships to"
const options = subbly.shop.shippingCountries.map(({ id, name }) => ({
  value: id,
  label: name,
}))
```

</Example>

</Method>
