Skip to main content
union

The resource that a metafield points to when its type is a resource reference. Metafields can store references to other Shopify resources, and this union provides access to the actual referenced object.

Returned by the Metafield object's reference field for single references or the references field for lists.

Anchor to ArticleArticle
•OBJECT

A post that belongs to a Blog. Each article includes content with optional HTML formatting, an excerpt for previews, ArticleAuthor information, and an associated Image.

Articles can be organized with tags and include SEO metadata. You can manage comments when the blog's comment policy enables them.

•OBJECT

A group of products organized by a merchant to make their store easier to browse. Collections can help customers discover related products by category, season, promotion, or other criteria.

Query a collection's products with filtering options like availability, price range, vendor, and tags. Each collection includes SEO information, an optional Image, and supports custom data through metafields.

•OBJECT

Any file that doesn't fit into a designated type like image or video. For example, a PDF or JSON document. Use this object to manage files in a merchant's store.

Generic files are commonly referenced through file reference metafields and returned as part of the MetafieldReference union.

Includes the file's URL, MIME type, size in bytes, and an optional preview image.

•OBJECT

An image hosted on Shopify's content delivery network (CDN). Used for product images, brand logos, and other visual content across the storefront.

The image field provides the actual image data with transformation options. Implements the Media interface alongside other media types like Video and Model3d.

•OBJECT

An instance of custom structured data defined by a metaobject definition. Metaobjects store reusable content that extends beyond standard Shopify resources, such as size charts, author profiles, or custom content sections.

Each metaobject contains fields that match the types and validation rules specified in its definition. Metafield references can point to metaobjects, connecting custom data with products, collections, and other resources. If the definition has the renderable capability, then the seo field provides SEO metadata. If it has the online_store capability, then the onlineStoreUrl field returns the public URL.

•OBJECT

Represents a Shopify hosted 3D model.

•OBJECT

A custom content page on a merchant's store. Pages display HTML-formatted content, such as "About Us", contact details, or store policies.

Each page has a unique handle for URL routing and includes SEO information for search engine optimization. Pages support Metafield attachments for storing additional custom data.

•OBJECT

Represents an item listed in a shop's catalog.

Products support multiple product variants, representing different versions of the same product, and can include various media types. Use the selectedOrFirstAvailableVariant or variantBySelectedOptions fields to help customers find the right variant based on their selections.

Products can be organized into collections, associated with selling plans for subscriptions, and extended with custom data through metafields.

Learn more about working with products and collections.

•OBJECT

A specific version of a product available for sale, differentiated by options like size or color. For example, a small blue t-shirt and a large blue t-shirt are separate variants of the same product. For more information, see the docs on Shopify's product model.

For products with quantity rules, variants enforce minimum, maximum, and increment constraints on purchases.

Variants also support subscriptions and pre-orders through selling plan allocations objects, bundle configurations through product variant components objects, and shop pay installments pricing for flexible payment options.

•OBJECT

A video hosted on Shopify's servers. Implements the Media interface and provides multiple video sources through the sources field, each with format, dimensions, and URL information for adaptive playback.

For videos hosted on external platforms like YouTube or Vimeo, use ExternalVideo instead.


Was this section helpful?

Anchor to Fields with this unionFields with this union

•OBJECT

Custom metadata attached to a Shopify resource such as a Product, Collection, or Customer. Each metafield is identified by a namespace and key, and stores a value with an associated type.

Values are always stored as strings, but the type field indicates how to interpret the data. When a metafield's type is a resource reference, use the reference or references fields to retrieve the linked objects. Access metafields on any resource that implements the HasMetafields interface.

•OBJECT

Custom metadata attached to a Shopify resource such as a Product, Collection, or Customer. Each metafield is identified by a namespace and key, and stores a value with an associated type.

Values are always stored as strings, but the type field indicates how to interpret the data. When a metafield's type is a resource reference, use the reference or references fields to retrieve the linked objects. Access metafields on any resource that implements the HasMetafields interface.

•CONNECTION

An auto-generated type for paginating through multiple MetafieldReferences.

•OBJECT

An auto-generated type which holds one MetafieldReference and a cursor during pagination.

•OBJECT

The value of a field within a Metaobject. For fields that reference other resources, use the reference field for single references or references for lists.

•OBJECT

The value of a field within a Metaobject. For fields that reference other resources, use the reference field for single references or references for lists.


Was this section helpful?