Metafield Definition List

Retrieve a list of metafield definitions for a specific resource.

This API is especially useful for:

  1. Fetching all custom metafield definitions associated with a resource.
  2. Managing multiple metafield configurations efficiently.
  3. Validating resource-specific metadata fields.

Note: The operation is scoped to a specific shop, identified by its unique domain prefix (shopdomain), ensuring all queries are applied to the correct store.

Request Parameters

Public Request Parameters

📘

Path Parameters

FieldTypeRequiredExampleDescription
owner_resourcestringYesproductThe type of resource that the metafield is attached to. Available resources: shop, product, product_image, product_variant, order, page, customer, collection, blog, article.

Response Explanation

Public Response Parameters

📘

Successful Response

Field

Type

Example

Description

definitions

array of object

List of metafield definitions.

definitions[].id

string

374034306256875562

Unique identifier for the metafield definition.

definitions[].key

string

key2

Unique key to identify the metafield.

definitions[].name

string

Big

Name or title of the metafield definition.

definitions[].namespace

string

test

Namespace to group metafield definitions.

definitions[].owner_resource

string

product

The type of resource that the metafield is attached to. Available resources: shop, product, product_image, product_variant, order, page, customer, collection, blog, article.

definitions[].type

string

boolean

Field type for the metafield. Valid Values for type:

  • date
  • date_time
  • weight
  • volume
  • dimension
  • integer
  • number_decimal
  • file_reference
  • single_line_text_field
  • multi_line_text_field
  • json
  • color
  • rating
  • url
  • boolean

definitions[].description

string

boolean

Brief description of the metafield definition.

definitions[].create_at

string

2024-04-28T03:18:59Z

Timestamp of when the metafield was created.

definitions[].updated_at

string

2024-04-28T03:18:59Z

Timestamp of the last update for the metafield.

total

integer

3

Total number of metafield definitions returned.

Error Response

Error responses in the API can be represented using two different fields: errors and error. Both fields provide details about issues encountered during request processing. Below is an explanation of the fields with their respective examples and descriptions.

FieldTypeExampleDescription
errorsarray["invalid own resources"]A list of errors encountered during the request processing.
FieldTypeExampleDescription
errorString "store is not active"Indicates an error encountered during the process

Error Detail

Status CodeMessagePossible ReasonExample Response
400Bad RequestInvalid input format or request structure (e.g., missing required fields or incorrect data types).Bad Request
UnauthorizedThe request is missing valid authentication credentials or the credentials provided are invalid.Unauthorized
422"invalid own resources"empty own resources or invalid resources"invalid own resources"

API Structure Overview

Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!