Shopify
ecommerce backend
Purpose: Website/e-commerce platform.
Last verified: December 2025
Account Detailsâ
- Notes: ecommerce backend
- Category: WEBSITE
- Account type: CLIENT_OWNED, INTERNAL, CLIENT_ACCESS
- Created: October 2025
- Account owner: Ben Power
Overviewâ
Shopify is used as the ecommerce backend for managing products, orders, inventory, and customer data. This guide covers best practices for setting up product data structures, metafields, and integration workflows.
Setting Up Metafieldsâ
Metafields allow you to store custom data for products, collections, customers, and orders. They're essential for creating advanced filtering, displaying product specifications, and managing structured product data.
Accessing Metafieldsâ
- Navigate to Settings â Custom data
- Select the resource type (Products, Collections, Customers, Orders, etc.)
- Click Add definition to create new metafield definitions
Metafield Definitions vs Valuesâ
Metafield definitions are templates that specify:
- What resource the metafield applies to (e.g., Products)
- What type of data it can store
- Validation rules for values
Metafield values are the actual data stored for each individual product/resource.
Content Typesâ
Common content types for product metafields:
| Content Type | Use Case | Example |
|---|---|---|
| Single line text | Simple text values | "White", "Thermoplastic" |
| Single line text (list) | Dropdown/choice lists | Colour options, Material types |
| Multi-line text | Longer descriptions | Feature lists, detailed specs |
| Integer | Whole numbers | Quantity, count |
| Decimal | Numbers with decimals | Dimensions, prices |
| Measurement | Dimensions with units | "44.5 cm", "2.5 kg" |
| File reference | Images/icons | Feature icons, material images |
| Date | Dates | Launch date, expiry date |
| URL | Links | Product videos, external resources |
| Color | Color values | Hex codes, color names |
| JSON | Structured data | Complex nested data |
| Reference | Links to other resources | Related products, collections |
Standard vs Custom Definitionsâ
- Standard definitions: Pre-configured by Shopify, universally compatible. Use these when possible.
- Custom definitions: Create when you need specific functionality not covered by standard definitions.
Creating Shared Fieldsâ
Fields used across multiple product types should be created once and reused:
Examples of shared fields:
- Colour/Color
- Material
- Dimensions (Width, Height, Depth)
- Brand
- Style
How to create:
- Go to Settings â Custom data â Products
- Click Add definition
- Check for standard definitions first, or select Add custom definition
- Configure:
- Name: Descriptive name (e.g., "Color")
- Namespace and key: Unique identifiers (e.g.,
custom.color) - Type/Content type: Choose appropriate type
- Validations: Optional rules (character limits, ranges, etc.)
- For choice lists, add all possible values
- Click Save
Creating Product-Specific Fieldsâ
After shared fields, create fields specific to certain product types:
- Follow the same process as shared fields
- Name them clearly (e.g., "Hinge Technology", "Water Pressure")
- Choose appropriate field type
- Add description explaining purpose
Populating Metafield Valuesâ
- Go to Products in Shopify admin
- Open the product to edit
- Scroll to Metafields section (appears after definitions are created)
- Add values for each metafield:
- Enter values from your spreadsheet
- Ensure formats match (e.g., "44.5" not "44.5cm x 37.1cm")
- For choice lists, select from dropdown
- Save the product
Exporting Metafields and Metaobjectsâ
Scripts are available to export all product metafields, metaobjects, and their definitions from Shopify for analysis and backup purposes.
Overviewâ
The export toolkit provides automated scripts to:
- Export all product metafield definitions
- Export all metaobject definitions
- Export all products with their metafield values
- Export all metaobject entries
- Convert JSON exports to CSV for spreadsheet analysis
Quick Startâ
1. Install dependencies:
cd scripts
npm install
2. Get access token and run export:
npm run oauth
This single command:
- Uses Client Credentials Grant to get an access token
- Saves token to
.envfile - Automatically runs the export
- Creates JSON files in
exports/directory
3. Convert to CSV:
npm run to-csv # Convert all JSON files to CSV
npm run to-csv-wide # Create wide-format products CSV (one row per product)
Available Scriptsâ
| Script | Purpose | Usage |
|---|---|---|
oauth-get-token.js | Get access token via Client Credentials Grant | npm run oauth |
export-shopify-metafields.js | Export all metafields and metaobjects | npm run export |
json-to-csv.js | Convert JSON exports to CSV | npm run to-csv |
json-to-csv-products-wide.js | Create wide-format products CSV | npm run to-csv-wide |
Authentication Setupâ
Using Client Credentials Grant (Recommended):
This is the simplest method for apps you own installed in stores you own.
Requirements:
- App created in Dev Dashboard
- App installed in your store
- Client ID and Secret configured in script
- App scopes:
read_products,read_metaobjects,read_metaobject_definitions
How it works:
- Run
npm run oauth - Script automatically exchanges client credentials for access token
- Token is saved to
.envfile - Export runs automatically
Manual Token Setup:
If you prefer to set up the token manually:
-
Create
.envfile inscripts/directory:SHOPIFY_STORE_URL=your-store.myshopify.com
SHOPIFY_ACCESS_TOKEN=shpat_your_token_here -
Run export:
npm run export
Getting a token manually:
- Go to Shopify admin â Settings â Apps and sales channels â Develop apps
- Create and name an app, then click Create app
- From the Configuration tab, click Configure under Admin API integration
- Select required scopes:
read_products,read_metaobjects,read_metaobject_definitions - Click Save
- From API Credentials tab, click Install app
- Click Reveal token once to expose the Admin API access token
- Copy the token to your
.envfile
Export Outputâ
Exports are saved to exports/shopify-export-{timestamp}/ with:
JSON Files:
metafield-definitions.json- All metafield definitions (namespace, key, type, access permissions, validations)metaobject-definitions.json- All metaobject definitions (field definitions, capabilities, access settings)products-with-metafields.json- All products with metafields (product details + nested metafield arrays)metaobjects.json- All metaobject entries (metaobject details + field values)export-summary.json- Summary statistics (counts, groupings, metadata)
CSV Files (Generated):
products-with-metafields.csv- Long format (one row per product-metafield combination)products-wide-format.csv- Wide format (one row per product, metafields as columns) - ideal for spreadsheet pivot tablesmetaobjects.csv- One row per metaobject, fields as columnsmetafield-definitions.csv- One row per definitionmetaobject-definitions.csv- One row per definition
Usage Examplesâ
Complete workflow:
# 1. Get token and export
npm run oauth
# 2. Convert to CSV
npm run to-csv
npm run to-csv-wide
# 3. Open CSV files in Excel/Sheets
open exports/shopify-export-*/products-wide-format.csv
Export only (if you already have a token):
npm run export
Convert existing export:
# Convert most recent export
npm run to-csv
# Convert specific export directory
node json-to-csv.js ../exports/shopify-export-2026-01-19T15-46-34
Adding New Scopesâ
If you need additional scopes (e.g., read_metaobject_definitions):
-
Update app in Dev Dashboard:
- Edit version â Add scopes â Release
-
Reinstall app:
- Go to "Home" tab
- Click "Install app"
- Select store â Install
-
Get new token:
npm run oauth -
Re-run export:
npm run export
Troubleshooting Export Scriptsâ
"Access denied for metaobjectDefinitions"
Solution: Add read_metaobject_definitions scope to your app and reinstall.
"SHOPIFY_ACCESS_TOKEN environment variable is required"
Solution:
- Run
npm run oauthto get a token automatically - Or create
.envfile with your token
Token shows old scopes after adding new ones
Solution: Reinstall the app after releasing a new version with new scopes.
"Field doesn't exist" GraphQL errors
Solution: The script handles this automatically by removing unsupported fields. If you see errors, check the API version in the script.
Security Notesâ
- Never commit
.envfile - It contains your access token - Rotate tokens regularly - Regenerate if compromised
- Use minimal scopes - Only request what you need
- Store tokens securely - Treat them like passwords
Filter-to-Column Mapping Strategyâ
When setting up product filters, align your spreadsheet columns with filter requirements.
Direct Mappingsâ
Many filters map directly to spreadsheet columns:
| Filter Name | Spreadsheet Column | Notes |
|---|---|---|
| Price | Price | Verify data populated |
| Type | Product Type | Verify data populated |
| Colour | Colour or Color | Standardize capitalization |
| Shape | Shape | Verify data populated |
| Material | Material | Verify data populated |
| Finish texture | Finish Texture | Verify data populated |
| Style | Design Style | Verify data populated |
| Mounting type | Mounting Type or Fixing Type | May need to standardize |
Dimension Filtersâ
Dimensions often need extraction from combined columns:
Common scenario:
- Spreadsheet has
Sizecolumn: "44.5cm x 37.1cm" - Filters need separate
Width,Height,Depthcolumns
Action required:
- Determine format (Width x Height? Length x Width?)
- Extract values into separate columns
- Standardize units (cm, mm, inches)
- Ensure numeric values are extractable
Creating Missing Filter Columnsâ
Some filters may not have corresponding columns:
Common additions:
- Promotions: TRUE/FALSE or promotion name
- Features: Key features (could combine existing fields)
- Guarantee: Warranty information (e.g., "2 years")
Standardizing Data Formatsâ
Ensure consistency across all products:
- Dimensions: Consistent units (e.g., always "cm" not "centimeters")
- Colours: Consistent capitalization (e.g., "White" not "white" or "WHITE")
- Materials: Consistent naming (e.g., "Thermoplastic" not "Thermo Plastic")
- Boolean fields: Pick one format (TRUE/FALSE, Yes/No, Y/N) and stick to it
Spreadsheet Alignment Workflowâ
Step 1: Review Filter Requirementsâ
- Identify which filters apply to each product category
- Map filters to spreadsheet columns
- Identify gaps where columns don't exist
Step 2: Extract Combined Dataâ
For columns with combined data (e.g., "44.5cm x 37.1cm"):
- Determine the format
- Extract into separate columns
- Populate all relevant products
- Standardize units and formats
Step 3: Create Missing Columnsâ
- Add columns for filters without corresponding data
- Populate with data or mark as "N/A"
- Document data sources
Step 4: Populate Dataâ
For each product category:
- Check which filters apply
- Ensure every applicable filter column has data
- Mark missing data appropriately (N/A, blank, or research)
Step 5: Standardize Formatsâ
- Review all data for consistency
- Standardize naming conventions
- Ensure units are consistent
- Fix capitalization issues
Step 6: Create Mapping Documentâ
Document for future reference:
For each filter:
- Spreadsheet column name
- Product categories it applies to
- Data format requirements
- Examples of valid values
- Data source
- Shopify metafield location (after migration)
- Permission/ownership
Best Practicesâ
Metafield Setupâ
- Start small: Begin with one product as an example
- Work systematically: Complete one product type before moving to the next
- Create shared fields once: Reuse across all products
- Use choice lists: For fields with limited options (ensures consistency)
- Document everything: Create a reference guide as you work
Data Qualityâ
- Standardize early: Fix naming and format issues before migration
- Validate data: Check for missing values, inconsistencies, duplicates
- Test as you go: Verify data displays correctly after creating fields
- Keep it simple: Don't create fields that aren't needed
Process Documentationâ
Document each metafield created:
Field Name: [Name]
Field Type: [Single line text, Choice list, etc.]
Applies To: [Product categories]
Format: [Data format]
Examples: [Valid values]
Shopify Location: [Settings â Custom data â Products â [Name]]
Permission: [Who can update]
Source: [Spreadsheet column name]
Notes: [Any special considerations]
Recommended Workflowâ
- Planning: Finalize filter requirements and spreadsheet structure
- One product example: Set up all metafields for one product
- Test and refine: Verify filters work, adjust as needed
- Scale up: Work through products systematically by category
- Document: Create reference documentation for the team
Integration Considerationsâ
Warehouse/Inventory Managementâ
When integrating with warehouse management systems (e.g., MintSoft):
- SKU mapping: Ensure SKUs match between systems
- Inventory sync: Verify stock levels update correctly
- Order fulfillment: Test automated fulfillment workflows
- Order status updates: Confirm status updates flow correctly
- Delivery options: Map different delivery types (next day, standard, etc.)
Third-Party Appsâ
Common integrations:
- Search & Discovery: Requires product associations and search terms setup
- Email marketing (Klaviyo): Ensure customer data syncs correctly
- Payment providers: Configure payment options (Klarna, PayPal, etc.)
- Shipping apps: Connect shipping providers for label generation
Multi-Channel Salesâ
When selling across multiple channels:
- Product compatibility: Ensure product data works across all channels
- Order tracking: Plan how to attribute orders to different sources
- Inventory management: Consider how stock is allocated across channels
- Email flows: Decide if separate flows are needed for different channels
Common Field Types by Use Caseâ
| Use Case | Recommended Content Type | Notes |
|---|---|---|
| Colour/Color | Single line text (list) or Color | Create once, reuse. Use list for dropdown |
| Material | Single line text (list) | Create once, reuse. Use list for dropdown |
| Dimensions | Measurement or Decimal | Measurement allows units (cm). Decimal for numeric values |
| Shape | Single line text (list) | Use list for dropdown consistency |
| Finish/Texture | Single line text (list) | Use list for dropdown |
| Mounting Type | Single line text (list) | Use list for dropdown |
| Promotions | Single line text | TRUE/FALSE or promotion name |
| Features | Multi-line text | Or create as meta object for more structure |
| Description | Multi-line text | Already exists in Shopify, verify format |
| Price | Decimal | Already exists in Shopify (product price) |
Troubleshootingâ
"I can't edit metafields"â
- Check account permissions (need admin or staff permissions)
- Verify you're in the correct Shopify account
- Ensure no other processes are blocking access
"Field already exists but with different name"â
- Check for duplicates in Settings â Custom data â Products
- Consider renaming or consolidating to avoid confusion
- Document the decision for your team
"I don't know what content type to use"â
- Simple text = Single line text
- Long description = Multi-line text
- Whole numbers = Integer
- Numbers with decimals = Decimal
- Dimensions with units = Measurement
- Dropdown options = Single line text (list)
- Images = File reference
- Dates = Date
- Links = URL
"How do I know if a field is shared?"â
- If it's used by 2+ product types, it's shared
- Create the definition once and reuse it across all products
- Examples: Color, Material, Width, Height
- The same definition can be used for all products, but each product has its own value
"I can't find the Metafields section on a product"â
- Make sure you've created at least one metafield definition first
- The Metafields section only appears after definitions are created
- Go to Settings â Custom data â Products to create definitions
"Should I use standard or custom definitions?"â
- Use standard definitions when possible - They're pre-configured and universally compatible
- Use custom definitions when you need something specific that standard definitions don't cover
- Check Shopify's standard definitions first: Settings â Custom data â Products â Add definition â Browse standard definitions
Official Shopify Resourcesâ
For the most up-to-date information, refer to Shopify's official documentation:
- Metafields Overview
- Creating Custom Metafield Definitions
- Adding Standard Metafield Definitions
- Adding Metafield Values
- Displaying Metafields on Your Online Store
Note: Shopify's interface may change over time. If you encounter any differences, refer to the official documentation or Shopify's help center for the most current instructions.