Menu
productVariants
Retrieves a list of product variants associated with a product. A product variant is a specific version of a product that comes in more than one option, such as size or color.
Use it in a workflow
- Add a step and choose the Shopify connector.
- Pick the productVariants action (under Product).
- Fill in the fields below, then reference the result from later steps as
{{productvariants.response.data}}.
Query
This is the query the action sends by default. Edit it in the step's Query field to change which fields come back.
query ProductVariants($first: Int, $after: String, $last: Int, $before: String, $reverse: Boolean, $sortKey: ProductVariantSortKeys, $query: String, $savedSearchId: ID) {
productVariants(
first: $first
after: $after
last: $last
before: $before
reverse: $reverse
sortKey: $sortKey
query: $query
savedSearchId: $savedSearchId
) {
edges {
cursor
node {
availableForSale
availablePublicationsCount
barcode
compareAtPrice
createdAt
defaultCursor
deliveryProfile
displayName
id
inventoryItem
inventoryPolicy
inventoryQuantity
legacyResourceId
position
price
product
publishedOnCurrentChannel
publishedOnCurrentPublication
requiresComponents
selectedOptions
sellableOnlineQuantity
sellingPlanGroupCount
sellingPlanGroupsCount
showUnitPrice
sku
storefrontId
taxCode
taxable
title
unitPrice
unitPriceMeasurement
updatedAt
}
}
nodes {
availableForSale
availablePublicationsCount {
count
precision
}
barcode
compareAtPrice
createdAt
defaultCursor
deliveryProfile {
activeMethodDefinitionsCount
coversAllItems
default
id
locationsWithoutRatesCount
name
originLocationCount
productVariantsCount
productVariantsCountV2
unassignedLocations
version
zoneCountryCount
}
displayName
id
inventoryItem {
countryCodeOfOrigin
createdAt
duplicateSkuCount
harmonizedSystemCode
id
inventoryHistoryUrl
legacyResourceId
locationsCount
measurement
provinceCodeOfOrigin
requiresShipping
sku
tracked
trackedEditable
unitCost
updatedAt
variant
}
inventoryPolicy
inventoryQuantity
legacyResourceId
position
price
product {
availablePublicationsCount
bodyHtml
bundleConsolidatedOptions
category
combinedListing
combinedListingRole
compareAtPriceRange
createdAt
customProductType
defaultCursor
descriptionHtml
descriptionPlainSummary
featuredImage
featuredMedia
feedback
giftCardSettings
giftCardTemplateSuffix
handle
hasOnlyDefaultVariant
hasOutOfStockVariants
hasVariantsThatRequiresComponents
id
isGiftCard
legacyResourceId
mediaCount
onlineStorePreviewUrl
onlineStoreUrl
priceRange
priceRangeV2
productCategory
productComponentsCount
productType
publishedAt
publishedOnCurrentChannel
publishedOnCurrentPublication
requiresSellingPlan
resourcePublicationOnCurrentPublication
sellingPlanGroupCount
sellingPlanGroupsCount
seo
standardizedProductType
status
storefrontId
tags
templateSuffix
title
totalInventory
totalVariants
tracksInventory
updatedAt
variantsCount
vendor
}
publishedOnCurrentChannel
publishedOnCurrentPublication
requiresComponents
selectedOptions {
name
optionValue
value
}
sellableOnlineQuantity
sellingPlanGroupCount
sellingPlanGroupsCount {
count
precision
}
showUnitPrice
sku
storefrontId
taxCode
taxable
title
unitPrice {
amount
currencyCode
}
unitPriceMeasurement {
measuredType
quantityUnit
quantityValue
referenceUnit
referenceValue
}
updatedAt
}
pageInfo {
endCursor
hasNextPage
hasPreviousPage
startCursor
}
}
}
Variables
Pass these as a JSON object in the step's Variables field.
{
"first": 0,
"after": "string",
"last": 0,
"before": "string",
"reverse": false,
"sortKey": "FULL_TITLE",
"query": "string",
"savedSearchId": "string"
}
Response
Read the result with {{productvariants.response.data.data.productVariants}}. If the API returns errors, the step fails and they are at {{productvariants.response.data.errors}}.
Need more? See the Shopify guide for connection setup and behaviour shared by every action.
Was this page helpful?