Skip to Content

Metafield

A namespaced custom field stored on a resource. Metafields allow you to attach custom data to various entities within the API while maintaining organizational structure through namespaces and keys.

Type Definition

type Metafield { id: ID! namespace: String! key: String! type: String! value: String! jsonValue: JSON }

Fields

FieldTypeDescription
idID!Unique identifier for this metafield.
namespaceString!Namespace grouping this metafield.
keyString!Key within the namespace.
typeString!Stored value type.
valueString!Stored value as a string.
jsonValueJSONParsed JSON value when type is json.

Relationships

Metafield is a flexible custom data container that can be attached to multiple resource types throughout the API. It is used by Address, Article, Blog, CartDiscount, CartLineItem, CartPaymentMethod, CartShippingMethod, Cart, Customer, Order, ProductGroup, Product, and ProductVariant objects. This allows any of these entities to store additional custom metadata while maintaining a consistent structure through the namespace and key organization system.

Example

{ metafield { id namespace key type value jsonValue } }

Implements

None

  • ID
  • String
  • JSON