**版本：202201**

# 查询元字段 列表

**GET** `/openapi/2022-01/:resource/:resource_id/metafields`

## 请求

**Path参数**

- `resource` string (required)

  The type of resource that the metafield is attached to. Available resources: `shop`, `product`, `product_image`, `product_variant`, `order`, `page`, `customer`, `collection`, `blog`, `article`.
- `resource_id` string (required)

  The unique ID of the resource that the metafield is attached to.

**Query参数**

- `namespace` string

  A container for a group of metafields. Grouping metafields within a namespace prevents your metafields from conflicting with other metafields with the same key name.
- `key` string

  The key of the metafield.
- `type` string

  The type of data that the metafield stores in the `value` field.
- `limit` string

  Limit per page
- `since_id` string

  Show metafields created after the specified ID.
- `create_at_min` string

  Show metafields created after date, ISO-8601 format, for example: `2022-12-02T09:46:30Z`
- `create_at_max` string

  Show metafields created before date, ISO-8601 format, for example: `2022-12-02T09:46:30Z`
- `update_at_min` string

  Show metafields last updated after date, ISO-8601 format, for example: `2022-12-02T09:46:30Z`
- `update_at_max` string

  Show metafields last updated before date, ISO-8601 format, for example: `2022-12-02T09:46:30Z`

## 响应

**200**

200

**application/json**

**数据结构 | 示例 | Result**

**数据结构**

- `metafields` object[]

  *   Array [

  - `id` string

    **示例：** `374050809094090794`
  - `store_id` integer

    **默认值：** `0`

    **示例：** `633130`
  - `created_at` string

    **示例：** `2024-04-28T06:50:19Z`
  - `updated_at` string

    **示例：** `2024-04-28T06:50:19Z`
  - `owner_resource` string

    **示例：** `product`
  - `owner_id` string

    **示例：** `a1a88be0-a1d4-47e4-a2f2-ba6e131cf447`
  - `namespace` string

    **示例：** `shirt`
  - `key` string

    **示例：** `weight`
  - `type` string

    **示例：** `weight`
  - `value` integer

    **默认值：** `0`

    **示例：** `10`
  - `description` string

    **示例：** `weight`
  - `definition_id` string

    **示例：** `0`
  *   ]
- `last_id` string

  **示例：** `374087540346466346`
- `total` integer

  **默认值：** `0`

  **示例：** `2`
- `remain` integer

  **默认值：** `0`

  **示例：** `0`
- `page` integer

  **默认值：** `0`

  **示例：** `1`
- `total_page` integer

  **默认值：** `0`

  **示例：** `1`
- `have_next` boolean

  **默认值：** `true`

  **示例：** `false`

```json
{
  "metafields": [
    {
      "id": "374050809094090794",
      "store_id": 633130,
      "created_at": "2024-04-28T06:50:19Z",
      "updated_at": "2024-04-28T06:50:19Z",
      "owner_resource": "product",
      "owner_id": "a1a88be0-a1d4-47e4-a2f2-ba6e131cf447",
      "namespace": "shirt",
      "key": "weight",
      "type": "weight",
      "value": 10,
      "description": "weight",
      "definition_id": "0"
    }
  ],
  "last_id": "374087540346466346",
  "total": 2,
  "remain": 0,
  "page": 1,
  "total_page": 1,
  "have_next": false
}
```

```json
{
    "metafields": [
        {
            "id": "374050809094090794",
            "store_id": 633130,
            "created_at": "2024-04-28T06:50:19Z",
            "updated_at": "2024-04-28T06:50:19Z",
            "owner_resource": "product",
            "owner_id": "a1a88be0-a1d4-47e4-a2f2-ba6e131cf447",
            "namespace": "shirt",
            "key": "weight",
            "type": "weight",
            "value": 10,
            "description": "weight",
            "definition_id": "0"
        },
        {
            "id": "374087540346466346",
            "store_id": 633130,
            "created_at": "2024-04-28T06:52:36Z",
            "updated_at": "2024-04-28T06:52:36Z",
            "owner_resource": "product",
            "owner_id": "a1a88be0-a1d4-47e4-a2f2-ba6e131cf447",
            "namespace": "shirt",
            "key": "weight1",
            "type": "weight",
            "value": 10,
            "description": "weight",
            "definition_id": "374087760941687850"
        }
    ],
    "last_id": "374087540346466346",
    "total": 2,
    "remain": 0,
    "page": 1,
    "total_page": 1,
    "have_next": false
}
```
