Metafields Overview
PromoSync populates 70+ metafields with rich product data from PromoStandards suppliers. This data enables advanced storefront features, custom displays, and integrations.
What Are Metafields?
Shopify metafields are custom data fields that extend product information beyond standard fields. PromoSync uses metafields to store:
- Pricing tiers and quantity breaks
- Decoration options and locations
- Product specifications
- Supplier information
- Google Merchant Center data
Namespace and Access
All PromoSync metafields use the psrestful namespace:
{% raw %}{{ product.metafields.psrestful.tier_pricing }}
{{ product.metafields.psrestful.specifications }}{% endraw %}Metafield Categories
Product Metafields
Fields attached to the product level:
- Basic info (brand, supplier, category)
- Pricing data (tier pricing, MAP)
- Specifications (materials, dimensions)
- Media (images, videos, documents)
- Decoration options
Variant Metafields
Fields attached to individual variants:
- Color and size details
- UPC/GTIN barcodes
- Variant-specific inventory
- Pricing overrides
Google Merchant Fields
Fields for Google Shopping integration:
- Product identifiers (GTIN, MPN)
- Categorization (product type, category)
- Attributes (age group, gender, material)
- Custom labels
Quick Reference
Most Used Metafields
| Metafield | Type | Description |
|---|---|---|
tier_pricing | JSON | Quantity-based pricing tiers |
specifications | JSON | Product specs and features |
location_decorations | JSON | Available decoration options |
brand | String | Product brand name |
supplier | String | Supplier name |
inventory_data | JSON | Detailed inventory information |
Google Merchant Fields
| Field | Shopify Namespace | Description |
|---|---|---|
| Brand | google.custom.brand | Product brand |
| GTIN | google.custom.gtin | Barcode |
| MPN | google.custom.mpn | Manufacturer part number |
| Condition | google.custom.condition | Product condition |
Accessing Metafields in Liquid
Basic Access
{% raw %}{% assign brand = product.metafields.psrestful.brand %}
{% if brand %}
<span class="product-brand">{{ brand }}</span>
{% endif %}{% endraw %}JSON Metafields
For complex data stored as JSON:
{% raw %}{% assign specs = product.metafields.psrestful.specifications.value %}
{% if specs %}
<p>Material: {{ specs.material }}</p>
<p>Weight: {{ specs.weight }}</p>
{% endif %}{% endraw %}Variant Metafields
Access variant-level data:
{% raw %}{% assign color_info = variant.metafields.psrestful.color_info.value %}
{% if color_info %}
<span style="background: {{ color_info.hex }};">{{ color_info.name }}</span>
{% endif %}{% endraw %}Accessing Metafields via API
Storefront API
query ProductMetafields($handle: String!) {
product(handle: $handle) {
metafield(namespace: "psrestful", key: "tier_pricing") {
value
}
}
}Admin API
query {
product(id: "gid://shopify/Product/123456") {
metafields(first: 10, namespace: "psrestful") {
edges {
node {
key
value
}
}
}
}
}Metafield Definitions
PromoSync creates metafield definitions automatically. To view them:
- Go to Settings > Custom data in Shopify admin
- Click Products or Variants
- Filter by namespace
psrestful
Benefits of Definitions
- Type validation for metafield values
- Storefront API access
- Theme editor integration
- GraphQL schema typing
Data Freshness
Metafields are updated:
| Event | What Updates |
|---|---|
| Product Import | All metafields |
| Inventory Sync | inventory_data only |
| Pricing Update | Pricing-related metafields |
| Full Refresh | All metafields |
Check the last_sync metafield for timestamps:
{% raw %}{% assign sync = product.metafields.psrestful.last_sync %}
Last updated: {{ sync | date: "%B %d, %Y at %I:%M %p" }}{% endraw %}Common Use Cases
1. Display Tier Pricing
Show quantity breaks and pricing on product pages. → See Storefront Widgets
2. Custom Decoration Options
Display available imprint locations and methods. → See Location Decorations
3. Google Shopping Feed
Feed product data to Google Merchant Center. → See Google Merchant Fields
4. Custom Product Filters
Create collection filters based on specifications. → Use specification metafields in collection filtering
5. Inventory Displays
Show warehouse availability or stock status.
→ Access inventory_data metafield
Performance Considerations
Storefront API Access
Not all metafields are exposed to Storefront API by default. To enable access:
- Go to Settings > Custom data
- Find the metafield definition
- Enable Storefront API access
Caching
Metafield data is cached by Shopify. After updates:
- Storefront data updates within minutes
- Theme previews may need refresh
- API responses update immediately
Troubleshooting
Metafield Not Showing
- Verify the product was synced
- Check the correct namespace (
psrestful) - Ensure metafield definition exists
- Check Storefront API access settings
Data is Outdated
- Check
last_synctimestamp - Trigger manual sync
- Verify supplier connection
JSON Parse Errors
When accessing JSON metafields:
{% raw %}{% comment %} Use .value for parsed JSON {% endcomment %}
{% assign data = product.metafields.psrestful.specifications.value %}
{% comment %} Not raw JSON string {% endcomment %}
{% assign data = product.metafields.psrestful.specifications %}{% endraw %}Next Steps
- Product Metafields - Full list of product-level fields
- Variant Metafields - Variant-specific fields
- Google Merchant Fields - Google Shopping integration
- Storefront Widgets - Display metafields in your theme