Product Total Count

🔒

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:

  1. Analytics and Reporting: Obtain a count of products for detailed insights and reporting purposes.

  2. Pagination Optimization: Use the count to calculate total pages or optimize data retrieval processes.

Request Parameters

Public Request Parameters

📘

Public Request Parameters

Query Parameters

ParameterTypeRequiredExampleDescription
idsstringNo9e79ca1f-9ff2-409b-976f-98be343d38a3vProduct's IDs, separated by commas, to filter specific products.
titlestringNoShirtProduct's title for filtering results based on name.
collection_idstringNo9e79ca1f-9ff2-409b-976f-98be343d38a3Collection's unique identifier to filter products within a collection.
created_at_minstringNo2018-10-01T16:15:47-04:00Filter products created at or after the specified date.
created_at_maxstringNo2018-10-01T16:15:47-04:00Filter products created at or before the specified date.
updated_at_minstringNo2018-10-01T16:15:47-04:00Filter products last updated at or after the specified date.
updated_at_maxstringNo2018-10-01T16:15:47-04:00Filter products last updated at or before the specified date.
published_at_minstringNo2018-10-01T16:15:47-04:00Filter products published at or after the specified date.
published_at_maxstringNo2018-10-01T16:15:47-04:00Filter products published at or before the specified date.
published_statusstringNopublished, unpublished, or anyFilter products by their published status.

Response Explanation

Public Response Parameters

📘

Public Response Parameters

Successful Response

FieldTypeExampleDescription
countinteger509The 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.

FieldTypeExampleDescription
errorsArray["created_at_max time format error"]A list of errors encountered during the request processing.
FieldTypeExampleDescription
errorArray "store is not active"Indicates an error encountered during the process.

Error Details

Status CodeMessagePossible ReasonExample Response
422failed verification: the published status is invalidThe published_status provided is not one of the allowed values.{"errors": ["failed verification: the published status is invalid"]}
created_at_min time format errorThe 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 errorThe 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 errorThe 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 errorThe 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 errorThe 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 errorThe 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
500no_contextMissing Context{"errors": ["No context"]}

API Structure Overview

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