---
title: "Metafield Reference"
description: "The mnml.volume_pricing_tiers metafield: schema, field reference, precedence rules, and how to read and write it with the Shopify Admin API, Storefront API or Liquid."
url: https://help.mnmlapps.com/en/articles/22-metafield-reference
collection: "Code Examples"
updated: 2026-11-10
language: en
---

# Metafield Reference

The mnml.volume_pricing_tiers metafield: schema, field reference, precedence rules, and how to read and write it with the Shopify Admin API, Storefront API or Liquid.

MNML Volume Pricing stores each product’s tiers in a standard Shopify metafield that your store owns. Any tool that writes metafields can set it (Admin GraphQL API, Matrixify, Shopify Flow, a PIM), and Liquid, the Storefront API and the Admin API can all read it.

**There is no sync step. The discount function reads the metafield on every cart evaluation, so a write via the API applies to the next cart. You do not need to open or save anything in the app afterwards.**

* * *

### The metafield

<table data-id="60c5c0d9-dd63-41e7-9d00-90a36db84467" style="min-width: 50px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><td colspan="1" rowspan="1"><p data-id="59d42792-288f-43e3-ac8a-c033359a6fbf">Namespace</p></td><td colspan="1" rowspan="1"><p data-id="a600769b-1fa0-4bb1-8f84-44d7f9f4f72c"><code>mnml</code></p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="726b3bb0-80cf-4d72-aa5e-ec2b4ff11a01">Key</p></td><td colspan="1" rowspan="1"><p data-id="85bc55ab-ac64-4678-8275-ddf61ea2e80c"><code>volume_pricing_tiers</code></p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="0a9db2ae-4445-433d-b2bf-bc040b0cdbd6">Type</p></td><td colspan="1" rowspan="1"><p data-id="e3711558-6488-40e6-9762-4e8fcd22ab5b"><code>json</code></p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="ea1906d4-09a3-482b-8fce-e37ada73a5a7">Owner types</p></td><td colspan="1" rowspan="1"><p data-id="7dce3d93-488d-4c82-adb5-b0ba484bb7b0"><code>PRODUCT</code> (all plans), <code>PRODUCTVARIANT</code> (Pro plan and development stores)</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="953dcdc6-e3a8-4834-8426-bbc4ffec5459">Ownership</p></td><td colspan="1" rowspan="1"><p data-id="ba5598b9-bfe8-494b-b14d-c21e07b9e3f6">Store-owned. The app creates the definition the first time it is opened; the data stays on your store if the app is uninstalled</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="b1e8e805-5f42-4bf8-b4ad-142ccb17900c">Validation</p></td><td colspan="1" rowspan="1"><p data-id="aba7602c-d804-4781-b4d5-5fb5108b89b8">The definition carries a JSON schema. Writes that don’t match it are rejected with a <code>userErrors</code> message</p></td></tr></tbody></table>

If you write the metafield before the app has been opened, Shopify stores it as an undefined metafield with no validation. It starts working as soon as the definition exists.

#### Schema

```json
{
  "combineVariantQuantities": false,
  "tiers": [
    { "qty": 5,  "type": "amount", "price": 1000, "badge": "" },
    { "qty": 10, "type": "amount", "price": 900,  "badge": "Most popular" }
  ],
  "markets": {
    "europe": {
      "currency": "EUR",
      "countries": ["DE", "FR", "NL"],
      "tiers": [
        { "qty": 5,  "type": "amount", "price": 1150 },
        { "qty": 10, "type": "amount", "price": 1050 }
      ]
    }
  }
}
```

**Top-level fields**

<table data-id="27ae8bd2-7095-43a9-ae79-42495b12a1f2" style="min-width: 100px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><th colspan="1" rowspan="1"><p data-id="9da05c25-d881-4265-82f8-3c7d55a3ce00">Field</p></th><th colspan="1" rowspan="1"><p data-id="bd45064e-313e-47b2-a3eb-3861c72a6052">Type</p></th><th colspan="1" rowspan="1"><p data-id="f10bc79f-b453-4adc-a947-9b00a0df6cac">Required</p></th><th colspan="1" rowspan="1"><p data-id="8ae326da-285e-4ecd-835d-b92430100f2e">Description</p></th></tr><tr><td colspan="1" rowspan="1"><p data-id="19dd526e-ba24-46f5-ab36-cbb8611af9f9"><code>tiers</code></p></td><td colspan="1" rowspan="1"><p data-id="e6f7ae5b-5363-4a02-a1c4-db74b7c73938">array</p></td><td colspan="1" rowspan="1"><p data-id="cde9f19c-bc3c-40c7-9870-5077d68b209c">Yes</p></td><td colspan="1" rowspan="1"><p data-id="f27dca82-abf1-4cb3-a106-567eaacd6374">The default tier list. May be empty only when <code>markets</code> provides tiers</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="60919757-8b7b-4120-acf2-e09596f39342"><code>combineVariantQuantities</code></p></td><td colspan="1" rowspan="1"><p data-id="14ad7e87-fc89-45be-8c25-8606a1b126f1">boolean</p></td><td colspan="1" rowspan="1"><p data-id="257ccc34-34d5-4528-8d47-e96455a35c74">No (default <code>false</code>)</p></td><td colspan="1" rowspan="1"><p data-id="d597ec5b-4fb7-48d0-9415-0243a27bbc2c">Product level only. When <code>true</code>, quantities of all variants of the product are summed to pick the tier, and any variant-level tiers are ignored</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="db39251f-b335-4a5c-8474-335264d3b64d"><code>markets</code></p></td><td colspan="1" rowspan="1"><p data-id="fcddb394-98f5-485a-9fa4-1a892b04459d">object</p></td><td colspan="1" rowspan="1"><p data-id="0eae15a5-8ea7-4c27-8eb5-ea6d310e39e6">No</p></td><td colspan="1" rowspan="1"><p data-id="0dee97d6-4901-4cf4-846c-540f044bda94">Per-market overrides, keyed by any handle you choose. See below</p></td></tr></tbody></table>

**Tier fields**

<table data-id="cf39a09f-ef0c-4152-945d-f1799ecce877" style="min-width: 100px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><th colspan="1" rowspan="1"><p data-id="79f93cf1-c87b-4716-82a9-ca4f65406bcc">Field</p></th><th colspan="1" rowspan="1"><p data-id="4ef0132b-afaa-471c-b44d-f69bb176b7ee">Type</p></th><th colspan="1" rowspan="1"><p data-id="1f7c0e75-595a-4c90-962b-84a9943da7f9">Required</p></th><th colspan="1" rowspan="1"><p data-id="4f879343-5195-4c23-86d6-6ffcebb3d471">Description</p></th></tr><tr><td colspan="1" rowspan="1"><p data-id="57354e77-3011-44b7-bf22-76b86a6e0682"><code>qty</code></p></td><td colspan="1" rowspan="1"><p data-id="c9a2a9c0-8783-4e7e-9745-bd6d07bafe3d">integer, ≥ 1</p></td><td colspan="1" rowspan="1"><p data-id="3be0cf34-792e-4f60-bc2b-fff8bc2f08ee">Yes</p></td><td colspan="1" rowspan="1"><p data-id="3d814d46-8f6a-4e10-aba1-4282cb3f4204">Minimum line quantity for this tier</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="36ec7644-859c-4f4b-9254-4a8dd6bd4dd3"><code>price</code></p></td><td colspan="1" rowspan="1"><p data-id="5d2593c7-8e53-4825-95b3-50534f0336c3">number, ≥ 0</p></td><td colspan="1" rowspan="1"><p data-id="b144f6ac-e6de-4022-a766-f39026154bfe">Yes</p></td><td colspan="1" rowspan="1"><p data-id="0478c1de-947f-4d9e-bf85-b918b8d2b9a1">For <code>amount</code>: the unit price in the currency’s minor units (<code>1000</code> = 10.00). For <code>percentage</code>: the percentage off (<code>15</code> = 15%)</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="7a53b48a-6559-4ed3-b79d-0981c30c2d66"><code>type</code></p></td><td colspan="1" rowspan="1"><p data-id="f9bef27e-6751-40bb-b834-2da59c83effe"><code>"amount"</code> or <code>"percentage"</code></p></td><td colspan="1" rowspan="1"><p data-id="8b2fe80e-f670-4bc2-a8a4-a1f992668d71">No (default <code>"amount"</code>)</p></td><td colspan="1" rowspan="1"><p data-id="756631d8-368b-48d8-ba5b-46f8d463ae1f">Any value other than <code>"percentage"</code> is treated as <code>"amount"</code></p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="07b98e69-2549-4b3a-bf39-e01c69013741"><code>badge</code></p></td><td colspan="1" rowspan="1"><p data-id="a8e236af-a636-48dc-89a7-f67719f30571">string</p></td><td colspan="1" rowspan="1"><p data-id="db7f3132-b9fa-4371-8eb9-02c9bc3c049a">No</p></td><td colspan="1" rowspan="1"><p data-id="e5859b9d-4546-4244-b075-43ec01f10ec5">Label shown beside the tier in the storefront widget. Omit or use <code>""</code> for none</p></td></tr></tbody></table>

**Market fields**

<table data-id="ace894ab-1f06-4b36-8d4d-30356ed357e0" style="min-width: 100px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><th colspan="1" rowspan="1"><p data-id="6bbd4ab2-83f9-45b0-a946-704442d4acca">Field</p></th><th colspan="1" rowspan="1"><p data-id="f77d609e-8dd2-4edf-9f6e-a93e12080359">Type</p></th><th colspan="1" rowspan="1"><p data-id="4768fe1a-f57c-4483-b56b-cf7a72fa8bb7">Required</p></th><th colspan="1" rowspan="1"><p data-id="f180344f-cb83-40ae-afd4-6a50e27b29de">Description</p></th></tr><tr><td colspan="1" rowspan="1"><p data-id="47b05531-6ccb-4427-887c-6ccd065b4ec8"><code>countries</code></p></td><td colspan="1" rowspan="1"><p data-id="acfa13bb-3c12-48e1-9aed-9b78d1633970">array of ISO 3166-1 alpha-2 codes</p></td><td colspan="1" rowspan="1"><p data-id="11882d16-73b2-4f83-b7a3-339f17bfe3a2">Yes</p></td><td colspan="1" rowspan="1"><p data-id="ae2824e7-4718-492c-8c2a-59024361193f">Buyer countries this entry applies to. Case-insensitive</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="23ee38c8-5c5b-41ba-bf80-551d4b13e580"><code>currency</code></p></td><td colspan="1" rowspan="1"><p data-id="8363aba7-aa94-429f-add3-6eee8f9f031a">ISO 4217 code</p></td><td colspan="1" rowspan="1"><p data-id="48f01e83-c575-4818-becc-645e569f71f9">No</p></td><td colspan="1" rowspan="1"><p data-id="73e72d09-d009-4d8d-94a6-e1b5203c7707">If set, the entry only applies when the cart’s presentment currency matches</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="3e0609d0-ccd4-489c-be24-983ae08e5ea0"><code>tiers</code></p></td><td colspan="1" rowspan="1"><p data-id="4e72d2ca-605d-4b01-b02d-c65a870410f4">array</p></td><td colspan="1" rowspan="1"><p data-id="6c8799a1-a52e-48d7-b2ad-a0a333efee0f">Yes</p></td><td colspan="1" rowspan="1"><p data-id="7d9aaf9f-9fc7-430a-ad8e-3f5ce9686077">Tiers in the market’s own currency. Not converted</p></td></tr></tbody></table>

The first market in document order whose `countries` includes the buyer’s country (and whose `currency`, if set, matches) wins. Otherwise the default `tiers` apply. Markets with an empty `tiers` list are ignored.

**Parsing notes**

-   Tiers can be in any order; the function sorts them by `qty`.
    
-   Numeric strings (`"price": "900"`) are accepted. A tier with a non-numeric value is skipped.
    
-   Unknown keys are ignored, so you can add your own fields.
    
-   A bare array `[ {tier}, {tier} ]` is also accepted. It is the legacy shape; write the object form.
    

#### Precedence

1.  Pricing Rules are not stored on this metafield. A product or variant with tiers on this metafield always overrides any Pricing Rule that covers it.
    
2.  Variant tiers override product tiers for that variant, when the shop has Pro access.
    
3.  `combineVariantQuantities: true` on the product overrides variant tiers. All variants price from the product’s tiers.
    
4.  Market tiers override default tiers for buyers in a listed country.
    

* * *

### Reading

```liquid
{% assign vp = product.metafields.mnml.volume_pricing_tiers.value %}
{% for tier in vp.tiers %}
  {{ tier.qty }}+ : {{ tier.price | divided_by: 100.0 | money }} each
{% endfor %}
```

For variants, read `variant.metafields.mnml.volume_pricing_tiers.value` and fall back to the product value when it is blank. [Creating a Custom Volume Pricing Block](https://help.mnmlapps.com/en/articles/6-creating-a-custom-volume-pricing-block.md) has complete examples.

**Storefront API**

Storefront access is off by default on the definition. Before querying from a headless storefront, turn it on in **Settings → Custom data → Products → Volume Pricing Tiers → Storefronts: Read**, or with `metafieldDefinitionUpdate` and `access: { storefront: PUBLIC_READ }`. Then:

```graphql
{
  product(handle: "example") {
    metafield(namespace: "mnml", key: "volume_pricing_tiers") { value }
    variants(first: 50) {
      nodes {
        id
        metafield(namespace: "mnml", key: "volume_pricing_tiers") { value }
      }
    }
  }
}
```

**Admin API**

`product.metafield(namespace: "mnml", key: "volume_pricing_tiers") { value }` with no extra setup.

### Behaviour notes

-   Metafield writes apply on the next cart evaluation. The app has no cache and no sync step.
    
-   The checkout discount is created the first time the app is opened in the admin. On a new install, open the app once; after that, API writes are enough on their own.
    
-   Fixed prices above the regular price are ignored (Unless you’re a Plus store using [Price update mode](https://help.mnmlapps.com/en/articles/13-shopify-plus-price-based-volume-pricing-no-discounts.md)), because Shopify discounts can only lower a price. A `percentage` tier is relative to the current price, so it is the safer choice when prices vary by market or catalog.
    
-   Unit prices are rounded to the currency’s minor unit at checkout.
    
-   Shopify caps a JSON metafield at 64 KB. A typical tier set is under 1 KB.
    
-   On uninstall, the metafield and its data remain on your store.
    

### Not on this metafield

<table data-id="cb1d4edc-3852-4558-a319-c510694efd4c" style="min-width: 50px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><th colspan="1" rowspan="1"><p data-id="84f04cd4-dbca-4ff6-b4c9-c529de074851">Data</p></th><th colspan="1" rowspan="1"><p data-id="fd812dce-1770-404f-bdf1-15e82a3e7e5e">Where it lives</p></th></tr><tr><td colspan="1" rowspan="1"><p data-id="5eb4ebb5-8356-4b05-a214-9669a730f7cc">Pricing Rules (tiers for many products or collections, Mix &amp; Match)</p></td><td colspan="1" rowspan="1"><p data-id="a083ff3e-64ef-4b8a-bda3-e44fcfb55ee4">App settings, managed on the app’s Pricing Rules page. Not writable via this metafield</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="dfee6e3a-79e7-4aab-9bdd-2afa26341fab">Discount title, eligibility, stacking, exclusions</p></td><td colspan="1" rowspan="1"><p data-id="acaa32cb-d156-437f-984b-d60f8c3d876c">App settings</p></td></tr><tr><td colspan="1" rowspan="1"><p data-id="c88b71bb-9fe6-487d-a178-f2125e30ef1b">Which tier a cart line received</p></td><td colspan="1" rowspan="1"><p data-id="d863e578-f035-4522-bf97-e2597b8e0a27">The order’s discount application (Discount mode) or line price (Price Update mode)</p></td></tr></tbody></table>

#### Related

-   [Bulk Import Volume Pricing Tiers with Matrixify](https://help.mnmlapps.com/en/articles/9-bulk-importing-volume-pricing-tiers.md)
    
-   [Creating a Custom Volume Pricing Block](https://help.mnmlapps.com/en/articles/6-creating-a-custom-volume-pricing-block.md)
    
-   [Add a “From” Price to Product Cards](https://help.mnmlapps.com/en/articles/14-add-a-from-price-to-product-cards.md)
    
-   [Combine Variants for Volume Pricing](https://help.mnmlapps.com/en/articles/10-combine-variants-for-volume-pricing.md)
