Skip to content

Metafields

Choose which Shopify metafields documents can print, per owner, including unstructured ones added by namespace and key; which types work and how they print; and Keep First Value, which keeps what a metafield held when the document was first made.

EnterpriseUpdated 2026-11-03

Metafields are the custom data Shopify keeps on products, orders, customers and your store: a warranty period, a PO number, a B2B account code. This page decides which of them your documents can print Enterprise; Using Metafields in Templates shows how to print them.

Selecting Metafields

  1. Go to Settings → Metafields. There is one section per owner: Product Metafields, Variant Metafields, Order Metafields, Draft Order Metafields (printed on estimates), Customer Metafields and Shop Metafields.
  2. Click + Add Metafields to open the list of that owner's metafield definitions (Name, Namespace.Key and Type) and tick the ones you want.
  3. Each row shows the metafield's Name with its Value on Documents beneath, then its namespace and key with its type beneath. Picked metafields start as Always Latest.
  4. To change a row, click its Edit icon (the pencil in the Actions column). Set the Name — the label a block starts with when you pick the metafield there (you can rename it in the block); left empty, the key is used — and the Value on Documents: Always Latest, Keep First Value or Keep First Value, Even If Empty. Click Done. See Keeping the First Value below.
  5. Click Save. The trash icon removes a metafield from the list.

Order and Draft Order metafields are separate lists: invoices print Order Metafields, estimates print Draft Order Metafields.

Only the metafields selected here, plus any a template's blocks print, are fetched for each document, so a long list of unused metafields costs nothing.

Unstructured Metafields

The picker lists metafields that have a definition in Shopify (Settings → Custom Data in your admin). Metafields written by another app, an import or the Admin API often have none — they exist on the order or product but never show in that list. These are unstructured metafields. To use one:

  1. Click + Add Manually in the owner's section.
  2. Enter its Namespace (for example custom) and Key (for example warranty_code), optionally a Name (Optional), and choose its Value on Documents. Both follow Shopify's rule: letters, numbers, hyphens and underscores, a namespace up to 255 characters and a key up to 64 (app namespaces such as $app:reviews are accepted). A field that breaks it says so, and Add Metafield stays unavailable until it is fixed.
  3. Click Add Metafield, then Save.

The row's Edit icon changes its name and Value on Documents later. For an unstructured metafield it also lets you correct the namespace or key; a metafield with a definition keeps the namespace and key of its definition.

It is marked Unstructured in the table and prints exactly like a defined one. Spell the namespace and key as the app that wrote it does; a value that does not exist simply prints nothing. Choosing metafields from the picker later keeps your manual entries.

Which Metafields Can Be Used

Every type Shopify offers can be selected; the table shows each one's type. Values print as Shopify stores them:

  • Print as they are: Single Line Text, Multi Line Text, Integer, Decimal, URL (a View link in the built-in blocks) and Color.
  • Print as stored, easy to reformat: True or False (true / false), Date (2026-05-12) and Date and Time (2026-05-12T14:30:00Z); reformat both with the date filter (English month names; a date and time is read in UTC).
  • Structured values: Money, Weight, Volume, Dimension, Rating, JSON and every List type print as JSON text in a block; in Liquid, parse_json turns them into fields you can print one by one.
  • Not useful on a document: Rich text prints Shopify's JSON structure, and references (Product, Variant, Collection, Customer, Order, Page, File, Metaobject) print the item's ID, not its content. Use a text metafield for wording that should print.

Keeping the First Value

Some metafields change after the order: a daily gold rate, an exchange rate, a delivery slot. With the default Always Latest, every document prints the metafield's current value, so a PDF made again next week (after a template fix, a void and reissue, or when a customer asks for a copy) prints next week's rate. Set the metafield to Keep First Value to keep the value the document was first made with.

  • When it is kept: the first time a new PDF of the order's document is made, or the document is printed — by you, an automation, Shopify Flow or the API. Downloading or sending the saved PDF makes no new PDF, so it keeps nothing.
  • From then on every new PDF and every preview of that document prints the kept value, even after the metafield changes in Shopify. Each document keeps its own values: the invoice and the estimate of the same customer are separate, and an estimate that becomes an order does not pass its values to the invoice.
  • Keep First Value waits until the metafield has a value, so it suits a metafield another app or a Flow fills after the order is placed; until then the document prints it empty and nothing is kept.
  • Keep First Value, Even If Empty keeps whatever the metafield holds at the first generation, even nothing — the document then keeps printing it as not set.
  • Switching a metafield to Keep First Value applies from each order's next new PDF; documents made before are not changed. Back to Always Latest, documents print the current value again; Keep First Value again, they print the values they had kept.

The Document Editor lists an order's kept values under Kept Metafield Values in its Order Details panel (View Metafield Values), with an icon button beside each value: Use Current Value to replace a kept value with today's, or Keep Current Value for one not kept yet. In the template blocks and the Liquid reference, these metafields are marked Keeps first value.

A saved PDF also keeps the values of its own moment: downloads, emails, the customer's download link and the Shopify admin actions use it until a new PDF is made. With an automation on When the Order Is Created or When the Order Is Paid, the first PDF — and so the first kept values — is made right then. Earlier PDFs are kept as versions; Enterprise plans can download each one from the order's Version History.

Was this guide missing something? Tell us and we will fix it.

Contact Us