Metafield definitions for owner type SHOP not accessible in admin

When creating metafield definitions using metafieldDefinitionCreate we can select different ownerType arguments like SHOP. Furthermore, we can describe the access mode, to let merchants see and modify these metafield values using admin.MERCHANT_READ_WRITE. When creating a metafield definition though using the API and owner type SHOP the admin does not show any Shop metafield definitions as seen here:

For other owner types this works as expected, though not for Shop metafield definitions. Is this a known limitation?

1 Like

Hi Ocastx,

I’ve asked the custom data team about this and will report back what I hear.

1 Like

To piggy back off of this, I’m trying to access SHOP metafields via the Storefront API; however, the metafield namespace and key are returning null.

https://shopify.dev/docs/api/storefront/2024-01/queries/shop

To piggyback off of this, I’m trying to access SHOP metafields via the Storefront API; however, the metafield namespace and key are returning null.

https://shopify.dev/docs/api/storefront/2024-01/queries/shop

Hi Ocastx - that lack of a UI on the admin for SHOP metafields is a known limitation, unfortunately there’s no timeline for implementing this at the moment.

Hey Liam, thanks for the quick update – appreciate it!

Just so that I understand it right: SHOP metafields are still safe to use though, there is just no UI for the merchant to edit those in admin. Is that correct?

Exactly - there’s no risk in using them via the API, there’s just no UI for them for merchants to interact with.

Hi Liam, would you happen to have an update on this yet? A timeline perhaps? I have built multiple websites using the functionality of shop level metafields and since the obligatory creation of definitions to expose them to the front API and no way to do that for SHOP level metafields using the AI, this is truly a pain in the ass, pardon my language.

Hi @Liam & @ocastx ,

Can you please explain , how to set Values to metafields with ownertype : SHOP

mutation MetafieldsSet($metafields: [MetafieldsSetInput!]!) {
metafieldsSet(metafields: $metafields) {
metafields {
key
namespace
value
ownerType
createdAt
updatedAt
}
userErrors {
field
message
code
}
}
}

{
“metafields”:
{
“key”: “haSsubscripn”,
“namespace”: “supscriptionstat”,
“ownerId”: “”
“ownerType”: “SHOP”,
“type”: “boolean”,
“value”: “true”
}

}

What is the ownerId we have to pass.? Please explain

*using the UI i meant :slightly_smiling_face: