Help Required: Understanding Shopify Market Translations and Resolving invalid id Error

Hi Alan / Shopify Partner Support,

I’m currently working on integrating localized content for Shopify markets using the marketLocalizableResourcesByIds query. My goal is to retrieve and manage translations for specific product resources across markets.

Here’s the query I’m trying to run:

query {
  marketLocalizableResourcesByIds(resourceIds: ["gid://shopify/Product/9257449685324"], first: 250) {
    nodes {
      resourceId
      marketLocalizableContent {
        key
        value
        digest
      }
      marketLocalizations(marketId: "gid://shopify/Market/95683150156") {
        key
        market {
          handle
          id
        }
        value
      }
    }
  }
}

However, I’m receiving an “Invalid ID” error. I’ve confirmed the product ID and market ID both exist and are correct (as returned from other APIs), but the query fails when run.

Could you help clarify the following:

  1. What is the expected format or requirements for resourceIds and marketId in this query?
  2. Is there a prerequisite (like registering the resource for localization) before this query works?
  3. Are there any specific scopes or permissions needed to access market-localized content?
  4. What is the recommended workflow to get, update, and publish translations for market-localized resources (like Products or Collections) via GraphQL?

Any guidance or documentation you can point me to would be greatly appreciated.

1 Like

Hello @Aayush_Soni

First of all, it might be a long shot listening to me, as I have honestly never used the marketLocalizableResourcesByIds or even MarketLocalization like that at all.

As I read the documentation, MarketLocalization is not something that by default exists in your shop, so it makes sense that marketLocalizableResourcesByIds does not return anything (the ‘invalid id’ error is vague) before you’ve registeret some market specific localizations with translationsRegister.

marketLocalizableResourcesByIds returns already localized entries, not fields that could be localized.

Can you test by running something like

mutation RegisterProductTranslations {
  translationsRegister(
    resourceId: "gid://shopify/Product/9257449685324",
    translations: [
      {
        locale: "en",
        key: "title",
        value: "English Product Title"
      },
      {
        locale: "de",
        key: "title",
        value: "Deutscher Produkttitel"
      }
    ]
  ) {
    translations {
      key
      value
      locale
    }
    userErrors {
      field
      message
    }
  }
}

Hey @Aayush_Soni !

@curzey is right, but there are a few distinctions to be made.

There are actually two separate systems for handling different types of content in Shopify’s markets functionality, and they use different queries and mutations.

For standard product content (titles, descriptions, etc.), use the translation system:
First, query translatableResourcesById with your product ID to get the translatable fields.

Then use translationsRegister mutation as mentioned above, to add translations. Note, make sure to include the translatableContentDigest from the first query’s response in this mutations as it’s a required field.

For market-specific custom content that’s when you’ll use the marketLocalizableResources objects and the valid id’s are metafields and metaobjects (you can see the types here):
After querying these resources, then you’ll use the marketLocalizationsRegister mutation to add market-specific content.

Let me know if that helps clear that up.

Hey @Aayush_Soni, just checking in to see if the above helped to unblock you here?

Hi @curzey and @KyleG-Shopify thanks for your support,

This is looking good so far. I believe the issue I was facing with pushing translations for a specific market is resolved by including the marketId in the translationRegister payload.

However, I have a follow-up question regarding a specific use case:

If I already have a global German translation available, and I then create a market named “EMEA” with German enabled, I encounter an issue when trying to push the same translation content to this specific market. The error I receive is:
Code - FAILS_RESOURCE_VALIDATION
Message - Value cannot match original content

Could you please clarify the intended behavior here? Specifically, is it expected that market-specific translations must differ from the global content? I’m trying to understand the use case or limitation around reusing the same global translation content for specific markets.