How do I modify a “Standard Metafield” via the API?
I’m trying to update Fera to sync product the reviews.rating metafield to Shopify from Fera for a product, but it does not seem to work.
- I’m able to update custom metafields via the API just fine using both REST and GraphQL, so there’s nothing wrong with my API usage.
- The store I’m working in has already granted the
write_product permission scope (hence updating normal metafields possible), so it’s not a standard scopes/permissions issue.
- I’m using API version 2021-01, but I’ve also tried updating to the latest version and it still does not work.
I’ve even tried adding in the standard metafield reviews.rating via both APIs and they give me a “reviews metafield namespace is reserved”, so I know it’s there…just can’t figure out how to edit it.
Anyone know if there are any additional permissions we need or anything else I’m supposed to be doing to modify the standard metafield values for a product?
Hi @jayelkaake –
You should be able to use the standardMetafieldDefinitionEnable mutation, but you’ll need to use the latest API – standard metafields are not available in the 2021-01 version. Can you let me know what happens when you try that mutation with 2022-01?
Thank you! Will try that out and post back.
I was able to get it working by enabling it using that mutation - thank you!!
I guess we have to enable it for all our merchants upon installation.
@richard-penner any idea if there are plans by Shopify to enable it by default for merchants?
I checked both a Shopify Theme 2.0 store and a legacy one and both don’t have it enabled by default.
I believe we’re going to be growing the number of standard metafields in the future, so while we don’t want to enable them by default, we are looking for ways to make sure merchants find the standards they need. In the meantime, yes the correct approach is for apps to enable the standards their app implements on the shop via this API. Glad this is working for you!