Metafield keys: restrictions on special characters?

Shopify Partner
9 1 7


We're getting a "metafields.key must be unique within this namespace on this resource" error attempting to update metafields on a product via the REST API.

The key values are indeed unique; however, they share a common prefix that contains an "&" character. For example:

  • mumble&mumble_key1
  • mumble&mumble_key2

Is this perhaps causing the key text after the "&" (the unique part) to be ignored?

Are there special characters which should not appear in metafield keys? There is no mention of such restrictions that I have found yet in the Metafields API documentation...

Or are there perhaps key length limitations that are truncating the keys before the unique part is reached?


Replies 2 (2)

Shopify Partner
6339 580 1350

Test Urlencoding the ampersands for a change in situation.

Save time & money ,Ask Questions The Smart Way

Confused? Busy? Get the solution you need

Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Buy Paul a Coffee for more answers or donate to

Shopify Partner
9 1 7

We can certainly try sanitizations, but needing something like UrlEncode() on the key value should be documented...