Variant Metafields
This page lists the variant-level metafields PromoSync writes. They are attached to individual product variants and use the psrestful namespace. A key is only written when the supplier (or a PromoSync rule) provides a value for it.
For detailed object schemas, refer to the PSRESTful Product Data 2.0.0 documentation.
Accessing Variant Metafields
In Liquid Templates
{% raw %}{% for variant in product.variants %}
{% assign part_id = variant.metafields.psrestful.part_id %}
<option value="{{ variant.id }}" data-part-id="{{ part_id }}">
{{ variant.title }}
</option>
{% endfor %}{% endraw %}In JavaScript
Variant metafields are not part of Shopify’s product JSON. Serialize the ones you need into the page from Liquid, or read them through the Storefront API (see Storefront API Access).
{% raw %}<script type="application/json" id="variant-part-ids">
{ {% for v in product.variants %}"{{ v.id }}": {{ v.metafields.psrestful.part_id | json }}{% unless forloop.last %},{% endunless %}{% endfor %} }
</script>{% endraw %}Identification
part_id
PromoStandards Part ID (supplier variant identifier).
| Property | Value |
|---|---|
| Namespace | psrestful |
| Key | part_id |
| Type | single_line_text_field |
{% raw %}{{ variant.metafields.psrestful.part_id }}
→ "3001-BLK-L"{% endraw %}variant_gtin
Global Trade Item Number (barcode/UPC).
| Property | Value |
|---|---|
| Namespace | psrestful |
| Key | variant_gtin |
| Type | single_line_text_field |
{% raw %}{{ variant.metafields.psrestful.variant_gtin }}
→ "882932789234"{% endraw %}Pricing
part_price_array
The variant’s tier prices: one entry per quantity break, sorted by quantity. This is PromoSync’s own format, not the PromoStandards price object: quantityMin is the break quantity and price is the unit price in cents. Tiers priced at 0 are dropped. When a Tier Pricing Rule matches the product, the rule’s tiers are written instead of the supplier’s.
| Property | Value |
|---|---|
| Namespace | psrestful |
| Key | part_price_array |
| Type | json |
Example value:
[
{"quantityMin": 144, "price": 610},
{"quantityMin": 288, "price": 530},
{"quantityMin": 576, "price": 461},
{"quantityMin": 1008, "price": 401},
{"quantityMin": 2016, "price": 349}
]Note: Prices are integers in cents: 610 means $6.10. Shopify’s money filter already expects cents, so pass the value straight to it.
{% raw %}{% assign pricing = variant.metafields.psrestful.part_price_array.value %}
{% if pricing %}
<table class="tier-pricing">
{% for tier in pricing %}
<tr>
<td>{{ tier.quantityMin }}+</td>
<td>{{ tier.price | money }}</td>
</tr>
{% endfor %}
</table>
{% endif %}{% endraw %}blank_part_price_array and sample_price
Tier prices for the blank (undecorated) version of the variant, in the same format as part_price_array, and sample_price: the single-unit blank price in cents, written only when the first blank tier starts at quantity 1. Both are only written on shops where the PromoSync team has turned on blank and sample sales and whose default configuration is Decorated.
| Key | Type |
|---|---|
blank_part_price_array | json |
sample_price | number_integer |
msrp
The supplier’s list price (MSRP) at the variant’s lowest quantity tier, in your store currency, whatever pricing method sets the Shopify price. Only written when Save MSRP Metafields is on in PromoSync settings, and only when the supplier publishes a list price. It has storefront access and can be used in automated collection rules.
| Property | Value |
|---|---|
| Namespace | psrestful |
| Key | msrp |
| Type | number_decimal |
Physical Attributes
dimension
Product dimensions for the variant.
| Property | Value |
|---|---|
| Namespace | psrestful |
| Key | dimension |
| Type | json |
See Dimension Object for the complete schema.
Example value:
{
"dimensionUom": "IN",
"depth": "3.45",
"height": "6.8",
"width": "3.45",
"weightUom": "LB",
"weight": "0.7"
}{% raw %}{% assign dim = variant.metafields.psrestful.dimension.value %}
{% if dim %}
<div class="dimensions">
{{ dim.depth }}×{{ dim.width }}×{{ dim.height }} {{ dim.dimensionUom }},
{{ dim.weight }} {{ dim.weightUom }}
</div>
{% endif %}{% endraw %}apparel_size
Product apparel size information.
| Property | Value |
|---|---|
| Namespace | psrestful |
| Key | apparel_size |
| Type | json |
See ApparelSize Object for the complete schema.
Fields include:
apparelStyle- Unisex, Youth, Girls, Boys, Womens, WomensTall, Mens, MensTalllabelSize- OSFA, 4XS through 5XL, or CUSTOMcustomSize- Used when labelSize is CUSTOM
{% raw %}{% assign size = variant.metafields.psrestful.apparel_size.value %}
{% if size %}
<span>{{ size.labelSize }} ({{ size.apparelStyle }})</span>
{% endif %}{% endraw %}Specifications
specification_array
Array of product specifications for the variant.
| Property | Value |
|---|---|
| Namespace | psrestful |
| Key | specification_array |
| Type | json |
See Specification Object for the complete schema.
Example value:
[
{
"specificationType": "Length",
"SpecificationUom": "Inches",
"measurementValue": "18 1/8"
},
{
"specificationType": "Chest",
"SpecificationUom": "Inches",
"measurementValue": "19 1/4"
}
]{% raw %}{% assign specs = variant.metafields.psrestful.specification_array.value %}
{% if specs %}
<ul class="specifications">
{% for spec in specs %}
<li>{{ spec.specificationType }}: {{ spec.measurementValue }} {{ spec.SpecificationUom }}</li>
{% endfor %}
</ul>
{% endif %}{% endraw %}color_array
Color information array for the variant.
| Property | Value |
|---|---|
| Namespace | psrestful |
| Key | color_array |
| Type | json |
See Color Object for the complete schema.
Example value:
[
{
"colorName": "Taupe",
"hex": null,
"approximatePms": "407C",
"standardColorName": "Grey"
}
]{% raw %}{% assign colors = variant.metafields.psrestful.color_array.value %}
{% if colors %}
{% for color in colors %}
<span style="color: {{ color.hex | default: '#000' }}">
{{ color.colorName }} ({{ color.standardColorName }})
</span>
{% endfor %}
{% endif %}{% endraw %}Packaging
product_package_array
Product packaging information for the variant.
| Property | Value |
|---|---|
| Namespace | psrestful |
| Key | product_package_array |
| Type | json |
See ProductPackage Object for the complete schema.
{% raw %}{% assign packages = variant.metafields.psrestful.product_package_array.value %}
{% if packages %}
{% for pkg in packages %}
<!-- Access package properties -->
{% endfor %}
{% endif %}{% endraw %}shipping_package_array
Shipping package information (e.g., master carton details).
| Property | Value |
|---|---|
| Namespace | psrestful |
| Key | shipping_package_array |
| Type | json |
See ShippingPackage Object for the complete schema.
Example value:
[
{
"packageType": "Carton",
"description": null,
"quantity": 18.0,
"dimensionUom": "IN",
"depth": 17.0,
"height": 14.0,
"width": 14.0,
"weightUom": "LB",
"weight": 14.0
}
]{% raw %}{% assign shipping = variant.metafields.psrestful.shipping_package_array.value %}
{% if shipping %}
{% for carton in shipping %}
<div class="shipping-info">
<strong>{{ carton.packageType }}</strong>:
{{ carton.quantity }} units per carton
({{ carton.depth }}×{{ carton.width }}×{{ carton.height }} {{ carton.dimensionUom }},
{{ carton.weight }} {{ carton.weightUom }})
</div>
{% endfor %}
{% endif %}{% endraw %}Media
gallery
Color-matched, multi-image gallery for the variant. The first item is the variant’s featured image; subsequent items are additional views (front, back, side, lifestyle) of the same color.
| Property | Value |
|---|---|
| Namespace | psrestful |
| Key | gallery |
| Type | list.file_reference |
Written only for shops with the Merchandising bundle (PSRESTful Trial, Business or Enterprise, or Premium with the Merchandising add-on), and never on shops that split variants by color. See the Per-Variant Media Gallery guide for plan eligibility, Liquid examples, and theme integration.
Decoration Product Variants
The shared decoration products PromoSync creates (vendor PromoSync, see Decoration Listings) have one variant per pricing class. Those variants carry:
| Key | Type | Description |
|---|---|---|
pricing_hash | text | Stable ID of the pricing class |
suppliers | json | Supplier codes this pricing class applies to |
part_price_array | json | Run-charge ladder, on run charge variants |
setup_tier_array | json | Per-color or per-stitch setup ladder, on per-unit setup variants. Has storefront access |
Complete Variant Metafield List
| Key | Type | Description | Schema Reference |
|---|---|---|---|
part_id | text | PromoStandards Part ID | - |
variant_gtin | text | Global Trade Item Number | - |
part_price_array | json | Tier prices, in cents | PromoSync format (see above) |
blank_part_price_array | json | Blank tier prices (staff-enabled blank and sample sales only) | PromoSync format |
sample_price | integer | Single-unit blank price in cents (same condition) | - |
msrp | decimal | Supplier list price (only with Save MSRP Metafields) | - |
dimension | json | Physical dimensions | Dimension |
apparel_size | json | Apparel size info | ApparelSize |
specification_array | json | Variant specifications | Specification |
color_array | json | Color information | Color |
product_package_array | json | Product packaging | ProductPackage |
shipping_package_array | json | Shipping/carton info | ShippingPackage |
gallery | list.file_reference | Color-matched variant images (Merchandising bundle only) | Guide |
pricing_hash, suppliers, setup_tier_array | various | Decoration product variants only | Decoration Listings |
Storefront API Access
To access variant metafields via Storefront API:
query VariantMetafields($productId: ID!) {
product(id: $productId) {
variants(first: 100) {
edges {
node {
id
title
metafield(namespace: "psrestful", key: "part_id") {
value
}
colorArray: metafield(namespace: "psrestful", key: "color_array") {
value
}
}
}
}
}
}The Storefront API only returns metafields whose definition has storefront access. PromoSync turns it on for part_price_array, setup_tier_array and msrp. For other keys, such as part_id and color_array in the example above, turn it on yourself under Settings > Metafields and metaobjects > Variants in your Shopify admin.