**版本：202201**

# 按定义统计元字段数量

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

按元字段定义 ID 统计对应的元字段数量。

## 请求

**Path参数**

- `owner_resource` string (required)

  所属资源类型。

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

**Query参数**

- `definition_ids` string[] (required)

  待统计的元字段定义 ID 列表（至少 1 个）。

## 响应

**200 | 422**

200

**application/json**

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

**数据结构**

- `items` object[]

  *   Array [

  - `metafield_count` integer

    **默认值：** `0`

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

    **示例：** `374034306256875562`
  *   ]

```json
{
  "items": [
    {
      "metafield_count": 0,
      "definition_id": "374034306256875562"
    }
  ]
}
```

```json
{
  "items": [
    {
      "metafield_count": 0,
      "definition_id": "374034306256875562"
    }
  ]
}
```

422

**application/json**

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

**数据结构**

- `errors` string[]

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

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