# Metafield - customer - OBJECT
Version: 2025-01

## Description
The custom metadata attached to a resource. Metafields can be sorted into namespaces and are
comprised of keys, values, and value types.

### Access Scopes



## Fields
* [compareDigest](/docs/api/customer/2025-01/scalars/String): String! - The data stored in the resource, represented as a digest.
* [createdAt](/docs/api/customer/2025-01/scalars/DateTime): DateTime! - The date and time when the metafield was created.
* [description](/docs/api/customer/2025-01/scalars/String): String - The description of a metafield.
* [id](/docs/api/customer/2025-01/scalars/ID): ID! - A globally-unique ID.
* [jsonValue](/docs/api/customer/2025-01/scalars/JSON): JSON! - The data stored in the metafield in JSON format.
* [key](/docs/api/customer/2025-01/scalars/String): String! - The key name for a metafield.
* [namespace](/docs/api/customer/2025-01/scalars/String): String! - The namespace for a metafield.
* [type](/docs/api/customer/2025-01/scalars/String): String! - The type name of the metafield.
See the list of [supported types](https://shopify.dev/apps/metafields/definitions/types).
* [updatedAt](/docs/api/customer/2025-01/scalars/DateTime): DateTime! - The date and time when the metafield was updated.
* [value](/docs/api/customer/2025-01/scalars/String): String! - The value of a metafield.

## Connections



## Related queries

## Related mutations
* [metafieldsSet](/docs/api/customer/2025-01/mutations/metafieldsSet) Sets metafield values. Metafield values will be set regardless if they were previously created or not.

Allows a maximum of 25 metafields to be set at a time.

This operation is atomic, meaning no changes are persisted if an error is encountered.

As of `2024-07`, this operation supports compare-and-set functionality to better handle concurrent requests.
If `compareDigest` is set for any metafield, the mutation will only set that metafield if the persisted metafield value matches the digest used on `compareDigest`.
If the metafield doesn't exist yet, but you want to guarantee that the operation will run in a safe manner, set `compareDigest` to `null`.
The `compareDigest` value can be acquired by querying the metafield object and selecting `compareDigest` as a field.
If the `compareDigest` value does not match the digest for the persisted value, the mutation will return an error.
You can opt out of write guarantees by not sending `compareDigest` in the request.

## Related Unions

## Examples