--- title: HasMetafields - Storefront API description: > Implemented by resources that support custom metadata through [`Metafield`](/docs/api/storefront/2026-04/objects/Metafield) objects. Types like [`Product`](/docs/api/storefront/2026-04/objects/Product), [`Collection`](/docs/api/storefront/2026-04/objects/Collection), and [`Customer`](/docs/api/storefront/2026-04/objects/Customer) implement this interface to provide consistent access to metafields. You can retrieve a [single metafield](/docs/api/storefront/2026-04/interfaces/HasMetafields#fields-metafield) by namespace and key, or fetch [multiple metafields](/docs/api/storefront/2026-04/interfaces/HasMetafields#fields-metafields) in a single request. If you omit the namespace, then the [app-reserved namespace](https://shopify.dev/docs/apps/build/metafields#app-owned-metafields) is used by default. api_version: 2026-04 api_name: storefront type: interface api_type: graphql source_url: html: 'https://shopify.dev/docs/api/storefront/latest/interfaces/HasMetafields' md: 'https://shopify.dev/docs/api/storefront/latest/interfaces/HasMetafields.md' --- # Has​Metafields interface Implemented by resources that support custom metadata through [`Metafield`](https://shopify.dev/docs/api/storefront/2026-04/objects/Metafield) objects. Types like [`Product`](https://shopify.dev/docs/api/storefront/2026-04/objects/Product), [`Collection`](https://shopify.dev/docs/api/storefront/2026-04/objects/Collection), and [`Customer`](https://shopify.dev/docs/api/storefront/2026-04/objects/Customer) implement this interface to provide consistent access to metafields. You can retrieve a [single metafield](https://shopify.dev/docs/api/storefront/2026-04/interfaces/HasMetafields#fields-metafield) by namespace and key, or fetch [multiple metafields](https://shopify.dev/docs/api/storefront/2026-04/interfaces/HasMetafields#fields-metafields) in a single request. If you omit the namespace, then the [app-reserved namespace](https://shopify.dev/docs/apps/build/metafields#app-owned-metafields) is used by default. ## Fields * metafield [Metafield](https://shopify.dev/docs/api/storefront/latest/objects/Metafield) Token access required A [custom field](https://shopify.dev/docs/apps/build/custom-data), including its `namespace` and `key`, that's associated with a Shopify resource for the purposes of adding and storing additional information. * namespace [String](https://shopify.dev/docs/api/storefront/latest/scalars/String) ### Arguments The container the metafield belongs to. If omitted, the app-reserved namespace will be used. * key [String!](https://shopify.dev/docs/api/storefront/latest/scalars/String) required The identifier for the metafield. *** * metafields [\[Metafield\]!](https://shopify.dev/docs/api/storefront/latest/objects/Metafield) non-null Token access required A list of [custom fields](https://shopify.dev/docs/apps/build/custom-data) that a merchant associates with a Shopify resource. * identifiers [\[Has​Metafields​Identifier!\]!](https://shopify.dev/docs/api/storefront/latest/input-objects/HasMetafieldsIdentifier) required ### Arguments The list of metafields to retrieve by namespace and key. The input must not contain more than `250` values. *** *** ##### Variables ```json { "metafield": { "namespace": "", "key": "" }, "metafields": [ { "identifiers": "" } ] } ``` ##### Schema ```graphql interface HasMetafields { metafield: Metafield metafields: [Metafield]! } ```