marketLocalizationsRegister gives odd error

marketLocalizationsRegister gives odd error

damnsahi
Shopify Partner
1 0 0

I’m working with the marketLocalizationsRegister mutation to register a localization for a Shopify Market. However, I keep getting an "invalid id" error, even though the Market ID is correct.

 

mutation marketLocalizationsRegister(
  $marketLocalizations: [MarketLocalizationRegisterInput!]!,
  $resourceId: ID!
) {
  marketLocalizationsRegister(marketLocalizations: $marketLocalizations, resourceId: $resourceId) {
    marketLocalizations {
      key
      market {
        id
      } // tried marketId also
      outdated
      updatedAt
      value
    }
    userErrors {
      field
      message
    }
  }
}

 

 

Variables i provide

 

{
  "marketLocalizations": [
    {
      "key": "hu",
      "marketId": "gid://shopify/Market/28819292395",
      "marketLocalizableContentDigest": "eyJsb2NhbGUiOiJodSIsIm1hcmtldCI6ImdpZDovL3Nob3BpZnkvTWFya2V0LzI4ODE5MjU5NjI3IiwidGltZXN0YW1wIjoxNzM4OTQ1ODQ1NDgwfQ==",
      "value": "hu"
    }
  ],
  "resourceId": "gid://shopify/Market/28819292395"
}

 

📌 Debugging Steps I’ve Tried:

 

 Checked if Market ID is correct using:

 

query {
  markets(first: 10) {
    edges {
      node {
        id
        name
      }
    }
  }
}

 

Confirmed the correct resource type (Market)

 Tried using Shop instead of Market → Also invalid ID error

 Checked if the Market is published and active

 

Questions:

1. Why does Shopify return "invalid id" when the Market ID is correct?

2. Is there a required step before registering marketLocalizations?

3. Does the marketLocalizableContentDigest need to be generated in a specific way?

4. Are there API limitations that might cause this?

 

Would love any insights from Shopify experts or someone who’s successfully used marketLocalizationsRegister! 🚀

 

Thanks in advance! 🙌

Replies 0 (0)