Skip to main content

productVariants

Requires permission products:product:read.

Lists the variants of a product. Fails if the product does not exist. Needs the products read permission.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

query ProductVariants($productId: ID!) {
productVariants(productId: $productId) {
id
QRCode
name
createdAt
attributes
barcode
baseUOM {
id
code
colorCode
name
pluralName
createdAt
}
}
}

Variables:

{
"productId": "id"
}

Response:

{
"data": {
"productVariants": [
{
"id": "id",
"QRCode": "string",
"name": "string",
"createdAt": "2025-01-15T00:00:00Z",
"attributes": {},
"barcode": "string",
"baseUOM": {
"id": "id",
"code": "string",
"colorCode": "string",
"name": "string",
"pluralName": "string",
"createdAt": "2025-01-15T00:00:00Z"
}
}
]
}
}
productVariants(
productId: ID!
): [ProductVariant!]!

Arguments​

productVariants.productId ● ID! non-null scalar​

The ID of the product.

Type​

ProductVariant object​

A sellable version of a product, with its own SKU, price, units of measure and stock.