Operations
Metafield definitions
The custom fields an entity may carry, and how each one is typed. This is the schema layer: read it before writing metafield values, so your writes match the field's type and validations.
List metafield definitions
/api/v1/metafield-definitionspim:read
The account's metafield definitions. Bounded by the account, so the whole list
is returned and next_cursor is always null.
Query parameters
| Parameter | Type | Description |
|---|---|---|
owner_type | enum | Narrow to one owner kind: product, variant, or collection. Any other value is rejected with 400 validation_failed. |
curl "https://api.peak-pim.com/api/v1/metafield-definitions?owner_type=product" \
-H "Authorization: Bearer $PEAK_PIM_KEY"
Response — 200
{
"data": [
{
"id": "4f2b8d1c-7a9e-4c3b-9d5f-1e6a2c8b4d90",
"namespace": "custom",
"key": "care_instructions",
"name": "Care instructions",
"description": "Washing and drying guidance shown on the product page.",
"type": "multi_line_text_field",
"owner_type": "product",
"validations": [],
"position": 3,
"pending_publish": false,
"last_publish_status": "published",
"stores": [
{
"store_id": "1e8e4c2a-9f3b-4d7c-8a5e-6b2d9c1f7a30",
"store_domain": "acme-eu.myshopify.com",
"shopify_gid": "gid://shopify/MetafieldDefinition/23816765622",
"name": "Care instructions",
"description": "Washing and drying guidance shown on the product page.",
"pending_publish": false
}
]
}
],
"next_cursor": null
}
Get one metafield definition
/api/v1/metafield-definitions/{id}pim:read
One definition, as a single object with the same shape as a list item. An id
from another account, or of a different kind of entity, answers
404 not_found.
The definition shape
| Field | Type | Description |
|---|---|---|
id | uuid | The definition's id in Peak PIM. |
namespace | string | The metafield namespace. |
key | string | The metafield key within its namespace. |
name | string | The definition's display name. |
description | string | The definition's description, when set. |
type | string | Shopify's field type, e.g. single_line_text_field. |
owner_type | string | Which kind of entity carries this field. |
validations | array | Each validation is a {"name": …, "value": …} pair. |
position | integer or null | The merchant's manual display position, or null when the definition has never been reordered. |
pending_publish | boolean | The definition has unpublished changes. |
last_publish_status | enum | never_published, pending, published, or failed. |
stores | array | One record per store the definition exists on — see below. |
Each entry in stores records the definition's presence on one store:
| Field | Type | Description |
|---|---|---|
store_id / store_domain | uuid / string | Which store this record belongs to. |
shopify_gid | string | The definition's GID on that store. |
name / description | string | The store-local display name and description. |
pending_publish | boolean | Unpublished changes on this store's record. |
Read the schema before writing values
Metafield values on entities travel as attributes. Before an
integration writes one, it should confirm the field exists, what type
Shopify expects, and which validations constrain the value — that is
exactly what this list answers. Filter by owner_type to load only the
schema for the entity kind you are writing.
The top-level fields are the canonical definition; the stores array
tells you where it actually exists. A definition missing from a store is not an
error — it simply has no record for that store.
Notes
- Part of the 2026-07-31 operations surface (private beta).
- Every 200 carries an
ETag— conditional reads make re-loading the schema nearly free. - For structured content types (metaobjects) rather than single custom fields, see Metaobject definitions.