Skip to main content

List Markets

Returns all markets for the current store with their countries, currency, locales, and tax configuration.
const { data: markets } = await client.store.markets.list()

markets.forEach(market => {
  market.id               // "mkt_UkLWZg9DAJ"
  market.name             // "North America"
  market.currency         // "USD"
  market.default_locale   // "en"
  market.tax_inclusive    // false
  market.default          // true
  market.supported_locales // ["en", "es"]
  market.countries        // [{ iso: "US", name: "United States of America", ... }]
})
Response:
{
  "data": [
    {
      "id": "mkt_UkLWZg9DAJ",
      "name": "North America",
      "currency": "USD",
      "default_locale": "en",
      "tax_inclusive": false,
      "default": true,
      "supported_locales": ["en", "es"],
      "countries": [
        { "iso": "US", "iso3": "USA", "name": "United States of America", "states_required": true, "zipcode_required": true }
      ]
    },
    {
      "id": "mkt_gbHJdmfrXB",
      "name": "Europe",
      "currency": "EUR",
      "default_locale": "de",
      "tax_inclusive": true,
      "default": false,
      "supported_locales": ["de", "en", "fr"],
      "countries": [
        { "iso": "DE", "iso3": "DEU", "name": "Germany", "states_required": false, "zipcode_required": true },
        { "iso": "FR", "iso3": "FRA", "name": "France", "states_required": false, "zipcode_required": true }
      ]
    }
  ]
}

Get a Market

const market = await client.store.markets.get('mkt_gbHJdmfrXB')

market.name      // "Europe"
market.currency  // "EUR"
market.countries // [{ iso: "DE", ... }, { iso: "FR", ... }]

Resolve Market by Country

Determine which market applies for a given country ISO code. Useful for auto-selecting the correct currency and locale when a customer’s location is known.
const market = await client.store.markets.resolve('DE')

market.id       // "mkt_gbHJdmfrXB"
market.name     // "Europe"
market.currency // "EUR"
If no market matches the given country, a 404 error is returned.

List Countries in a Market

Returns countries belonging to a specific market. Use this for address form country dropdowns during checkout.
const { data: countries } = await client.store.markets.countries.list('mkt_gbHJdmfrXB')

countries.forEach(country => {
  country.iso              // "DE"
  country.name             // "Germany"
  country.states_required  // false
  country.zipcode_required // true
})

Get a Country in a Market

Returns a single country by ISO code within a market. Use expand: ['states'] for address forms that need state/province dropdowns.
const country = await client.store.markets.countries.get('mkt_gbHJdmfrXB', 'US', {
  expand: ['states'],
})

country.iso    // "US"
country.name   // "United States of America"
country.states // [{ id: "st_xxx", name: "New York", abbr: "NY" }, ...]