Skip to main content

Market types


A region market is composed of one or more regions.

Only one market with the same set of regions can be active at a time.

The following example shows how to create a region market for the United States, Canada, and Mexico.

POST https://{shop}.myshopify.com/admin/api/{api_version}/graphql.json

Create a market for North America

mutation CreateNorthAmericaMarket {
marketCreate(input: {
name: "North America",
status: ACTIVE,
conditions: {
regionsCondition: {
regions: [
{
countryCode: US
},
{
countryCode: CA
},
{
countryCode: MX
}
]
}
}
}) {
market {
id
name
conditions {
conditionTypes
regionsCondition {
applicationLevel
regions(first: 10) { nodes { id name } }
}
}
}
userErrors { field code message }
}
}

JSON response

{
"data": {
"marketCreate": {
"market": {
"id": "gid://shopify/Market/1",
"name": "North America",
"conditions": {
"conditionTypes": [
"REGION"
],
"regionsCondition": {
"applicationLevel": "SPECIFIED",
"regions": {
"nodes": [
{
"id": "gid://shopify/MarketRegionCountry/35486695446",
"name": "United States"
},
{
"id": "gid://shopify/MarketRegionCountry/3260461842454",
"name": "Canada"
},
{
"id": "gid://shopify/MarketRegionCountry/35491512342",
"name": "Mexico"
}
]
}
}
}
},
"userErrors": []
}
}
}

Anchor to Location and Company location marketsLocation and Company location markets

A company location market is a market that targets B2B buyers. A location market targets a specific POS location.

The company location (B2B) and location (retail) markets can target specific locations, or all locations in a region.

Anchor to Specific company location or location marketsSpecific company location or location markets

The following example shows how to create a market for specific company locations.

POST https://{shop}.myshopify.com/admin/api/{api_version}/graphql.json

Create a market for specific company locations

mutation CreateACMECompanyLocationsMarket {
marketCreate(input: {
name: "ACME Locations",
status: ACTIVE,
conditions: {
companyLocationsCondition: {
companyLocationIds: [
"gid://shopify/CompanyLocation/2820014102",
"gid://shopify/CompanyLocation/2445639702"
]
}
}
}) {
market {
id
name
conditions {
conditionTypes
companyLocationsCondition {
applicationLevel
companyLocations(first: 10) { nodes { id name } }
}
}
}
userErrors { field code message }
}
}

JSON response

{
"data": {
"marketCreate": {
"market": {
"id": "gid://shopify/Market/89508184086",
"name": "ACME Locations",
"conditions": {
"conditionTypes": [
"COMPANY_LOCATION"
],
"companyLocationsCondition": {
"applicationLevel": "SPECIFIED",
"companyLocations": {
"nodes": [
{
"id": "gid://shopify/CompanyLocation/2820014102",
"name": "6660 Kennedy Road"
},
{
"id": "gid://shopify/CompanyLocation/2445639702",
"name": "7389 Lundy's Lane"
}
]
}
}
}
},
"userErrors": []
}
}
}

Anchor to Using wildcards in markets for all company locations or locations in a regionUsing wildcards in markets for all company locations or locations in a region

Company location (B2B) or location (retail) markets can target all locations within a region. Newly created locations are automatically added to this type of market if they are part of that region

Note

A shop can have up to 100 markets that combine more than one condition type, such as the following market that combines a locations condition and a regions condition. This limit applies whether a market is active or draft. If creating or updating a market would exceed the limit, then Shopify returns the EXCEEDS_MAX_MULTI_CONTEXT_MARKETS user error.

The following example shows how to create a market for all POS locations in Canada. Anytime a new POS location is created in Canada, it is automatically added to this market.

POST https://{shop}.myshopify.com/admin/api/{api_version}/graphql.json

Create a Canada retail market

mutation CreateRetailCanada {
marketCreate(input: {
name: "Canada Retail",
conditions: {
locationsCondition: {
applicationLevel: ALL
}
regionsCondition: {
regions: [{
countryCode: CA
}]
}
}
}) {
market {
id
name
conditions {
conditionTypes
regionsCondition {
applicationLevel
regions(first: 10) { nodes { id name } }
}
locationsCondition {
applicationLevel
locations(first: 10) { nodes { id name } }
}
}
}
userErrors { field code message }
}
}

JSON response

{
"data": {
"marketCreate": {
"market": {
"id": "gid://shopify/Market/1",
"name": "Canada Retail",
"conditions": {
"conditionTypes": [
"LOCATION",
"REGION"
],
"regionsCondition": {
"applicationLevel": "SPECIFIED",
"regions": {
"nodes": [
{
"id": "gid://shopify/MarketRegionCountry/1",
"name": "Canada"
}
]
}
},
"locationsCondition": {
"applicationLevel": "ALL",
"locations": {
"nodes": []
}
}
}
},
"userErrors": []
}
}
}


Was this page helpful?