Metafield Reference
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 Possible typesPossible types
- Article (Article)
- Collection (Collection)
- GenericFile (GenericFile)
- MediaImage (MediaImage)
- Metaobject (Metaobject)
- Model3d (Model3d)
- Page (Page)
- Product (Product)
- ProductVariant (ProductVariant)
- Video (Video)
- •OBJECT
A post that belongs to a
Blog. Each article includes content with optional HTML formatting, an excerpt for previews,information, and an associatedImage.Articles can be organized with tags and include
SEOmetadata. 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
SEOinformation, an optionalImage, and supports custom data throughmetafields.- •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
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
imagefield provides the actual image data with transformation options. Implements theMediainterface alongside other media types likeVideoandModel3d.- •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.
Metafieldreferences can point to metaobjects, connecting custom data with products, collections, and other resources. If the definition has therenderablecapability, then theseofield provides SEO metadata. If it has thecapability, then thefield 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
handlefor URL routing and includesSEOinformation for search engine optimization. Pages supportMetafieldattachments 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
orfields 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
Mediainterface and provides multiple video sources through thesourcesfield, each with format, dimensions, and URL information for adaptive playback.For videos hosted on external platforms like YouTube or Vimeo, use
instead.
Anchor to Fields with this unionFields with this union
- •OBJECT
Custom metadata attached to a Shopify resource such as a
Product,Collection, orCustomer. 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
typefield indicates how to interpret the data. When a metafield's type is a resource reference, use thereferenceorreferencesfields to retrieve the linked objects. Access metafields on any resource that implements theinterface.- •OBJECT
Custom metadata attached to a Shopify resource such as a
Product,Collection, orCustomer. 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
typefield indicates how to interpret the data. When a metafield's type is a resource reference, use thereferenceorreferencesfields to retrieve the linked objects. Access metafields on any resource that implements theinterface.- •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 thereferencefield for single references orreferencesfor lists.- •OBJECT
The value of a field within a
Metaobject. For fields that reference other resources, use thereferencefield for single references orreferencesfor lists.