**版本：202201**

# 查询元字段定义列表

**GET** `/openapi/2022-01/metafield_definition/:owner_resource`

获取所有元字段定义的列表。

## 请求

**Path参数**

- `owner_resource` string (required)

  所属资源类型。

  *   shop: 店铺。
  *   product: 商品。
  *   product_image: 商品图片。
  *   product_variant: 商品款式。
  *   order: 订单。
  *   page: 自定义页面。
  *   customer: 顾客。
  *   collection: 商品专辑。
  *   blog: 博客。
  *   article: 文章。
  *   app: 应用。

## 响应

**200 | 422**

200

**application/json**

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

**数据结构**

- `definitions` object[]

  *   Array [

  - `id` string

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

    **示例：** `key2`
  - `name` string

    **示例：** `Big`
  - `namespace` string

    **示例：** `test`
  - `owner_resource` string

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

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

    **示例：** `boolean`
  - `create_at` string

    **示例：** `2024-04-28T03:18:59Z`
  - `updated_at` string

    **示例：** `2024-04-28T03:18:59Z`
  *   ]
- `total` integer

  **默认值：** `0`

  **示例：** `3`

```json
{
  "definitions": [
    {
      "id": "374034306256875562",
      "key": "key2",
      "name": "Big",
      "namespace": "test",
      "owner_resource": "product",
      "type": "boolean",
      "description": "boolean",
      "create_at": "2024-04-28T03:18:59Z",
      "updated_at": "2024-04-28T03:18:59Z"
    }
  ],
  "total": 3
}
```

```json
{
  "definitions": [
    {
      "id": "374034306256875562",
      "key": "key2",
      "name": "Big",
      "namespace": "test",
      "owner_resource": "product",
      "type": "boolean",
      "description": "boolean",
      "create_at": "2024-04-28T03:18:59Z",
      "updated_at": "2024-04-28T03:18:59Z"
    },
    {
      "id": "374032579801653802",
      "key": "key1",
      "name": "Big",
      "namespace": "test",
      "owner_resource": "product",
      "type": "boolean",
      "description": "boolean",
      "create_at": "2024-04-28T03:13:49Z",
      "updated_at": "2024-04-28T03:13:49Z"
    },
    {
      "id": "373310224787861546",
      "key": "config",
      "name": "config",
      "namespace": "custom",
      "owner_resource": "product",
      "type": "date",
      "description": "desc",
      "create_at": "2024-04-26T05:33:18Z",
      "updated_at": "2024-04-26T05:33:18Z"
    }
  ],
  "total": 3
}
```

422

**application/json**

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

**数据结构**

- `errors` string[]

```json
{
  "errors": [
    "invalid own resources"
  ]
}
```

```json
{
  "errors": [
    "invalid own resources"
  ]
}
```
