Is it ok to use unstructued metafields in a production Shopify App

Hi everyone,

I’m building my first public Shopify App, a bundle builder that allows merchants to offer dynamic product bundles. I need to pass data to a Shopify Function to bundle multiple products under one “parent” product.

The Shopify documentation states it’s unsafe to pass this data via cart line item properties. My current solution is to store the necessary data in a metafield on the “parent” product. I’ve got this working by passing the data as an unstructured metafield on the product.

My question is: is it acceptable to use an unstructured metafield in a public app that I plan to submit to the App Store, or is a structured metafield required?

I’m asking because using structured metafields would require me to create and manage them through the Shopify GraphQL Admin API, adding another layer of complexity to my app’s already intricate logic. I’d like to confirm if my current, simpler approach is a viable long-term solution.

Thanks for your help!

1 Like

Hey @Patrick_Pierre

I would recommend taking a look at declarative custom fields using the new app dev.

I believe it will be released (get out of beta) next week or something. Unless I misunderstood something.

Edit: https://x.com/eytanseidman/status/1949809867402707223

1 Like

Hey @Patrick_Pierre

Echoing what curzey shared about looking into declarative custom data definitions, they make it much easier to manage structured metafields.

That said – if unstructured metafields serve your purpose and you’re not concerned about enforcing a consistent metafield type across products then there’s nothing wrong with continuing to use them in a public app :+1:

1 Like