Skip to main content

Generate Templates With AI

Don't know exactly which fields your store needs? You don't have to figure it out manually. Use any AI assistant like ChatGPT, Claude, Gemini, or any other LLM to generate a complete template JSON file tailored to your specific store, then import it directly into Metafield Studio.

No coding required. No metafield expertise needed. Just describe your store and what you want.


How It Works

  1. Prompt an AI with a description of your store and what data you need
  2. Get a JSON file in Metafield Studio's import format
  3. Import the JSON into Metafield Studio
  4. Done your custom template is ready to use

The JSON Format

Every template JSON file follows this structure. Share this format with the AI so it generates a compatible file:

{
"version": "1.0",
"exportedAt": "2026-01-01T00:00:00.000Z",
"app": "Metafield Studio",
"sets": [
{
"resourceType": "PRODUCT",
"title": "Your Template Name",
"description": "What this template is for",
"status": "active",
"order": 0,
"fields": [
{
"label": "Field Display Name",
"namespace": "your_namespace",
"key": "field_key",
"type": "single_line_text_field",
"notes": "Help text for your team",
"order": 0,
"filterable": false,
"storefront": false,
"pin": false
}
]
}
]
}

Supported Resource Types

Use one of these values for resourceType:

PRODUCT, VARIANT, COLLECTION, PAGE, BLOG, ARTICLE, SHOP, LOCATION

Supported Field Types

Use one of these values for type:

Type ValueWhat It Creates
single_line_text_fieldSingle-line text input
multi_line_text_fieldMulti-line text with rich text editor
number_integerWhole number
number_decimalDecimal number
dateDate picker
date_timeDate and time picker
booleanTrue/false toggle
colorColor picker with hex value
urlURL input
jsonJSON data
weightWeight with unit
volumeVolume with unit
dimensionDimension with unit
ratingStar rating
product_referenceLink to another product
variant_referenceLink to a product variant
page_referenceLink to a page
file_referenceLink to a file
list.single_line_text_fieldList of text values
list.number_integerList of integers
list.product_referenceList of product links

Optional Field Flags

Each field also supports three optional boolean flags that control how the definition behaves in Shopify:

FlagDefaultWhat It DoesLimit
filterablefalseMakes this metafield available as a filter in the Shopify admin, so you can filter your product list (or other resources) by this field's value128 filterable definitions per store
storefrontfalseExposes this metafield to the Storefront API with PUBLIC_READ access, making it available to your headless storefront, Hydrogen store, or any app reading your storefront dataNo limit
pinfalsePins this definition to the top of the metafield section in the Shopify admin, so your team sees it immediately without scrolling20 pinned definitions per resource type

When to use these:

  • Set "filterable": true on fields you want to search/filter by in the Shopify admin (e.g., material, color, vendor SKU)
  • Set "storefront": true on any field whose value needs to appear on your storefront or be read by a headless app (e.g., SEO fields, product specs, size charts)
  • Set "pin": true on the most important fields your team fills in daily, so they're always visible at the top of the editor
tip

You can include these flags in your AI prompt: "Make the grape_variety and region fields filterable, expose all fields to the storefront, and pin vintage_year and cupping_score."


Example AI Prompts

tip

Click Copy on any prompt below to copy it with the full JSON format included, ready to paste into your AI assistant.

For a Wine Store

I run an online wine store on Shopify. Generate a Metafield Studio template JSON file for product metafields that covers: grape variety, vintage year, wine region, alcohol percentage, tasting notes, food pairings, serving temperature, bottle size, aging potential, and awards/ratings. Use the namespace "wine" for all fields. Follow this exact JSON format: [JSON format will be included here when copied]

For a Pet Supply Store

I sell pet supplies on Shopify. I need a Metafield Studio template JSON with product metafields for: target animal (dog, cat, bird, etc.), life stage (puppy, adult, senior), weight range, ingredients list, feeding guidelines, allergen warnings, and whether the product is vet-recommended. Use the namespace "pet" for all fields. Follow this exact JSON format: [JSON format will be included here when copied]

For a Handmade Jewelry Store

I sell handmade jewelry on Shopify. Create a Metafield Studio template JSON with product metafields for: metal type, gemstone, gemstone carat weight, chain length, ring size range, whether it's hypoallergenic, care instructions, whether gift wrapping is available, and estimated production time. Use the namespace "jewelry" for all fields. Follow this exact JSON format: [JSON format will be included here when copied]

For Multiple Resource Types

I run a Shopify store and need metafield templates for two resource types. For PRODUCTS: material, weight, country of origin, and warranty period. For COLLECTIONS: banner image URL, seasonal label, and featured product count. Put them all in one JSON file with separate entries in the "sets" array. Use namespaces "product_info" and "collection_info" respectively. Follow this exact JSON format: [JSON format will be included here when copied]

Pro Tips for Better AI Results

Be specific about your industry

Instead of "I sell stuff online", say "I sell organic skincare products, primarily serums and moisturizers, targeting ages 25-45." The more context the AI has, the more relevant the fields it generates.

Ask for validation rules

Add to your prompt: "Include appropriate validation rules for example min/max values for numeric fields, and maximum character lengths for text fields." The AI will populate the validationRules field with JSON constraints.

Ask for select/multi-select options

If you want dropdown fields, tell the AI: "For the 'skin_type' field, make it a single-select with options: Normal, Dry, Oily, Combination, Sensitive." The AI will include the options in the options field.

Request multiple templates at once

You can ask for several templates in a single prompt: "Give me three separate templates in the same JSON file: one for product specs, one for SEO fields, and one for shipping information."

Iterate

If the first result isn't perfect, tell the AI what to change: "Add a 'pH Level' decimal field to the product specs template, and remove the 'fragrance type' field." Refining is faster than starting over.


Importing Your AI-Generated Template

Once you have your JSON file:

  1. Navigate to the Templates section in Metafield Studio
  2. Click the "Import" button
  3. Upload your JSON file (drag-and-drop or click to browse)
  4. Metafield Studio validates the file and shows you a preview of what will be imported
  5. Select which templates to import (or click "Select all")
  6. Click Import
  7. Your templates are ready to use

The import process validates your JSON structure automatically. If the AI generated anything invalid (wrong field type, missing required properties), you'll see a clear error message telling you what to fix.

tip

Save your AI-generated JSON files. They're a portable, version-controlled record of your metafield architecture. Store them in a shared drive or repository so your team can reference or reuse them.


Real-World Example: Complete Prompt and Output

Here's a complete example you can adapt:

Prompt:

I run a specialty coffee roastery on Shopify. Generate a Metafield Studio template JSON file for PRODUCT metafields. I need fields for: origin country, farm/estate name, processing method (select from: washed, natural, honey, anaerobic), roast level (select from: light, medium, medium-dark, dark), flavor notes (list of text values), altitude grown (in meters), harvest date, SCA cupping score (decimal, range 0-100), whether it's single origin (boolean), and recommended brew methods (list of text values). Use namespace "coffee". Follow this exact JSON format: [JSON format will be included here when copied]

The AI will generate a complete, valid JSON file that you can import directly into Metafield Studio giving you a professional-grade coffee product data structure in minutes instead of hours.