---
title: HasMetafields - Storefront API
description: >-
  Implemented by resources that support custom metadata through

  [`Metafield`](/docs/api/storefront/2026-10/objects/Metafield)

  objects. Types like

  [`Product`](/docs/api/storefront/2026-10/objects/Product),
  [`Collection`](/docs/api/storefront/2026-10/objects/Collection), and

  [`Customer`](/docs/api/storefront/2026-10/objects/Customer)

  implement this interface to provide consistent access to metafields.


  You can retrieve a [single
  metafield](/docs/api/storefront/2026-10/interfaces/HasMetafields#fields-metafield)

  by namespace and key, or fetch [multiple
  metafields](/docs/api/storefront/2026-10/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-10
source_url:
  html: 'https://shopify.dev/docs/api/storefront/latest/interfaces/HasMetafields'
  md: 'https://shopify.dev/docs/api/storefront/latest/interfaces/HasMetafields.md'
api_name: storefront
api_type: graphql
type: interface
---

# Has​Metafields

interface

Implemented by resources that support custom metadata through [`Metafield`](https://shopify.dev/docs/api/storefront/2026-10/objects/Metafield) objects. Types like [`Product`](https://shopify.dev/docs/api/storefront/2026-10/objects/Product), [`Collection`](https://shopify.dev/docs/api/storefront/2026-10/objects/Collection), and [`Customer`](https://shopify.dev/docs/api/storefront/2026-10/objects/Customer) implement this interface to provide consistent access to metafields.

You can retrieve a [single metafield](https://shopify.dev/docs/api/storefront/2026-10/interfaces/HasMetafields#fields-metafield) by namespace and key, or fetch [multiple metafields](https://shopify.dev/docs/api/storefront/2026-10/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.

  * key

    [String!](https://shopify.dev/docs/api/storefront/latest/scalars/String)

    required

    ### Arguments

    The identifier for the metafield.

  * namespace

    [String](https://shopify.dev/docs/api/storefront/latest/scalars/String)

    The container the metafield belongs to. If omitted, the app-reserved namespace will be used.

  ***

* 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": {
		"key": "",
		"namespace": ""
	},
	"metafields": [
		{
			"identifiers": ""
		}
	]
}
```

##### Schema

```graphql
interface HasMetafields {
  metafield: Metafield
  metafields: [Metafield]!
}
```
