Menu

shopify.metafields returns undefined in my checkout extension after 2026-04 — here's why
📰

shopify.metafields returns undefined in my checkout extension after 2026-04 — here's why

DEV Community·FlareCanary·6 months ago
#1Xoxvz5y
#shopify#api#webdev#metafields#order
Reading 0:00
15s threshold

If you just bumped your checkout UI extension to Shopify API version 2026-04 and your shopify.metafields reads started returning undefined , you've hit the biggest breaking change in this release.

Checkout metafields in the metafields API are gone. They've been replaced by order metafields in the appMetafields API. The rename isn't cosmetic — it's a different data source, a different access pattern, and a different set of timing semantics. The old code doesn't error; it just silently returns nothing.

What the failure looks like

The code that worked on 2026-01:

import { extension } from ' @shopify/ui-extensions/checkout ' ;

export default extension ( ' purchase.checkout.block.render ' , ( root , api ) => { const { metafields } = api ; const myField = metafields . current . find ( m => m . namespace === ' custom ' && m . key === ' delivery_window ' ); // myField.value used to be "2026-05-01T09:00:00" root . append ( root . createText ( myField ?. value ??…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.