Re: Metafield definitions for owner type SHOP not accessible in admin

Solved

Metafield definitions for owner type SHOP not accessible in admin

ocastx
Shopify Partner
31 6 12

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: 

 

ocastx_0-1709190294977.png

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

Accepted Solution (1)

Liam
Community Manager
3108 341 879

This is an accepted solution.

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. 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Replies 9 (9)

Liam
Community Manager
3108 341 879

Hi Ocastx,

 

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

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

kpowelltech
Shopify Partner
3 0 0

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

kpowelltech
Shopify Partner
3 0 0

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

Liam
Community Manager
3108 341 879

This is an accepted solution.

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. 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

ocastx
Shopify Partner
31 6 12

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? 

Liam
Community Manager
3108 341 879

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

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

MathijsDelva
Shopify Partner
27 0 5

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. 

MathijsDelva
Shopify Partner
27 0 5

*using the UI  i meant 🙂 

bootsgridDev
Shopify Partner
22 0 3

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