Get Metafields Count

The Get Metafields Count API retrieves the total number of metafields attached to a specific resource.

This API is especially useful for:

  1. Checking the total number of metafields for a resource.
  2. Managing and validating metafield counts efficiently.
  3. Auditing metafield usage across various resource types.

Request Parameters

Public Request Parameters

📘

Public Request Parameters

Path Parameters

FieldTypeRequiredExampleDescription
resourcestringYesproductThe resource type associated with the metafield. Available resources:
shop, product, product_image, product_variant, order, page, customer, collection, blog, article.
resource_idstringYes374034306256875562The unique ID of the resource associated with the metafield.

Response Explanation

Public Response Parameters

📘

Public Response Parameters

Successful Response

FieldTypeExampleDescription
countinteger5The total number of metafields attached to 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["data not found"]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!