Queries for retrieving Variant Projections in the platform.
Queries
Query Variant Projections
Query variant projections with filtering and pagination
| Arguments | |
|---|---|
whereString | |
sortArray of String | |
limitInt | |
offsetInt | |
stagedBoolean | If true, queries staged projections. If false (default), queries current (published) projections. Default:false |
productIdString | Filters variant projections by product ID |
localeProjectionArray of Locale | Filters localized fields (name, slug, description, attribute labels) to the specified locales |
includeNamesArray of String | The names of the attributes to include. If neither includeNames nor excludeNames are provided, then all attributes are returned. |
excludeNamesArray of String | The names of the attributes to exclude. If neither includeNames nor excludeNames are provided, then all attributes are returned. |
Get Variant Projection
Query a single variant projection by id, key, or sku and other args
| Arguments | |
|---|---|
idString | Queries with specified ID |
keyString | Queries with specified key |
skuString | Queries for a variant projection with specified SKU |
stagedBoolean | If true, queries staged projections. If false (default), queries current (published) projections. Default:false |
localeProjectionArray of Locale | Filters localized fields (name, slug, description, attribute labels) to the specified locales |
Output types
VariantProjection
A variant projection with embedded product data
idString | Unique identifier of the Variant within its parent Product. |
stagedBoolean | true for the staged (draft) projection, false for the current (published) projection. |
defaultBoolean | Whether this Variant is the default Variant of its Product (see Product.defaultVariant). |
variantIdInt | The id of the Variant. |
versionLong | Current version of the Variant Projection. |
createdAt | Date and time (UTC) the Variant Projection was initially created. |
productRef | |
keyString | User-defined unique identifier of the Variant. |
skuString | SKU of the Variant. |
imagesArray of Image | Images of the Variant. |
assetsArray of Asset | Assets of the Variant. |
attributesArray of RawAttribute | This field contains attributes data. Use includeNames/excludeNames query arguments to filter. |
nameString | Name of the parent Product. |
nameAllLocalesArray of LocalizedString | Name of the parent Product. |
slugString | Slug of the parent Product. |
slugAllLocalesArray of LocalizedString | Slug of the parent Product. |
descriptionString | Description of the parent Product. |
descriptionAllLocalesArray of LocalizedString | Description of the parent Product. |
categoriesRefArray of Reference | Categories assigned to the parent Product. |
categoriesArray of Category | Categories assigned to the parent Product. |
categoryOrderHintsArray of CategoryOrderHint | Order of the parent Product in Categories. |
price | Returns a single price based on the price selection rules. |
RawAttribute
nameString | |
valueJson | |
attributesRawArray 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 | |
referencedResourceSetArray of ReferenceExpandable |
CategoryOrderHint
categoryIdString | |
orderHintString |
ProductPrice
idString | |
value | |
keyString | |
country | |
customerGroup | |
customerGroupRef | |
channel | |
channelRef | |
validFrom | |
validUntil | |
discounted | |
tiersArray of ProductPriceTier | |
custom | |
recurrencePolicy | |
recurrencePolicyRef |
DiscountedProductPriceValue
value | |
discountRef | |
discount |
ProductPriceTier
minimumQuantityInt | |
value |
VariantProjectionQueryResult
offsetInt | |
countInt | |
totalLong | |
existsBoolean | |
resultsArray of VariantProjection |