get https://{shopdomain}.myshoplaza.com/openapi/2022-01///metafields
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:
- Fetching all metafields for a given resource (e.g.,
shop,product). - Filtering metafields by namespace, type, or creation/update timestamps.
- Paginating large metafield datasets.
Request Parameters
Public Request Parameters
Path Parameters
| Field | Type | Required | Example | Description |
|---|---|---|---|---|
resource | string | Yes | product | The resource type associated with the metafield. Available resources:shop, product, product_image, product_variant, order, page, customer, collection, blog, article. |
resource_id | string | Yes | 374034306256875562 | The 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
| Field | Type | Example | Description |
|---|---|---|---|
metafields | array of objects | - | List of metafields associated with the resource. |
metafields[].id | string | 374050809094090794 | Unique identifier for the metafield. |
metafields[].store_id | integer | 633130 | The store ID associated with the metafield. |
metafields[].created_at | string | 2024-04-28T06:50:19Z | The creation time of the metafield in UTC (ISO-8601 format). |
metafields[].updated_at | string | 2024-04-28T06:50:19Z | The last update time of the metafield in UTC (ISO-8601 format). |
metafields[].owner_resource | string | product | The resource type to which the metafield belongs. |
metafields[].owner_id | string | a1a88be0-a1d4-47e4 | The ID of the resource owner. |
metafields[].namespace | string | shirt | The namespace for grouping metafields. |
metafields[].key | string | weight | The key name of the metafield. |
metafields[].type | string | weight | The type of data stored in the metafield. |
metafields[].value | integer or string | 10 | The value stored in the metafield. |
metafields[].description | string | weight | A description of the metafield. |
metafields[].definition_id | string | 0 or 374087760941687850 | The ID of the metafield definition. |
last_id | string | 374087540346466346 | The ID of the last metafield in the current response. |
total | integer | 2 | The total number of metafields returned. |
remain | integer | 0 | The number of metafields remaining to be fetched. |
page | integer | 1 | The current page number in the paginated response. |
total_page | integer | 1 | The total number of pages available. |
have_next | boolean | false | Indicates 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.
| Field | Type | Example | Description |
|---|---|---|---|
errors | array | ["data not found"] | A list of errors encountered during the request processing. |
| Field | Type | Example | Description |
|---|---|---|---|
error | String | "store is not active" | Indicates an error encountered during the process |
Error Detail
| Status Code | Message | Possible Reason | Example Response |
|---|---|---|---|
| 400 | Bad Request | Invalid input format or request structure (e.g., missing required fields or incorrect data types). | Bad Request |
| Unauthorized | The request is missing valid authentication credentials or the credentials provided are invalid. | Unauthorized |
