When I am trying to use “marketRegionDelete” with 2025-01 graphql api version, it gives me “INTERNAL SERVER” ERROR every time. Can anyone help me regarding this??
Hi @Harsh_Patel! Looks like the marketRegionDelete mutation is deprecated and has been replaced by marketUpdate. I checked the logs for the x-request-id in your error and it appears to be happening because the deprecated mutation has an issue that causes it to fail when trying to reorganize market conditions.
To remove a region from a market, you’ll want to use marketUpdate with the conditionsToDelete field instead:
mutation marketUpdate($input: MarketUpdateInput!) {
marketUpdate(id: "gid://shopify/Market/YOUR_MARKET_ID", input: $input) {
market {
id
conditions {
regionsCondition {
regions(first: 10) {
edges {
node {
id
name
}
}
}
}
}
}
userErrors {
field
message
code
}
}
}
With variables:
{
"input": {
"conditions": {
"conditionsToDelete": {
"regionsCondition": {
"regions": [
{
"countryCode": "US"
}
]
}
}
}
}
}
Note that you’ll need to provide the market ID (not the region ID) and specify the region by country code rather than by the region’s GID. This is the current supported approach for managing market regions.
Let me know if that works for you!
{
"data": {
"marketUpdate": {
"market": null,
"userErrors": [
{
"field": [
"input",
"conditions"
],
"message": "There is an existing region market with the same regions."
},
{
"field": [
"input",
"conditions"
],
"message": "There is an existing region or wildcard market with the same set of conditions."
}
]
}
},
"extensions": {
"cost": {
"requestedQueryCost": 10,
"actualQueryCost": 10,
"throttleStatus": {
"maximumAvailable": 2000.0,
"currentlyAvailable": 1990,
"restoreRate": 100.0
}
}
}
}
i have tried your solution but i got this response
here is graphql api structure and variables:
mutation marketUpdate ($id: ID!, $input: MarketUpdateInput!){
marketUpdate(id: $id, input: $input){
market{
id
handle
}
userErrors{
code
field
message
}
}
}
{
"id" : "gid://shopify/Market/19394035755",
"input":{
"conditions" :{
"conditionsToDelete": {
"regionsCondition": {
"regions": [
{
"countryCode": "IN"
}
]
}
}
}
}
}
PLEASE NOTE THAT I HAVE USED GRAPHQL VERSION 2025-07
AND India region is part of more than one market.
Thanks for the extra detail @Harsh_Patel - that confirms what’s happening. The key is that India is in multiple markets. In the new Markets experience (API version 2025-04+), regions can exist in multiple markets simultaneously, but you can’t end up with two markets that have the exact same set of regions.
So when you try to remove India from this market, the resulting region set would match another existing market - hence the “existing region market with the same regions” error.
To figure out what’s conflicting, run this query to see all your markets and their regions:
{
markets(first: 20) {
edges {
node {
id
name
status
conditions {
regionsCondition {
regions(first: 50) {
edges {
node {
id
name
}
}
}
}
}
}
}
}
}
Once you see the full picture, you’ve got a few options:
-
If you want to keep this market unique after removing India, add a different region to it first
-
If this market is redundant, delete it entirely with marketDelete
-
If you need to consolidate, you may need to adjust multiple markets to avoid the duplicate
