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 inputmulti_line_text_field
- Multi-line text inputnumber_integer
- Integer numbernumber_decimal
- Decimal numberdate
- Date fielddate_time
- Date and time fieldboolean
- True/false fieldcolor
- Color pickerfile_reference
- File referenceurl
- URL fieldjson
- JSON datarating
- Rating fielddimension
- Dimension fieldvolume
- Volume fieldweight
- Weight fieldmoney
- Money fieldproduct_reference
- Product referencevariant_reference
- Variant referencepage_reference
- Page referencecollection_reference
- Collection referencemixed_reference
- Mixed reference
Access Levels
Storefront API Access
PUBLIC_READ
- Publicly readablePRIVATE
- Private access only
Admin API Access
MERCHANT_READ
- Merchant read accessMERCHANT_READ_WRITE
- Merchant read and write accessPUBLIC_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 patternfile_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 creationField keys cannot be changed after creation
Multiple rows are used when a field has multiple validation rules