Work with subdivision markets
A subdivision market is a market whose region condition targets a country subdivision, such as a state, province, or prefecture, instead of a whole country. Subdivision markets extend region markets: a region market can contain whole countries, individual subdivisions, or a mix of both.
This guide explains the API contract for subdivision markets: how to read a market's subdivision membership, and how to create or update markets with subdivision conditions.
Anchor to How subdivision markets are modeledHow subdivision markets are modeled
A market's region membership is a flat list of concrete region nodes. A subdivision market doesn't model a nested tree of subdivisions, and you don't need to traverse a hierarchy to determine membership. Each node in the list is one of the following concrete types, all of which implement the MarketRegion interface:
| Region type | Represents | Key fields |
|---|---|---|
MarketRegionCountry | A whole country. | code (country code) |
MarketRegionSubdivision | A country subdivision, such as a state, province, or prefecture. | code (subdivision code), country { code } |
Read and write subdivision membership using MarketRegionSubdivision and its subdivision input.
Anchor to Read membership from ,[object Object]Read membership from conditions.regionsCondition.regions
conditions.regionsCondition.regionsThe source of truth for a market's region membership, including its subdivisions, is the regions connection on the market's conditions.regionsCondition.
Don't use the top-level Market.regions field as the source of truth for subdivision membership. It's deprecated. Read membership from conditions.regionsCondition.regions instead.
Don't use the top-level Market.regions field as the source of truth for subdivision membership. It's deprecated. Read membership from conditions.regionsCondition.regions instead.
Anchor to Read a subdivision market's membershipRead a subdivision market's membership
To read which subdivisions a market targets, query conditions.regionsCondition.regions and use an inline fragment on MarketRegionSubdivision to select the subdivision code and its country.
POST https://{shop}.myshopify.com/admin/api/{api_version}/graphql.json
Read a market's region membership
JSON response
Iterate over the regions nodes and branch on __typename to handle whole-country (MarketRegionCountry) and subdivision (MarketRegionSubdivision) nodes. Because membership is a flat list, you don't need to expand or resolve any nested structure.
Anchor to Identify subdivision marketsIdentify subdivision markets
The Admin API doesn't expose a dedicated subdivision-market filter. Apps can identify subdivision markets by reading conditions.regionsCondition.regions and checking for MarketRegionSubdivision nodes.
The Admin API doesn't expose a dedicated subdivision-market filter. Apps can identify subdivision markets by reading conditions.regionsCondition.regions and checking for MarketRegionSubdivision nodes.
There's no first-class way to ask the API for only subdivision markets. Instead, list region markets (filter the markets query by type: REGION) and identify subdivision markets client-side: a market is a subdivision market if any node in its conditions.regionsCondition.regions is a MarketRegionSubdivision.
POST https://{shop}.myshopify.com/admin/api/{api_version}/graphql.json
List markets with their region membership
Then treat a market as a subdivision market when any of its region nodes is a MarketRegionSubdivision:
Anchor to Create a subdivision marketCreate a subdivision market
To create a subdivision market, pass the subdivision in the regionsCondition.regions input. Each region input takes a countryCode and an optional subdivision code.
POST https://{shop}.myshopify.com/admin/api/{api_version}/graphql.json
Create a market for California
JSON response
You can mix whole-country and subdivision conditions in the same market. Omit subdivision to target the whole country, or include it to target a single subdivision within that country.
Anchor to Update a subdivision marketUpdate a subdivision market
To change which regions a market targets, use marketUpdate. Unlike marketCreate, the conditions argument on marketUpdate is a delta: add regions with conditionsToAdd and remove regions with conditionsToDelete, each of which takes the same regionsCondition shape. The example below adds two U.S. states to a market.
POST https://{shop}.myshopify.com/admin/api/{api_version}/graphql.json
Add California and New York to a market
Anchor to Responder supportResponder support
Not every part of Shopify that reads market configuration ("responders") supports subdivision markets yet. Delivery and shipping is the first supported responder. The market-driven shipping feature preview owns rollout dates, the ShopFeatures.marketDrivenShipping feature, Market.delivery, and app-owned delivery-profile guidance.
Don't assume that other areas, such as discounts, catalogs, theme contextualization, Market Manager, or market metafields, support subdivision markets. Support is added per responder. Confirm a responder's support before relying on subdivision-level behavior there.
Don't assume that other areas, such as discounts, catalogs, theme contextualization, Market Manager, or market metafields, support subdivision markets. Support is added per responder. Confirm a responder's support before relying on subdivision-level behavior there.
Treat market membership as configuration data, not as a behavior contract. Don't infer a market's effective shipping or tax behavior from its raw region membership. Read effective behavior from the responder's own API surface (for example, the Delivery APIs for shipping) rather than reconstructing it from the regions a market targets.
Anchor to Next stepsNext steps
- Learn about the market types you can create.