get
https://{shopdomain}.myshoplaza.com/openapi/2022-01///metafields/count
The Get Metafields Count API retrieves the total number of metafields attached to a specific resource.
This API is especially useful for:
- Checking the total number of metafields for a resource.
- Managing and validating metafield counts efficiently.
- Auditing metafield usage across various resource types.
Request Parameters
Public Request Parameters
Path Parameters
| Field | Type | Required | Example | Description |
|---|---|---|---|---|
resource | string | Yes | product | The resource type associated with the metafield. Available resources:shop, product, product_image, product_variant, order, page, customer, collection, blog, article. |
resource_id | string | Yes | 374034306256875562 | The unique ID of the resource associated with the metafield. |
Response Explanation
Public Response Parameters
Successful Response
| Field | Type | Example | Description |
|---|---|---|---|
count | integer | 5 | The 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.
| Field | Type | Example | Description |
|---|---|---|---|
errors | array | ["data not found"] | A list of errors encountered during the request processing. |
| Field | Type | Example | Description |
|---|---|---|---|
error | String | "store is not active" | Indicates an error encountered during the process |
Error Detail
| Status Code | Message | Possible Reason | Example Response |
|---|---|---|---|
| 400 | Bad Request | Invalid input format or request structure (e.g., missing required fields or incorrect data types). | Bad Request |
| Unauthorized | The request is missing valid authentication credentials or the credentials provided are invalid. | Unauthorized |
