Metafield Definition By Group Count

Retrieve the count of metafield definitions grouped by resource type.

This API is especially useful for:

  1. Aggregating metafield definition counts by resource type.
  2. Analyzing metafield usage across different resources.
  3. Monitoring metafield group limits for specific resources.

Note: The operation is scoped to a specific shop, identified by its unique domain prefix (shopdomain), ensuring all queries are applied to the correct store.

Request Parameters

Public Request Parameters

📘

Public Request Parameters

Response Explanation

Public Response Parameters

📘

Public Response Parameters

Successful Response

FieldTypeExampleDescription
itemsarray of objectList of metafield definition counts by group.
items[].owner_resourcestring"product"The type of resource that the metafield is attached to. Available resources: shop, product, product_image, product_variant, order, page, customer, collection, blog, article.
items[].countinteger3Count of metafield definitions for the resource.

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.

FieldTypeExampleDescription
errorsarray["invalid own resources"]A list of errors encountered during the request processing.
FieldTypeExampleDescription
errorString "store is not active"Indicates an error encountered during the process

Error Detail

Status CodeMessagePossible ReasonExample Response
400Bad RequestInvalid input format or request structure (e.g., missing required fields or incorrect data types).Bad Request
UnauthorizedThe request is missing valid authentication credentials or the credentials provided are invalid.Unauthorized

API Structure Overview

Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!