Requires
read_product
access scope. For more access scope
The Product Total Count API retrieves the total number of products that match specific filter criteria. It allows you to query the product catalog using various parameters, such as creation date, update date, published status, or collection ID, providing a count of products without fetching their full details.This API is especially useful for:
-
Analytics and Reporting: Obtain a count of products for detailed insights and reporting purposes.
-
Pagination Optimization: Use the count to calculate total pages or optimize data retrieval processes.
Request Parameters
Public Request Parameters
Query Parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
ids | string | No | 9e79ca1f-9ff2-409b-976f-98be343d38a3 v | Product's IDs, separated by commas, to filter specific products. |
title | string | No | Shirt | Product's title for filtering results based on name. |
collection_id | string | No | 9e79ca1f-9ff2-409b-976f-98be343d38a3 | Collection's unique identifier to filter products within a collection. |
created_at_min | string | No | 2018-10-01T16:15:47-04:00 | Filter products created at or after the specified date. |
created_at_max | string | No | 2018-10-01T16:15:47-04:00 | Filter products created at or before the specified date. |
updated_at_min | string | No | 2018-10-01T16:15:47-04:00 | Filter products last updated at or after the specified date. |
updated_at_max | string | No | 2018-10-01T16:15:47-04:00 | Filter products last updated at or before the specified date. |
published_at_min | string | No | 2018-10-01T16:15:47-04:00 | Filter products published at or after the specified date. |
published_at_max | string | No | 2018-10-01T16:15:47-04:00 | Filter products published at or before the specified date. |
published_status | string | No | published , unpublished , or any | Filter products by their published status. |
Response Explanation
Public Response Parameters
Successful Response
Field | Type | Example | Description |
---|---|---|---|
count | integer | 509 | The total number of products matching the filters. |
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 | ["created_at_max time format error"] | A list of errors encountered during the request processing. |
Field | Type | Example | Description |
---|---|---|---|
error | Array | "store is not active" | Indicates an error encountered during the process. |
Error Details
Status Code | Message | Possible Reason | Example Response |
---|---|---|---|
422 | failed verification: the published status is invalid | The published_status provided is not one of the allowed values. | {"errors": ["failed verification: the published status is invalid"]} |
created_at_min time format error | The created_at_min field is not in a valid time format.(e.g., not ISO8601). | {"errors": [" created_at_min time format error""]} | |
created_at_max time format error | The updated_at_max field is not in a valid time format.(e.g., not ISO8601). | {"errors": ["created_at_max time format error"]} | |
published_at_max time format error | The published_at_max field is not in a valid time format.(e.g., not ISO8601). | {"errors": ["published_at_max time format error"]} | |
published_at_min time format error | The published_at_min field is not in a valid time format.(e.g., not ISO8601). | {"errors": ["published_at_min time format error"]} | |
update_at_min time format error | The update_at_min field is not in a valid time format.(e.g., not ISO8601). | {"errors": ["update_at_min time format error"]} | |
update_at_max time format error | The update_at_max field is not in a valid time format.(e.g., not ISO8601). | {"errors": ["update_at_min time format error"]} | |
Invalid cursor or pre_cursor type | |||
500 | no_context | Missing Context | {"errors": ["No context"]} |