Skip to content

List metafield definition counts

View as Markdown
get /api/metafield_definitions/counts

Retrieves the collection of MetafieldDefinitionCount resources.

Returns, for each owner type (such as products or variants), the number of metafield definitions declared for it - a summary in a single call. Requires the metafields:read scope.

Query parameters

NameTypeRequiredDescription
properties[]string[]-Allows you to reduce the response to contain only the properties you need. If your desired property is nested, you can address it using nested arrays. Example: properties[]={propertyName}&properties[]={anotherPropertyName}&properties[{nestedPropertyParent}][]={nestedProperty}

Response

200 - MetafieldDefinitionCount collection

PropertyTypeRequiredDescription
searchobject-
Show search fields
PropertyTypeRequiredDescription
@typestring-
mappingobject[]-
Show mapping fields
PropertyTypeRequiredDescription
@typestring-
propertystring | null-
requiredboolean-
variablestring-
templatestring-
variableRepresentationstring-
totalItemsinteger-
memberMetafieldDefinitionCount[]required
Show member fields
PropertyTypeRequiredDescription
@contextstring | object-
@idstringrequired
@typestringrequired
countinteger-The number of metafield definitions for this owner type.
ownerType"/api/metafield_owner_types/products" | "/api/metafield_owner_types/collections" | "/api/metafield_owner_types/variants" | "/api/metafield_owner_types/sale_offers" | "/api/metafield_owner_types/purchase_offers"-The owner type for which metafield definitions are counted.

Errors

403 - Access denied. The caller is missing one or more permissions required for this operation.

Content-Type: application/problem+json

PropertyTypeRequiredDescription
@contextstring | object-
@idstringrequired
@typestringrequired
detailstring-
missingPermissionsstring[]-Permissions that the caller is missing for this operation. Present only when the 403 is caused by a denied permission.
statusinteger-
titlestring-
typestring-