Skip to main content
Migrate to Polaris

Version 2025-07 is the last API version to support React-based UI components. Later versions use web components, native UI elements with built-in accessibility, better performance, and consistent styling with Shopify's design system. Check out the migration guide to upgrade your extension.

Metafields API

Requires Level 1 access to protected customer data when accessing metafields attached to customer, company, or companyLocation resources.

The Metafields API provides the app metafields and order metafields associated with the order. Use it to read custom data that your app or other apps have stored on order resources on the Order status page. Learn about using metafields in customer account UI extensions.

  • Display custom product data: Read metafields on products or variants to display additional information, such as care instructions, material details, or warranty terms.
  • Show customer-specific data: Access metafields on the customer resource to display loyalty points, membership tiers, or other customer-specific metadata.
  • Read order metadata: Access metafields on the order to display custom data set by your app or other extensions, such as delivery promises or fulfillment notes.

The Metafields API object provides app metafields and order metafields. Access the following properties on the API object to read metafield data.

Anchor to appMetafields
appMetafields
StatefulRemoteSubscribable<[]>
required

The metafields requested in the shopify.extension.toml file. These metafields are updated when there’s a change in the merchandise items being purchased by the customer.

Requires access to protected customer data.

Anchor to metafields
metafields
StatefulRemoteSubscribable<[]>
required

The metafields that apply to the current order. These metafields are shared by all extensions running on the Order status page and persist for the duration of the buyer's session.

Once the order is created, you can query these metafields using the GraphQL Admin API.


  • Configure app metafields in your TOML file: App metafields must be declared in your shopify.extension.toml before they're available through the appMetafields property.
  • Use useMetafield for order metafield lookups: When you need a specific order metafield, use useMetafield with the namespace and key instead of filtering the full metafields list.

  • App metafields must be declared in your shopify.extension.toml file before they're available through appMetafields. Undeclared app metafields aren't returned.
  • Order metafields are shared across all extensions on the Order status page and don't require TOML configuration.
  • Metafield values are returned as strings regardless of their content type. If a metafield contains JSON or other structured data, you need to parse it in your extension.

Was this page helpful?