--- title: Metafield - Storefront API description: | Metafields represent custom metadata attached to a resource. Metafields can be sorted into namespaces and are comprised of keys, values, and value types. api_version: 2025-10 api_name: storefront type: object api_type: graphql source_url: html: https://shopify.dev/docs/api/storefront/latest/objects/Metafield md: https://shopify.dev/docs/api/storefront/latest/objects/Metafield.md --- # Metafield object Metafields represent custom metadata attached to a resource. Metafields can be sorted into namespaces and are comprised of keys, values, and value types. ## Fields * created​At [Date​Time!](https://shopify.dev/docs/api/storefront/latest/scalars/DateTime) non-null The date and time when the storefront metafield was created. * description [String](https://shopify.dev/docs/api/storefront/latest/scalars/String) The description of a metafield. * id [ID!](https://shopify.dev/docs/api/storefront/latest/scalars/ID) non-null A globally-unique ID. * key [String!](https://shopify.dev/docs/api/storefront/latest/scalars/String) non-null The unique identifier for the metafield within its namespace. * namespace [String!](https://shopify.dev/docs/api/storefront/latest/scalars/String) non-null The container for a group of metafields that the metafield is associated with. * parent​Resource [Metafield​Parent​Resource!](https://shopify.dev/docs/api/storefront/latest/unions/MetafieldParentResource) non-null The type of resource that the metafield is attached to. * reference [Metafield​Reference](https://shopify.dev/docs/api/storefront/latest/unions/MetafieldReference) Returns a reference object if the metafield's type is a resource reference. * references [Metafield​Reference​Connection](https://shopify.dev/docs/api/storefront/latest/connections/MetafieldReferenceConnection) A list of reference objects if the metafield's type is a resource reference list. * type [String!](https://shopify.dev/docs/api/storefront/latest/scalars/String) non-null The type name of the metafield. Refer to the list of [supported types](https://shopify.dev/apps/metafields/definitions/types). * updated​At [Date​Time!](https://shopify.dev/docs/api/storefront/latest/scalars/DateTime) non-null The date and time when the metafield was last updated. * value [String!](https://shopify.dev/docs/api/storefront/latest/scalars/String) non-null The data stored in the metafield. Always stored as a string, regardless of the metafield's type. *** ## Map ### Fields with this object * {}[Article.metafield](https://shopify.dev/docs/api/storefront/latest/objects/Article#field-metafield) * {}[Article.metafields](https://shopify.dev/docs/api/storefront/latest/objects/Article#field-metafields) * {}[Blog.metafield](https://shopify.dev/docs/api/storefront/latest/objects/Blog#field-metafield) * {}[Blog.metafields](https://shopify.dev/docs/api/storefront/latest/objects/Blog#field-metafields) * {}[Cart.metafield](https://shopify.dev/docs/api/storefront/latest/objects/Cart#field-metafield) * {}[Cart.metafields](https://shopify.dev/docs/api/storefront/latest/objects/Cart#field-metafields) * {}[Collection.metafield](https://shopify.dev/docs/api/storefront/latest/objects/Collection#field-metafield) * {}[Collection.metafields](https://shopify.dev/docs/api/storefront/latest/objects/Collection#field-metafields) * {}[Company.metafield](https://shopify.dev/docs/api/storefront/latest/objects/Company#field-metafield) * {}[Company.metafields](https://shopify.dev/docs/api/storefront/latest/objects/Company#field-metafields) * {}[CompanyLocation.metafield](https://shopify.dev/docs/api/storefront/latest/objects/CompanyLocation#field-metafield) * {}[CompanyLocation.metafields](https://shopify.dev/docs/api/storefront/latest/objects/CompanyLocation#field-metafields) * {}[Customer.metafield](https://shopify.dev/docs/api/storefront/latest/objects/Customer#field-metafield) * {}[Customer.metafields](https://shopify.dev/docs/api/storefront/latest/objects/Customer#field-metafields) * ||-[HasMetafields.metafield](https://shopify.dev/docs/api/storefront/latest/interfaces/HasMetafields#field-metafield) * ||-[HasMetafields.metafields](https://shopify.dev/docs/api/storefront/latest/interfaces/HasMetafields#field-metafields) * {}[Location.metafield](https://shopify.dev/docs/api/storefront/latest/objects/Location#field-metafield) * {}[Location.metafields](https://shopify.dev/docs/api/storefront/latest/objects/Location#field-metafields) * {}[Market.metafield](https://shopify.dev/docs/api/storefront/latest/objects/Market#field-metafield) * {}[Market.metafields](https://shopify.dev/docs/api/storefront/latest/objects/Market#field-metafields) * {}[Order.metafield](https://shopify.dev/docs/api/storefront/latest/objects/Order#field-metafield) * {}[Order.metafields](https://shopify.dev/docs/api/storefront/latest/objects/Order#field-metafields) * {}[Page.metafield](https://shopify.dev/docs/api/storefront/latest/objects/Page#field-metafield) * {}[Page.metafields](https://shopify.dev/docs/api/storefront/latest/objects/Page#field-metafields) * {}[Product.metafield](https://shopify.dev/docs/api/storefront/latest/objects/Product#field-metafield) * {}[Product.metafields](https://shopify.dev/docs/api/storefront/latest/objects/Product#field-metafields) * {}[ProductVariant.metafield](https://shopify.dev/docs/api/storefront/latest/objects/ProductVariant#field-metafield) * {}[ProductVariant.metafields](https://shopify.dev/docs/api/storefront/latest/objects/ProductVariant#field-metafields) * {}[SellingPlan.metafield](https://shopify.dev/docs/api/storefront/latest/objects/SellingPlan#field-metafield) * {}[SellingPlan.metafields](https://shopify.dev/docs/api/storefront/latest/objects/SellingPlan#field-metafields) *** ## Mutations * [cart​Metafields​Set](https://shopify.dev/docs/api/storefront/latest/mutations/cartMetafieldsSet) mutation Sets cart metafield values. Cart metafield values will be set regardless if they were previously created or not. Allows a maximum of 25 cart metafields to be set at a time. *** ## <\~> Metafield Mutations ### Mutated by * <\~>[cart​Metafields​Set](https://shopify.dev/docs/api/storefront/latest/mutations/cartMetafieldsSet) *** ## Interfaces * [Node](https://shopify.dev/docs/api/storefront/latest/interfaces/Node) interface *** ## ||-Metafield Implements ### Implements * ||-[Node](https://shopify.dev/docs/api/storefront/latest/interfaces/Node)