Blog · · Product

Shopify metafields for stock: a merchant's primer

Shopify metafields are the unsung workhorse of every modern Shopify store. They let you attach structured data to your products — numbers, dates, colours, links — without hacking tags or cluttering your descriptions. For supplier stock, they are the right place to store "how much is at my supplier" data that does not fit Shopify's own inventory field.

Metafields vs tags

Tags are strings with no type. Metafields have types: integer, decimal, date, reference, JSON.

"In stock: 42" fits a metafield. "Backordered" fits a tag. The difference is: metafields are computable. You can filter by them, trigger Flow on them, and show conditional copy off them in ways you simply cannot with tags.

Namespaces and keys

Every metafield lives at namespace.key. Stockpost uses stock.on_hand and stock.with_supplier. The namespace is like a folder — it scopes your metafields away from other apps' metafields and from Shopify's built-in ones.

You can use metafields without a specific app, but most merchants end up using an app that writes them consistently, because maintaining them by hand across thousands of products is not realistic.

How to use them in your theme

Liquid: {{ product.metafields.stock.on_hand }} gives you the integer. Wrap it in a conditional to drive your product-page copy.

Or — and this is what most merchants should do — install a Shopify 2.0 theme and use a metafield block. No Liquid needed, just the theme editor.

How to use them in Shopify Flow

Flow has a "When a product's metafield changes" trigger. Your automations fire every time Stockpost updates the number.

Typical uses: hide the product when on-hand plus with-supplier hits zero; add or remove a low-stock tag; email the buying team when a key product drops.

How to use them in collection filters

Shopify has metafield-based faceted filtering. You can let shoppers filter by "in stock now" versus "within 5 days" — if the metafields exist and are kept fresh.

The same filters can power your internal admin views: "everything from Supplier X that is in stock now" for the buying team.

Ownership and migration

Because metafields are stored on the product in Shopify — not in a third-party app's own database — if you uninstall the app that wrote them, the values persist. Your data does not leave when the app does.

This is the main reason to prefer the metafield approach over in-app storage: the product data is yours, regardless of which app writes it.

Stockpost does this end-to-end: supplier email in, live supplier stock on your Shopify products. 14-day free trial, $39/month per store.