Queries for retrieving Variant Projections in the platform.

Queries

Query Variant Projections

QUERYvariantProjections

Query variant projections with filtering and pagination

Arguments
where​
String​
sort​
Array of String​
limit​
Int​
offset​
Int​
staged​
Boolean​

If true, queries staged projections. If false (default), queries current (published) projections.

Default: false​
productId​
String​

Filters variant projections by product ID

localeProjection​
Array of Locale​

Filters localized fields (name, slug, description, attribute labels) to the specified locales

includeNames​
Array of String​

The names of the attributes to include.

If neither includeNames nor excludeNames are provided, then all attributes are returned.
excludeNames​
Array of String​

The names of the attributes to exclude.

If neither includeNames nor excludeNames are provided, then all attributes are returned.

Get Variant Projection

QUERYvariantProjection

Query a single variant projection by id, key, or sku and other args

Arguments
id​
String​

Queries with specified ID

key​
String​

Queries with specified key

sku​
String​

Queries for a variant projection with specified SKU

staged​
Boolean​

If true, queries staged projections. If false (default), queries current (published) projections.

Default: false​
localeProjection​
Array of Locale​

Filters localized fields (name, slug, description, attribute labels) to the specified locales

Output types

VariantProjection

A variant projection with embedded product data

id​
String​

Unique identifier of the Variant within its parent Product.

staged​
Boolean​
true for the staged (draft) projection, false for the current (published) projection.
default​
Boolean​
Whether this Variant is the default Variant of its Product (see Product.defaultVariant).
variantId​
Int​
The id of the Variant.
version​
Long​

Current version of the Variant Projection.

createdAt​

Date and time (UTC) the Variant Projection was initially created.

productRef​
Reference to the parent Product.
key​
String​
User-defined unique identifier of the Variant.
sku​
String​
SKU of the Variant.
images​
Array of Image​
Images of the Variant.
assets​
Array of Asset​
Assets of the Variant.
attributes​
Array of RawAttribute​

This field contains attributes data. Use includeNames/excludeNames query arguments to filter.

name​
String​
Name of the parent Product.
nameAllLocales​
Array of LocalizedString​
Name of the parent Product.
slug​
String​
Slug of the parent Product.
slugAllLocales​
Array of LocalizedString​
Slug of the parent Product.
description​
String​
Description of the parent Product.
descriptionAllLocales​
Array of LocalizedString​
Description of the parent Product.
categoriesRef​
Array of Reference​
Categories assigned to the parent Product.
categories​
Array of Category​
Categories assigned to the parent Product.
categoryOrderHints​
Array of CategoryOrderHint​
Order of the parent Product in Categories.
price​

Returns a single price based on the price selection rules.

RawAttribute

name​
String​
value​
Json​
attributesRaw​
Array of RawAttribute​
BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta
referencedResource​
referencedResourceSet​

CategoryOrderHint

categoryId​
String​
orderHint​
String​

ProductPrice

id​
String​
value​
key​
String​
country​
customerGroup​
customerGroupRef​
channel​
channelRef​
validFrom​
validUntil​
discounted​
tiers​
Array of ProductPriceTier​
custom​
recurrencePolicy​
recurrencePolicyRef​

DiscountedProductPriceValue

value​
discountRef​
discount​

ProductPriceTier

minimumQuantity​
Int​
value​

VariantProjectionQueryResult

offset​
Int​
count​
Int​
total​
Long​
exists​
Boolean​
results​
Array of VariantProjection​