Menu
Get a variant
Get a variant
/v1/variants/{variantId}Use it in a workflow
- Add a step and choose the SCAYLE Storefront connector.
- Pick the Get a variant action (under variants).
- Fill in the fields below, then reference the result from later steps as
{{getAVariant.response.data}}.
Request
Path parameters
variantIdintegerrequiredGet variant with specified `variantId`.
Query parameters
shopIdintegerThe numeric ID of the shop to resolve the request against. Every shop in a multi-shop setup has a unique `shopId`. **Priority:** `shopId` (or the `X-Shop-Id` header) takes precedence over all other shop identification parameters. When `shopId` is present, `shopKey`, `countryCode`, and `locale` are ignored entirely. **Alternative:** If neither `shopId` nor `X-Shop-Id` is provided, you must supply all three of `shopKey`, `countryCode`, and `locale` together to identify the shop.
shopKeystringThe unique string key identifying the shop (e.g. `sa`, `de`). **Must be provided together with `countryCode` and `locale`** as a query-parameter alternative to `shopId`. All three parameters are mandatory when using this identification method — omitting any one of them results in a validation error. Ignored when `shopId` or the `X-Shop-Id` header is present.
countryCodestringThe ISO 3166-1 alpha-2 country code of the shop (e.g. `DE`, `AT`). Automatically normalised to uppercase. **Must be provided together with `shopKey` and `locale`** as a query-parameter alternative to `shopId`. All three parameters are mandatory when using this identification method — omitting any one of them results in a validation error. Ignored when `shopId` or the `X-Shop-Id` header is present.
localestringThe locale of the shop (e.g. `en_GB`, `de_DE`). Used to validate that the resolved shop's locale matches the requested locale. **Must be provided together with `shopKey` and `countryCode`** as a query-parameter alternative to `shopId`. All three parameters are mandatory when using this identification method — omitting any one of them results in a validation error. Ignored when `shopId` or the `X-Shop-Id` header is present.
campaignKeystringAdjust prices based on the specified `campaignKey`. If provided campaign doesn't exist, the default price is returned. Please note, that campaign prices are stored in advance and available earlier than the campaign starts.
Default null
pricePromotionKeystringAdjust variant price based on the specified `pricePromotionKey`. If the variant does not have a matching price promotion, the default price is returned.
Default null
witharray<string>Include related variant resources, for example, the attributes of a variant can be included using `with=attributes` or `with=attributes:key(plusSize)`. Specific keys can be excluded instead of selected, e.g., `with=attributes:exclude(plusSize)`. Multiple includes are separated by commas `with=attributes,advancedAttributes,lowestPriorPrice`. with | includes ------------ | ------------- attributes | all attributes attributes:key(keyA\|...) | only attributes with specified keys attributes:exclude(keyA\|...) | all attributes except specified keys; combined with key(...)/type(...) the excluded keys are subtracted from the selection attributes:type(typeA\|...) | only attributes with specified types advancedAttributes | all advancedAttributes advancedAttributes:key(keyA\|...) | only advancedAttributes with specified keys advancedAttributes:exclude(keyA\|...) | all advancedAttributes except specified keys; combined with key(...)/type(...) the excluded keys are subtracted from the selection advancedAttributes:type(typeA\|...) | only advancedAttributes with specified types customData | include custom data of the variant. customData:key() | include custom data of the variant with empty object. customData:key(keyA\|...) | include custom data of the variant with only specified keys. lowestPriorPrice | include variant lowestPriorPrice price.customData | include custom data of the variant price. price.customData:key() | include custom data of the variant price with empty object. price.customData:key(keyA\|...) | include custom data of the variant price with only specified keys. merchant | include merchant information merchant.customData | include custom data of the variant merchant merchant.customData:key() | include custom data of the variant merchant with empty object merchant.customData:key(keyA\|...) | include custom data of the variant merchant with only specified keys relatedVariants | include the resolved components of a composite variant. Always an array once requested, even if the variant isn't composite. relatedVariants.attributes | include attributes of related-variant components relatedVariants.attributes:key(keyA\|...) | include only related-variant component attributes with specified keys relatedVariants.attributes:exclude(keyA\|...) | include all related-variant component attributes except specified keys; combined with key(...)/type(...) the excluded keys are subtracted from the selection relatedVariants.attributes:type(typeA\|...) | include only related-variant component attributes with specified types relatedVariants.advancedAttributes | include advanced attributes of related-variant components relatedVariants.advancedAttributes:key(keyA\|...) | include only related-variant component advanced attributes with specified keys relatedVariants.advancedAttributes:exclude(keyA\|...) | include all related-variant component advanced attributes except specified keys; combined with key(...)/type(...) the excluded keys are subtracted from the selection relatedVariants.advancedAttributes:type(typeA\|...) | include only related-variant component advanced attributes with specified types relatedVariants.lowestPriorPrice | include the lowest prior price of related-variant components relatedVariants.customData:key() | include custom data of related-variant components with empty object relatedVariants.customData:key(keyA\|...) | include custom data of related-variant components with only specified keys relatedVariants.price.customData | include custom data of related-variant component prices relatedVariants.price.customData:key() | include custom data of related-variant component prices with empty object relatedVariants.price.customData:key(keyA\|...) | include custom data of related-variant component prices with only specified keys
Default []
Headers
X-Shop-IdintegerThe numeric ID of the shop to resolve the request against. Every shop in a multi-shop setup has a unique shop ID. **Priority:** `X-Shop-Id` (or the `shopId` query parameter) takes precedence over all other shop identification parameters. When this header is present, `X-Shop-Key`, `X-Country-Code`, and `X-Locale` are ignored entirely. **Alternative:** If neither `X-Shop-Id` nor `shopId` is provided, you must supply all three of `X-Shop-Key`, `X-Country-Code`, and `X-Locale` together to identify the shop.
Default null
X-Shop-KeystringThe unique string key identifying the shop (e.g. `sa`, `de`). **Must be provided together with `X-Country-Code` and `X-Locale`** as a header-based alternative to `X-Shop-Id`. All three headers are mandatory when using this identification method — omitting any one of them results in a validation error. Ignored when `X-Shop-Id` or the `shopId` query parameter is present.
X-Country-CodestringThe ISO 3166-1 alpha-2 country code of the shop (e.g. `DE`, `AT`). Automatically normalised to uppercase. **Must be provided together with `X-Shop-Key` and `X-Locale`** as a header-based alternative to `X-Shop-Id`. All three headers are mandatory when using this identification method — omitting any one of them results in a validation error. Ignored when `X-Shop-Id` or the `shopId` query parameter is present.
X-LocalestringThe locale of the shop (e.g. `en_GB`, `de_DE`). Used to validate that the resolved shop's locale matches the requested locale. **Must be provided together with `X-Shop-Key` and `X-Country-Code`** as a header-based alternative to `X-Shop-Id`. All three headers are mandatory when using this identification method — omitting any one of them results in a validation error. Ignored when `X-Shop-Id` or the `shopId` query parameter is present.
Response
Returns 200 with a any. Read it in later steps with {{getAVariant.response.data.<field>}}.
Need more? See the SCAYLE Storefront guide for connection setup and behaviour shared by every action.