Anchor to marketUpdatemarket
marketUpdate
mutation
Requires for queries and both
as well as
for mutations.
Updates the properties of a market.
Anchor to Arguments
Arguments
- •ID!required
The ID of the market to update.
- Anchor to inputinput•Market
Update requiredInput! The properties to update.
Was this section helpful?
Anchor to MarketUpdatePayload returnsMarketUpdatePayload returns
- Anchor to marketmarket•
The market object.
- Anchor to userErrorsuser•
Errors [MarketUser non-nullError!]! The list of errors that occurred from executing the mutation.
Was this section helpful?
- Update a market status to make it draft
- Update a market to add a new catalog
- Update a market to change its conditions
- marketUpdate reference
Examples
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation marketUpdate($input: MarketUpdateInput!) {
marketUpdate(id: "gid://shopify/Market/73827535", input: $input) {
market {
id
handle
status
conditions {
regionsCondition {
regions(first: 10) {
edges {
node {
id
name
}
}
}
}
}
currencySettings {
baseCurrency {
currencyCode
mutation marketUpdate($input: MarketUpdateInput!) {
marketUpdate(id: "gid://shopify/Market/73827535", input: $input) {
market {
id
handle
status
conditions {
regionsCondition {
regions(first: 10) {
edges {
node {
id
name
}
}
}
}
}
currencySettings {
baseCurrency {
currencyCode
}
localCurrencies
}
}
userErrors {
field
message
code
}
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-04/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation marketUpdate($input: MarketUpdateInput!) { marketUpdate(id: \"gid://shopify/Market/73827535\", input: $input) { market { id handle status conditions { regionsCondition { regions(first: 10) { edges { node { id name } } } } } currencySettings { baseCurrency { currencyCode } localCurrencies } } userErrors { field message code } } }",
"variables": {
"input": {
"status": "DRAFT"
}
}
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation marketUpdate($input: MarketUpdateInput!) {
marketUpdate(id: "gid://shopify/Market/73827535", input: $input) {
market {
id
handle
status
conditions {
regionsCondition {
regions(first: 10) {
edges {
node {
id
name
}
}
}
}
}
currencySettings {
baseCurrency {
currencyCode
}
localCurrencies
}
}
userErrors {
field
message
code
}
}
}`,
{
variables: {
"input": {
"status": "DRAFT"
}
},
},
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation marketUpdate($input: MarketUpdateInput!) {
marketUpdate(id: "gid://shopify/Market/73827535", input: $input) {
market {
id
handle
status
conditions {
regionsCondition {
regions(first: 10) {
edges {
node {
id
name
}
}
}
}
}
currencySettings {
baseCurrency {
currencyCode
}
localCurrencies
}
}
userErrors {
field
message
code
}
}
}`,
"variables": {
"input": {
"status": "DRAFT"
}
},
},
});
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
mutation marketUpdate($input: MarketUpdateInput!) {
marketUpdate(id: "gid://shopify/Market/73827535", input: $input) {
market {
id
handle
status
conditions {
regionsCondition {
regions(first: 10) {
edges {
node {
id
name
}
}
}
}
}
currencySettings {
baseCurrency {
currencyCode
}
localCurrencies
}
}
userErrors {
field
message
code
}
}
}
QUERY
variables = {
"input": {
"status": "DRAFT"
}
}
response = client.query(query: query, variables: variables)
Input variables
JSON{
"input": {
"status": "DRAFT"
}
}
Response
JSON{
"marketUpdate": {
"market": {
"id": "gid://shopify/Market/73827535",
"handle": "us",
"status": "DRAFT",
"conditions": {
"regionsCondition": {
"regions": {
"edges": [
{
"node": {
"id": "gid://shopify/MarketRegionCountry/397370199",
"name": "United States"
}
}
]
}
}
},
"currencySettings": {
"baseCurrency": {
"currencyCode": "USD"
},
"localCurrencies": false
}
},
"userErrors": []