Skip to main content
A storefront resource can be limited to a set of countries. You write the list, read it back on every response, and filter lists by country. Every resource works this way except products, which set availability per variant — see Products below.

How the country list works

A resource’s availability is its countries field: an array of ISO-2 country codes.
An empty countries array means unrestricted: the resource is available in every country the store sells in. A non-empty array limits it to exactly those countries.

Set a resource’s countries

Write availability with country_isos on a company create or update. It becomes the countries field you read back.
  • An empty array clears the limit. "country_isos": [] makes the resource available everywhere the store sells.
  • Leaving the key out changes nothing. Updates change only what you send, so you can edit other fields without touching availability.

Read a resource’s countries

countries is on every response for these resources, public and company alike. Use the company show request to read it for a resource in any state:

Filter a list by country

Pass filter[country] with an ISO-2 code to list what’s available in one country. It works on public and company lists:
The filter returns resources limited to that country and unrestricted resources, because an unrestricted resource is available there too. Without filter[country], a list isn’t narrowed by country at all. Countries never affect a public slug lookup.
Use filter[country] to filter by availability. The country parameter is product-only: it selects a country’s prices and doesn’t filter other resources.

Products

Products have no countries field. Each variant carries the countries it’s sold in, and a product is available wherever at least one of its variants is. To read products for one country, pass country rather than filter[country]:
The list leaves out any product with no variant sold in that country, and prices come back in that country’s pricing. On the public list, a country the store doesn’t sell in falls back to the store’s default country. On the company list, it returns 422.

Next steps