Skip to main content

Overview

Markets let you segment a single Store into distinct geographic regions, each with its own currency, locale, and set of countries. For example, an international store might define:
  • North America — USD, English, ships to US and Canada
  • Europe — EUR, German, ships to DE, FR, AT, NL
  • United Kingdom — GBP, English, ships to GB

Market Attributes

How Markets Work

When a customer visits your store, their country determines which market applies. The market then sets the currency, locale, and tax behavior for that session.
The resolution chain:
  1. Customer’s country is detected (from URL, geolocation, X-Spree-Country header, or manual selection)
  2. Spree finds the market containing that country
  3. The market’s currency and locale become the defaults for the session
  4. The market’s tax zone determines whether prices are shown with or without tax
If no market matches the customer’s country, the store’s default market is used.

Listing Markets

Fetch all markets for the current store, including their countries:

Resolving a Market by Country

When you know a customer’s country (e.g., from geolocation or a country picker), resolve which market applies:
Returns the market object on success, or 404 if no market contains that country. This is useful for building a country switcher — resolve the market to show the customer what currency and language they’ll get.

Countries in a Market

List countries belonging to a specific market. Useful for populating address form dropdowns during checkout:
You can also fetch countries flat (across all markets) or include the market on a country:

Currency and Locale

Each market defines a currency and set of supported locales. When a market is resolved, its currency and locale become the defaults for the session. You can discover all available currencies and locales (aggregated from all markets) via dedicated endpoints:
See Localization for details on how to pass locale, currency, and country headers in API requests.

Tax Behavior

The tax_inclusive flag on a market controls how prices are displayed and calculated:
  • tax_inclusive: true (common in Europe) — the price shown to the customer already includes tax
  • tax_inclusive: false (common in the US) — tax is added at checkout on top of the displayed price
Each market also resolves a tax zone from its default country. This zone determines which tax rates apply when browsing products — before the customer enters a shipping address. Once the customer provides an address at checkout, the actual shipping address takes over for tax calculation. See Taxes for details on tax zones and rates.

Pricing Integration

Markets integrate with the Pricing system, enabling market-specific pricing through Price Lists with a Market Rule. This lets you set different prices for the same product in different markets — beyond just currency conversion. For example, you could price a product at $29.99 in North America and €24.99 in Europe, rather than relying on exchange rate conversion. See Pricing — Price Rules for details on configuring market-specific price lists.

Setting Up Markets

Markets are managed in the admin dashboard under Settings → Markets. When you run rails db:seed, Spree automatically creates a default market for each store. To create markets programmatically, use the Admin API. See the Admin API endpoints for the full list of /markets routes and required scopes:
Update or remove a market the same way:
  • Markets (Store SDK) — Listing, resolving, and reading markets from the Store SDK
  • Pricing — Price Lists, Price Rules, and the Pricing Context
  • Addresses — Countries, States, and Zones
  • Localization — Locale, currency, and country headers in API requests
  • Translations — Resource and UI translations