Variant Total Count

🔒

Requires read_product access scope. More access scope

The Variant Total Count API allows you to retrieve the total number of variants associated with a specific product. This is particularly useful for analytics, reporting, or managing product inventories where the number of variants per product needs to be tracked. By specifying the product_id, this endpoint returns the count of all variants linked to the product.This API is especially useful for:

  1. Monitor the number of variants for inventory management.
  2. Analyze product configurations for reporting purposes.

Request Parameters

Public Request Parameters

📘

Public Request Parameters

Path Parameters

ParameterTypeRequiredExampleDescription
product_idstringYes9fb9f3c6-2300-42c1-8593-d9008d7cfc09The unique identifier for the product.

Response Explanation

Public Response Parameters

📘

Public Response Parameters

Success Response

FieldTypeExampleDescription
countinteger509The total number of variant 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["Context"]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
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
422Invalid or empty idmissing required id or id with incorrect UUID types{ "errors": [ "productId has an invalid UUID"]}

API Structure Overview

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