ProductSet Mutation: Metafields Failing When Upserting with customId (But Works with handle)

Hi everyone,

I’m currently integrating with Shopify via GraphQL and syncing products from an ERP. I’m using the productSet mutation for upserting products. I’ve noticed a different behavior depending on how I identify the product:

  • Upsert using handle → Works even when metafields are included in the mutation input.

  • Upsert using customId → Fails whenever metafields are included in the input.
    (If I remove metafields, the mutation succeeds.)

This makes the more reliable customId workflow unusable for my case, since I need to sync metafields alongside product data.

Here are the two scenarios:

Fails
productSet with customId + metafields array → Returns an error (screenshot omitted here but can provide if needed)

Succeeds
productSet with customId but without metafields in input


I’ve checked the docs and consulted Shopify support, but it’s not clear whether:

  • this is a known bug,

  • or intentional behavior/limitation of customId upserts.

Using metafieldSet as a second step is not ideal for our integration since we need atomic sync behavior.


:red_question_mark:Question

Is the inability to use metafields with customId upserts expected behavior?
And if not — is there any known workaround or update planned to support this combination?


Any clarification would be greatly appreciated!
Thank you :folded_hands:

Hi @Maximilian_Hoedlmose

It does look like this is expected behaviour and not a bug, to prevent accidental deletion of the identifying metafield. You’ll need to always include your customId metafield when sending metafields.

This works different with handles, because when you use handle as the identifier, the handle is a native product field, not a metafield. So there’s no conflict with the metafields array.