Each entry is a string containing the product’s global ID (GID)
GID format: gid://shopify/Product/{product_id}
Metafield type should be list.product_reference
Implementation Challenge:
One user encountered a “406 Not Acceptable” error when using a PUT request to products/{id}/metafields.json. They resolved it by switching to the metafields endpoint directly: metafields/{metafield_id}.json.
Status:
The formatting question has been answered with working examples and code snippets. At least one user successfully implemented the solution using the alternative API endpoint.
Summarized with AI on October 24.
AI used: claude-sonnet-4-5-20250929.
Can anyone help on this, I am trying to create a metafield for the same - list.product_reference.
Trying a PUT request to products/{id}/metafields.json
Yes @MichaelSD
Instead of updating using products api, I used “metafields/{metafield_id}.json”
A PUT request to the above worked for me.
Payload similar to below -
{“metafield”: {“namespace”: “custom”, “key”: “rec_products”, “value”: “[“gid://shopify/Product/{product id}”]”, “type”: “list.product_reference”}}
When you’re working with Shopify metafields for product lists, the format isn’t a freeform JSON object like your example — Shopify expects an array of product GIDs (global IDs), not key-value pairs.
For a product list metafield, the correct JSON looks like this:
It must be a JSON array ([ ]), not an object ({ }).
Each entry is a string containing the GID of a product.
GID format is always:
gid://shopify/Product/{product_id}
You can fetch the correct GIDs from the Admin API or GraphQL API (id field).
Example metafield definition in Shopify (type: Product List) would accept the above format.
If you’re pushing this through a connector to NetSuite, you should serialize it exactly like that array.