get
https://{subdomain}.myshoplaza.com/openapi/2025-06/metafield_definition//count
Retrieve the count of metafield by definition Ids.
The Count Metafield by Definition API allows developers to retrieve the count of metafields associated with specified definition IDs.
This API is especially useful for:
- Analyzing metafield usage across your store
- Identifying frequently used definitions
- Monitoring custom field adoption
Request Parameters
Public Request Parameters
Path Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
owner_resource | string | Yes | The owner resource type of the metafield | "products", "orders" |
Query Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
definition_ids | array[string] | Yes | Array of metafield definition IDs to count | ["mfd_123", "mfd_456"] |
Response Explanation
Public Response Parameters
Successful Response
| Parameter | Type | Example | Description |
|---|---|---|---|
code | string | "success" | Status code of the response |
message | string | Descriptive message of the response | |
data.items | array[object] | [{...}] | Array of metafield count objects |
data.items.metafield_count | int32 | 42 | Number of metafields using this definition |
data.items.definition_id | string | "mfd_123" | The metafield definition ID being counted |
Error Response
| Field | Type | Example | Description |
|---|---|---|---|
code | string | InvalidParameter | Error http message |
message | string | `` | Error message |
