Retrieve a list of metafields for a specific resource
The Get Metafields List API allows developers to retrieves a paginated list of metafields associated with a specific resource in your store.
This API is particularly useful for:
- Managing custom metadata for various store resources
- Building integrations with external systems
- Creating advanced filtering and categorization systems
Request Parameters
Public Request Parameters
Path Parameters
Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| string | Yes | Type of resource the metafield belongs to. Valid values: |
|
| string | Yes | Unique identifier of the resource |
|
Query Parameters
Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| string | No | Filters metafields by their namespace |
|
| string | No | Filters metafields by exact key match |
|
| string | No | Filters by metafield data type. Valid values: |
|
| string | No | Number of items per page |
|
| string | No | Pagination cursor |
|
| string | No | Filter metafields created after this timestamp (ISO-8601) |
|
| string | No | Filter metafields created before this timestamp (ISO-8601) |
|
| string | No | Filter metafields updated after this timestamp (ISO-8601) |
|
| string | No | Filter metafields updated before this timestamp (ISO-8601) |
|
| array of string | No | Filter by metafield definition IDs |
|
Response Explanation
Public Response Parameters
Successful Response
| Field | Type | Example | Description |
|---|---|---|---|
code | string | "success" | code indicating request status. |
message | string | Descriptive message about the response. | |
data.metafields | array | List of metafield objects. | |
data.metafields[].id | string | "mf_001" | Unique ID of the metafield. |
data.metafields[].store_id | integer | 12345 | ID of the store that owns the metafield. |
data.metafields[].owner_resource | string | "product" | Resource type that owns the metafield (e.g., "product"). |
data.metafields[].owner_id | string | "prod_001" | ID of the owner resource. |
data.metafields[].namespace | string | "global" | Namespace of the metafield. |
data.metafields[].key | string | "color" | Key of the metafield. |
data.metafields[].type | string | "string" | Type of the metafield ("json" or "string"). |
data.metafields[].description | string | "Product color" | Description of the metafield. |
data.metafields[].definition_id | string | "df_001" | ID of the metafield definition. |
data.metafields[].created_at | string | "2023-01-15T10:00:00Z" | Timestamp when the metafield was created (ISO 8601 format). |
data.metafields[].updated_at | string | "2023-06-20T14:30:00Z" | Timestamp when the metafield was last updated (ISO 8601 format). |
data.cursor | string | "eyJpZCI6IjEwMDAiLCJ..." | Cursor for pagination (use for fetching next page). |
data.has_more | boolean | true | Indicates if more results are available (true if there are more results). |
Error Response
| Field | Type | Example | Description |
|---|---|---|---|
code | string | InvalidParameter | Error http message |
message | string | `` | Error message |
