Skip to main content

Metaobject Definitions Fields

Updated yesterday

Metaobject definitions are templates that define the structure and behavior of metaobjects in Shopify. They allow you to create custom data structures with specific fields, validations, and capabilities that can be used across your store.

Sample File

Download a sample spreadsheet that includes a metaobject definition with fields and validations.

Metaobject Definition Fields

These are all the fields you can import or export for metaobject definitions in Altera.

General

Field

Description

Example Value

ID

Unique definition identifier

gid://shopify/MetaobjectDefinition/6304792762

Type

The metaobject type identifier (Create-only)

celebrity

Command

Action to perform on this definition

MERGE

Name

Display name for the metaobject definition

Celebrity

Description

Description of the metaobject definition

my description

Metaobject Count

Number of metaobjects using this definition (Read-only)

3

Access: Storefront API

Storefront API access level

PUBLIC_READ

Access: Admin API

Admin API access level

PUBLIC_READ_WRITE

Capability: Active-draft status

Whether metaobjects can have active/draft status

true

Capability: Translations

Whether metaobjects support translations

true

Capability: Publish entries as web pages

Whether metaobjects can be published as web pages

false

Capability: Storefronts API access

Whether metaobjects are accessible via Storefronts API

false

Row #

Row number in the export file

1

Top Row

Whether this is the first row for this definition

true

Field Definitions

These fields define the individual fields within your metaobject definition.

Field

Description

Example Value

Field: Key

Unique identifier for the field within the definition (Create-only)

name

Field: Description

Description of what this field stores

my description

Field: Type

Data type of the field (Create-only)

single_line_text_field

Field: Required

Whether this field is required when creating metaobjects

false

Field: Display Name

Whether this field is used as the display name for metaobjects

true

Validations

These fields define validation rules for your metaobject definition fields.

Field

Description

Example Value

Validation: Name

Name of the validation rule

min

Validation: Type

Data type of the validation (Read-only)

number_integer

Validation: Value

Value used for the validation

1

Field Types

Common field types you can use for metaobject definitions:

  • single_line_text_field - Single line text input

  • multi_line_text_field - Multi-line text input

  • number_integer - Integer number

  • number_decimal - Decimal number

  • date - Date field

  • date_time - Date and time field

  • boolean - True/false field

  • color - Color picker

  • file_reference - File reference

  • url - URL field

  • json - JSON data

  • rating - Rating field

  • dimension - Dimension field

  • volume - Volume field

  • weight - Weight field

  • money - Money field

  • product_reference - Product reference

  • variant_reference - Variant reference

  • page_reference - Page reference

  • collection_reference - Collection reference

  • mixed_reference - Mixed reference

Access Levels

Storefront API Access

  • PUBLIC_READ - Publicly readable

  • PRIVATE - Private access only

Admin API Access

  • MERCHANT_READ - Merchant read access

  • MERCHANT_READ_WRITE - Merchant read and write access

  • PUBLIC_READ_WRITE - Public read and write access

Validation Rules

Common validation rules that can be applied to fields:

  • min - Minimum value (for numbers) or length (for text)

  • max - Maximum value (for numbers) or length (for text)

  • regex - Regular expression pattern

  • file_type_options - Allowed file types (for file references)

  • choices - Predefined choices for the field

Import Notes

  • Standard Shopify metaobject definitions cannot be created or updated. They can only be deleted if there are no references to them

  • The type field is required for creation and cannot be changed after creation

  • Field keys cannot be changed after creation

  • Multiple rows are used when a field has multiple validation rules

Did this answer your question?