Variant Metafields
This page documents all variant-level metafields populated by PromoSync. These fields are attached to individual product variants. All fields use the psrestful namespace.
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
const variantMetafields = variant.metafields?.psrestful;
if (variantMetafields) {
console.log(variantMetafields.part_id);
}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
Array containing pricing information for the variant with quantity breaks.
| Property | Value |
|---|---|
| Namespace | psrestful |
| Key | part_price_array |
| Type | json |
See PartPrice Object for the complete schema.
{% raw %}{% assign pricing = variant.metafields.psrestful.part_price_array.value %}
{% if pricing %}
<!-- Access pricing tiers -->
{% endif %}{% endraw %}Physical Attributes
dimension
Product dimensions for the variant.
| Property | Value |
|---|---|
| Namespace | psrestful |
| Key | dimension |
| Type | json |
See Dimension Object for the complete schema.
{% raw %}{% assign dim = variant.metafields.psrestful.dimension.value %}
{% if dim %}
<!-- Access dimension properties -->
{% 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.
{% raw %}{% assign specs = variant.metafields.psrestful.specification_array.value %}
{% if specs %}
{% for spec in specs %}
<!-- Access specification properties -->
{% endfor %}
{% 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.
{% raw %}{% assign colors = variant.metafields.psrestful.color_array.value %}
{% if colors %}
{% for color in colors %}
<!-- Access color properties like colorName, hex -->
{% 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.
{% raw %}{% assign shipping = variant.metafields.psrestful.shipping_package_array.value %}
{% if shipping %}
{% for carton in shipping %}
<!-- Access shipping package properties -->
{% endfor %}
{% endif %}{% endraw %}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 | Pricing with quantity breaks | PartPrice |
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 |
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
}
}
}
}
}
}Ensure metafields have Storefront API access enabled in Settings > Custom data.