Get Metafield List

The Get Metafield List API retrieves a list of metafields associated with a resource, filtered based on query parameters.

This API is especially useful for:

  1. Fetching all metafields for a given resource (e.g., shop, product).
  2. Filtering metafields by namespace, type, or creation/update timestamps.
  3. Paginating large metafield datasets.

Request Parameters

Public Request Parameters

📘

Path Parameters

FieldTypeRequiredExampleDescription
resourcestringYesproductThe resource type associated with the metafield. Available resources:
shop, product, product_image, product_variant, order, page, customer, collection, blog, article.
resource_idstringYes374034306256875562The unique ID of the resource associated with the metafield.

Body Parameters

Field

Type

Required

Example

Description

namespace

string

No

custom

A container for a group of metafields to prevent conflicts with other keys.

key

string

No

weight

The key name of the metafield.

type

string

No

single_line_text_field

The type of data that the metafield stores.
Valid values:
- date
- date_time
- weight
- volume
- dimension
- integer
- number_decimal
- file_reference
- single_line_text_field
- multi_line_text_field
- json
- color
- rating
- url
- boolean.

limit

string

No

10

Limit the number of metafields returned per page. Default is 10.

since_id

string

No

374034306256875562

Return metafields created after the specified ID.

create_at_min

string

No

2022-12-02T09:46:30Z

Return metafields created after this date (ISO-8601 format).

create_at_max

string

No

2022-12-02T09:46:30Z

Return metafields created before this date (ISO-8601 format).

update_at_min

string

No

2022-12-02T09:46:30Z

Return metafields updated after this date (ISO-8601 format).

update_at_max

string

No

2022-12-02T09:46:30Z

Return metafields updated before this date (ISO-8601 format).

Response Explanation

Public Response Parameters

📘

Successful Response

FieldTypeExampleDescription
metafieldsarray of objects-List of metafields associated with the resource.
metafields[].idstring374050809094090794Unique identifier for the metafield.
metafields[].store_idinteger633130The store ID associated with the metafield.
metafields[].created_atstring2024-04-28T06:50:19ZThe creation time of the metafield in UTC (ISO-8601 format).
metafields[].updated_atstring2024-04-28T06:50:19ZThe last update time of the metafield in UTC (ISO-8601 format).
metafields[].owner_resourcestringproductThe resource type to which the metafield belongs.
metafields[].owner_idstringa1a88be0-a1d4-47e4The ID of the resource owner.
metafields[].namespacestringshirtThe namespace for grouping metafields.
metafields[].keystringweightThe key name of the metafield.
metafields[].typestringweightThe type of data stored in the metafield.
metafields[].valueinteger or string10The value stored in the metafield.
metafields[].descriptionstringweightA description of the metafield.
metafields[].definition_idstring0 or 374087760941687850The ID of the metafield definition.
last_idstring374087540346466346The ID of the last metafield in the current response.
totalinteger2The total number of metafields returned.
remaininteger0The number of metafields remaining to be fetched.
pageinteger1The current page number in the paginated response.
total_pageinteger1The total number of pages available.
have_nextbooleanfalseIndicates whether there are more pages to fetch (true/false).

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["data not found"]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

API Structure Overview

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