Skip to content

List variants

View as Markdown
get /rest/api/products/{productId}/variants

Retrieves the collection of Product Variant resources.

Returns the paginated collection of variants belonging to a product. When resolveContext is set, each variant’s resolvedPrice is computed for the given channel, country and timestamp.

Headers

NameTypeRequiredDescription
X-Flowkiwi-Organization-IdstringrequiredThe organization the request acts as. Determines the identity, permissions and ownership applied when reading or modifying data on the instance.

Path parameters

NameTypeRequiredDescription
productIdstringrequiredProductResource identifier

Query parameters

NameTypeRequiredDescription
resolveContext[channel]string-Channel IRI used to resolve the variant price. Required together with resolveContext[country].
resolveContext[country]string-Country IRI used to resolve the variant price. Required together with resolveContext[channel].
resolveContext[at]string-ISO 8601 UTC timestamp at which the price is resolved. Defaults to the current time when omitted.
expandstring-Comma-separated list of relations to embed as full objects instead of IRI strings. Supported values: optionValues, medias, metafields, metaobject. Tokens are independent; unknown values are silently ignored. metaobject only has a visible effect when combined with metafields (it embeds the referenced metaobject on each metafield of type metaobject_reference or list__metaobject_reference).
pageinteger-The collection page number
itemsPerPageinteger-The number of items per page
order[createdAt]string-
order[updatedAt]string-
createdAt[before]string-
createdAt[strictly_before]string-
createdAt[after]string-
createdAt[strictly_after]string-
updatedAt[before]string-
updatedAt[strictly_before]string-
updatedAt[after]string-
updatedAt[strictly_after]string-

Response

200 - Product Variant collection

PropertyTypeRequiredDescription
hydra:totalItemsinteger-
hydra:searchobject-
Show hydra:search fields
PropertyTypeRequiredDescription
@typestring-
hydra:templatestring-
hydra:variableRepresentationstring-
hydra:mappingobject[]-
Show hydra:mapping fields
PropertyTypeRequiredDescription
@typestring-
variablestring-
propertystring | null-
requiredboolean-
hydra:viewobject-
Show hydra:view fields
PropertyTypeRequiredDescription
@idstring-
@typestring-
hydra:firststring-
hydra:laststring-
hydra:previousstring-
hydra:nextstring-
hydra:memberProduct.Variant[]required
Show hydra:member fields
PropertyTypeRequiredDescription
@contextobject-
@idstringrequired
@typestringrequired
idstring-The resource's unique identifier (UUID).
barcodestringrequiredThe barcode, unique UPC, or ISBN number for the product.
skustringrequiredA unique identifier for the product variant.
measurementEmbeddedMeasurementResource | null-The measurement used to compute per-unit prices for the variant.
Show measurement fields
PropertyTypeRequiredDescription
measuredType"volume" | "weight" | "length" | "area" | "unit"requiredThe kind of physical quantity measured (volume, weight, length, area or unit).
quantityUnit"ml" | "cl" | "l" | "mg" | "g" | "kg" | "mm" | "cm" | "m" | "m2" | "unit"requiredThe unit the variant's quantity is expressed in.
quantityValueintegerrequiredThe variant's quantity, expressed in the quantity unit.
referenceUnit"ml" | "cl" | "l" | "mg" | "g" | "kg" | "mm" | "cm" | "m" | "m2" | "unit"requiredThe unit used as the basis for per-unit price calculations.
referenceValueintegerrequiredThe number of reference units used for per-unit price calculations.
productstringrequiredThe product resource it belongs to.
optionValuesstring[]-A list of Option Value, each one representing an option value associated with the variant.
mediasstring[]-A list of Media, ordered by position. Only media of type "image" can be associated with a variant. Returned as IRI strings by default; pass ?expand=medias to embed full Media objects.
resolvedPriceResolvedPriceResource | null-The price resolved for the current resolveContext (country, channel and instant). Null unless resolveContext[country], resolveContext[channel] and resolveContext[at] are all provided.
Show resolvedPrice fields
PropertyTypeRequiredDescription
priceEmbeddedMoneyResource-
discountPriceEmbeddedMoneyResource | null-
currencystring-ISO 4217 currency code (mirrors price.currency for convenience).
taxRatenumber-Tax rate applied, in percent (e.g. 20.0).
taxExcludedPriceEmbeddedMoneyResource-
discountTaxExcludedPriceEmbeddedMoneyResource | null-
countryIdstring-The Country used to resolve the price.
channelIdstring-The Channel used to resolve the price.
atstring-The instant used to resolve the price (defaults to request time).
saleOfferIdstring-The SaleOffer that was resolved.
lowestPriceLast30DaysEmbeddedMoneyResource | null-
lowestPriceLast30DaysAtstring | null-The instant at which lowestPriceLast30Days was active. Falls back to at when no prior data exists.
metafieldsstring[]-Metafields owned by this variant. Serialized as IRI strings by default; pass ?expand=metafields to embed full MetafieldResource objects.
createdAtstring-The date and time when the resource was created (ISO 8601 format).
updatedAtstring-The date and time when the resource was last modified (ISO 8601 format).

Errors

403 - Access denied. The caller is missing one or more identity permissions required for this operation.

Content-Type: application/problem+json

PropertyTypeRequiredDescription
@contextobject-
@idstringrequired
@typestringrequired
typestring-
titlestring-
statusinteger-
detailstring-
missingPermissionsstring[]-Identity permissions that the caller is missing for this operation. Present only when the 403 is caused by a denied identity:* permission.