---
title: "Metafield"
description: "Metafield information."
doc_type: graphql
doc_category: storefront
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/storefront-api/common-objects/objects/metafield'
  md: 'https://developer.shopline.com/docs/storefront-api/common-objects/objects/metafield.md'
---
# Metafield

Metafield information. 

- **API Version:** v20270301
- **API Type:** Storefront
- **API Protocol:** GraphQL
- **Operation Type:** Object

## Fields

* `createdAt`

  [Date](https://developer.shopline.com/docs/storefront-api/common/scalars/date.md)

  The date and time when the metafield was created. Format: [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601). 

* `namespace`

  [String](https://developer.shopline.com/docs/storefront-api/common/scalars/string.md)

  The namespace of the metafield, used to group metafields. A metafield can be uniquely identified by its `key` and `namespace`.   
  Only letters, numbers, hyphens, and underscores are supported.     
  Minimum length: 2  
  Maximum length: 50 
  

* `id`

  [ID](https://developer.shopline.com/docs/storefront-api/common/scalars/id.md)

  The ID of the metafiled.

* `type`

  [String](https://developer.shopline.com/docs/storefront-api/common/scalars/string.md)

  The data types available for the metafield feature. Valid values are:     
  - `single_line_text_field`: A single-line text field 
  - `list.single_line_text_field`: Multiple single-line text fields  
  - `multi_line_text_field`: Multi-line text field    
  - `color`: A single color  
  - `list.color`: Multiple colors 
  - `date`: A single date 
  - `list.date`: Multiple dates  
  - `date_time`: A single date and time. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).   
  - `list.date_time`: Multiple dates and times. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). 
  - `url`: A single URL  
  - `list.url`: Multiple URLs  
  - `file_reference`: A single file. Support a PDF or image file within 10 MB. Supported image formats: JPEG, PNG, and GIF.     
  - `list.file_reference`: Multiple files. Support PDF or image files and each file must be within 10 MB. Supported image formats: JPEG, PNG, and GIF.   
  - `json`: JSON     
  - `weight`: A single weight with a unit   
  - `list.weight`: Multiple weights with units   
  - `volume`: A single volume with a unit   
  - `list.volume`: Multiple volumes with units   
  - `dimension`: A single size with a unit    
  - `list.dimension`: Multiple sizes with units   
  - `number_integer`: A single integer   
  - `list.number_integer`: Multiple integers   
  - `number_decimal`: A single decimal   
  - `list.number_decimal`: Multiple decimals  
  - `rating`: A single rating    
  - `list.rating`: Multiple ratings 
  - `page_reference`: A single page  
  - `list.page_reference`: Multiple pages   
  - `product_reference`: A single product    
  - `list.product_reference`: Multiple products  
  - `variant_reference`: A single product variant  
  - `list.variant_reference`: Multiple product variants    
  - `collection_reference`: A single product collection  
  - `list.collection_reference`: Multiple product collections   
  - `customer_reference`: A single customer 
  - `list.customer_reference`: Multiple customers 
  - `order_reference`: A single order
  - `list.order_reference`: Multiple orders    
  - `boolean`: Boolean type, valid values are `true` and `false`.
  - `money`: Amount with a currency   
  For more information about metafields, refer to [Guide to Using Metafields Feature](https://help.shopline.com/hc/en-001/articles/7095355017113).

* `value`

  [String](https://developer.shopline.com/docs/storefront-api/common/scalars/string.md)

  Data stored in the metafield.  
  Regardless of how you define the type of the metafield, SHOPLINE will store it in string format. The maximum length of the converted string is 500000.

* `key`

  [String](https://developer.shopline.com/docs/storefront-api/common/scalars/string.md)

  A unique identifier for a metafield definition within its `namespace`. Only letters, numbers, hyphens, and underscores are supported.  
  Minimum length: 3  
  Maximum length: 30  

* `updatedAt`

  [Date](https://developer.shopline.com/docs/storefront-api/common/scalars/date.md)

  The date and time when the metafield was updated. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).

* `description`

  [String](https://developer.shopline.com/docs/storefront-api/common/scalars/string.md)

  Description of the metafield.  

* `reference`

  [MetafieldReference](https://developer.shopline.com/docs/storefront-api/common-objects/objects/metafield-reference.md)

  The resource referenced by the metafield.

* `references`

  [[MetafieldReference]](https://developer.shopline.com/docs/storefront-api/common-objects/objects/metafield-reference.md)

  A list of resources referenced by the metafield.

