Metafields Overview
PromoSync copies supplier data that Shopify has no standard field for into metafields on your products and variants: tier prices, minimum quantities, decoration locations, specifications, packaging and more. Your theme reads them to build tier pricing tables, decoration pickers and spec sheets.
{% raw %}{{ product.metafields.psrestful.brand }}
{{ product.metafields.psrestful.minimum_quantity }}
{% assign tiers = product.selected_or_first_available_variant.metafields.psrestful.part_price_array.value %}{% endraw %}Namespaces
| Namespace | What’s in it | Who gets it |
|---|---|---|
psrestful | Supplier product data, tier pricing, decoration data | Every shop |
mm-google-shopping | Google Merchant Center fields | Shops with the Merchandising bundle (see Google Merchant Fields) |
Metafield Categories
Product Metafields
Fields on the product: supplier code and product ID, brand, line name, minimum quantity, lead time, decoration locations, materials, compliance flags, marketing points.
Variant Metafields
Fields on each variant: Part ID, GTIN, tier pricing, dimensions, apparel size, specifications, colors, packaging, and the per-variant image gallery.
Google Merchant Fields
Fields for Google Shopping: category, brand, condition, age group, gender, material, custom labels, and per-variant GTIN, MPN, color, size, title and cost.
Quick Reference
Most Used Metafields
| Metafield | Level | Type | Description |
|---|---|---|---|
part_price_array | Variant | JSON | Tier prices: [{quantityMin, price}], price in cents |
minimum_quantity | Product | Integer | Minimum order quantity |
location_decorations | Product | JSON | Decoration locations and methods |
brand | Product | Text | Brand name |
supplier_code | Product | Text | PromoStandards supplier code |
color_array | Variant | JSON | Supplier color data (name, standard color, hex, PMS) |
specification_array | Variant | JSON | Measurements and other specifications |
Google Merchant Fields
| Field | Namespace and key | Description |
|---|---|---|
| Brand | mm-google-shopping.brand | Product brand |
| GTIN | mm-google-shopping.gtin (variant) | Barcode |
| MPN | mm-google-shopping.mpn (variant) | Supplier Part ID |
| Condition | mm-google-shopping.condition | Always new |
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 JSON metafields, read .value to get the parsed data:
{% raw %}{% assign locations = product.metafields.psrestful.location_decorations.value %}
{% for location in locations %}
<p>{{ location.locationName }}: {{ location.decorations.size }} methods</p>
{% endfor %}{% endraw %}Variant Metafields
{% raw %}{% assign colors = variant.metafields.psrestful.color_array.value %}
{% for color in colors %}
<span style="background: {{ color.hex | default: '#ccc' }};">{{ color.colorName }}</span>
{% endfor %}{% endraw %}Namespaces with a hyphen
Use bracket notation for mm-google-shopping:
{% raw %}{{ product.metafields['mm-google-shopping'].brand }}{% endraw %}Accessing Metafields via API
Storefront API
The Storefront API only returns metafields whose definition has storefront access. PromoSync turns it on for the definitions the storefront scripts need: part_price_array, setup_tier_array, method_slug, charge_kind, default_variant_id, and the opt-in msrp and msrp_min. For any other key, turn on storefront access yourself (see Metafield Definitions). Liquid can read every metafield without it.
query VariantPricing($productHandle: String!) {
product(handle: $productHandle) {
variants(first: 10) {
edges {
node {
id
metafield(namespace: "psrestful", key: "part_price_array") {
value
}
}
}
}
}
}Admin API
query {
product(id: "gid://shopify/Product/123456") {
metafields(first: 50, namespace: "psrestful") {
edges {
node {
key
value
}
}
}
}
}Metafield Definitions
PromoSync creates the metafield definitions for you. When you open the app, it checks whether your store has every definition it needs and adds the missing ones in the background. It does the same before an import or a metafield update writes values. You can also run it by hand with Create Metafields in the title bar of the PromoSync settings pages.
To see the definitions in Shopify:
- Go to Settings > Metafields and metaobjects in your Shopify admin
- Click Products or Variants
- Look for the
psrestful(and, on Merchandising shops,mm-google-shopping) definitions
A few definitions only appear when a setting needs them: msrp and msrp_min when Save MSRP Metafields is on, and the mm-google-shopping fields when the shop has the Merchandising bundle.
When Metafields Are Written
| Action | What it writes |
|---|---|
| Product import | All metafields that have data |
| Update Metafields | Rewrites the product and variant metafields from current supplier data |
| Update Prices | part_price_array, cost per item, and the Google COGS field |
| Update Inventory | No metafields. It updates Shopify inventory levels |
Common Use Cases
1. Display Tier Pricing
Show quantity breaks and pricing on product pages. See Storefront Widgets or the no-code PromoSync Tier Pricing block.
2. Decoration Options
Show available imprint locations and methods. See Location Decorations or the PromoSync Decorations block.
3. Google Shopping Feed
Send product data to Google Merchant Center. See Google Merchant Fields.
4. Filters and Smart Collections
product_id is filterable in the Shopify admin product list. With Save MSRP Metafields on, msrp and msrp_min can be used in automated collection rules.
Troubleshooting
Metafield Not Showing
- Check that the product was imported or linked by PromoSync (it has
psrestful.extra_id) - Check the namespace:
psrestful, ormm-google-shoppingfor Google fields - Check that the definition exists under Settings > Metafields and metaobjects
- For the Storefront API, check the definition’s storefront access
- Some keys are only written when the supplier provides the data
Data Is Outdated
Run Update Metafields on the product, or Update Prices for tier prices only.
JSON Values
Read .value to get parsed JSON. Without it you get the raw string:
{% raw %}{% comment %} Parsed JSON {% endcomment %}
{% assign data = product.metafields.psrestful.location_decorations.value %}
{% comment %} Raw JSON string {% endcomment %}
{% assign raw = product.metafields.psrestful.location_decorations %}{% endraw %}Next Steps
- Product Metafields: every product-level field
- Variant Metafields: every variant-level field
- Google Merchant Fields: Google Shopping fields
- Storefront Widgets: show metafields in your theme