Get Metafield Count

Retrieve the count of metafields for a specific resource

The Get Metafields API allows developers to retrieve the total number of metafields associated with a specific resource.

This API is especially useful for:

  1. Checking how many custom fields are attached to a product, customer, or other resource.
  2. Determining if a resource has any metafield data before performing operations.
  3. Implementing pagination or batch processing of metafield data.

Request Parameters

Public Request Parameters

📘

Path Parameters

ParameterTypeRequiredDescriptionExample
owner_resourcestringyesThe type of resource the metafields are attached to. Available values: shop, product, product_image, product_variant, order, page, customer, collection, blog, articleproduct
owner_idstringyesThe unique ID of the resource to count metafields forprod_12345

Response Explanation

Public Response Parameters

📘

Successful Response

ParameterTypeExampleDescription
codestringsuccessHTTP status code
messagestringResponse message
dataobject{...}Response data container
data.total_countint3232total_count

Error Response

FieldTypeExampleDescription
codestringInvalidParameterError http message
messagestring``Error message

API Structure Overview

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