> For the complete documentation index, see [llms.txt](https://learn.mechanic.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.mechanic.dev/platform/liquid/objects/shopify/metafields/metafield-object.md).

# Metafield object

{% hint style="warning" %}
These Shopify REST-backed Liquid objects are legacy. The product and variant Liquid objects no longer work, and Shopify is phasing out the REST Admin API that these objects depend on. Use [GraphQL](/core/actions/shopify.md#graphql) for new work; see the [Shopify REST Admin API notice](/platform/liquid/objects/shopify.md) and [migration guides](/resources/converting-tasks-from-shopify-rest-to-graphql.md).
{% endhint %}

{% hint style="info" %}
This page is part of a series: see [Metafields](/platform/liquid/objects/shopify/metafields.md) for an overview on how Mechanic's Liquid implementation thinks about metafields.
{% endhint %}

The metafield object reflects the REST Admin API's representation of a metafield.

Mechanic includes support for the metafield object for completeness, but it *is not* the most useful way to go about using metafield values (see [Metafield representation object](/platform/liquid/objects/shopify/metafields/metafield-representation-object.md)).

## What it contains

* Every property from [the Metafield resource in the Shopify REST Admin API](https://shopify.dev/api/admin/rest/reference/metafield)

{% hint style="warning" %}
For many metafield types (e.g. dimension, weight, decimal, etc), the `value` attribute of the metafield object is a JSON-encoded string. For most scalar types (e.g. boolean, number\_integer), the `value` attribute has a matching type.

The simplest way to access a usable version of a metafield value is via the [metafield representation object](/platform/liquid/objects/shopify/metafields/metafield-representation-object.md), i.e. `resource.metafields.namespace.key.value`.
{% endhint %}

## How to access it

* For modern metafields, use `resource.metafields.namespace.key.metafield` to retrieve the metafield object itself.
  * Use `resource.metafields.namespace.key` to access the [metafield representation object](/platform/liquid/objects/shopify/metafields/metafield-representation-object.md) for that metafield.
* For deprecated metafields, use `resource.metafields.namespace.key` to retrieve the parsed, appropriately-typed metafield value.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://learn.mechanic.dev/platform/liquid/objects/shopify/metafields/metafield-object.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
