Menu
productVariantsBulkUpdate
Updates multiple product variants for a single product in one operation. You can run this mutation directly or as part of a bulk operation for large-scale catalog updates.
Use it in a workflow
- Add a step and choose the Shopify connector.
- Pick the productVariantsBulkUpdate action (under Product).
- Fill in the fields below, then reference the result from later steps as
{{productvariantsbulkupdate.response.data}}.
Query
This is the mutation the action sends by default. Edit it in the step's Query field to change which fields come back.
mutation ProductVariantsBulkUpdate($variants: [ProductVariantsBulkInput!]!, $productId: ID!, $media: [CreateMediaInput!], $allowPartialUpdates: Boolean) {
productVariantsBulkUpdate(
variants: $variants
productId: $productId
media: $media
allowPartialUpdates: $allowPartialUpdates
) {
product {
availablePublicationsCount {
count
precision
}
bodyHtml
bundleConsolidatedOptions {
name
selections
}
category {
ancestorIds
childrenIds
fullName
id
isArchived
isLeaf
isRoot
level
name
parentId
}
combinedListing {
parentProduct
}
combinedListingRole
compareAtPriceRange {
maxVariantCompareAtPrice
minVariantCompareAtPrice
}
createdAt
customProductType
defaultCursor
descriptionHtml
descriptionPlainSummary
featuredImage {
altText
height
id
originalSrc
src
thumbhash
width
}
featuredMedia {
alt
id
mediaContentType
mediaErrors
mediaWarnings
preview
status
}
feedback {
appFeedback
details
summary
}
giftCardSettings {
crossCurrencyRedeemable
issuanceCurrency
}
giftCardTemplateSuffix
handle
hasOnlyDefaultVariant
hasOutOfStockVariants
hasVariantsThatRequiresComponents
id
isGiftCard
legacyResourceId
mediaCount {
count
precision
}
onlineStorePreviewUrl
onlineStoreUrl
priceRange {
maxVariantPrice
minVariantPrice
}
priceRangeV2 {
maxVariantPrice
minVariantPrice
}
productCategory {
productTaxonomyNode
}
productComponentsCount {
count
precision
}
productType
publishedAt
publishedOnCurrentChannel
publishedOnCurrentPublication
requiresSellingPlan
resourcePublicationOnCurrentPublication {
isPublished
publication
publishDate
publishable
}
sellingPlanGroupCount
sellingPlanGroupsCount {
count
precision
}
seo {
description
title
}
standardizedProductType {
productTaxonomyNode
}
status
storefrontId
tags
templateSuffix
title
totalInventory
totalVariants
tracksInventory
updatedAt
variantsCount {
count
precision
}
vendor
}
productVariants {
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
}
userErrors {
code
field
message
}
}
}
Variables
Pass these as a JSON object in the step's Variables field.
{
"variants": [
{
"barcode": "string",
"compareAtPrice": "string",
"id": "string",
"mediaSrc": [
"string"
],
"inventoryPolicy": "DENY",
"inventoryQuantities": [
"string"
],
"quantityAdjustments": [
"string"
],
"inventoryItem": {
"sku": "string",
"cost": "string",
"tracked": "string",
"countryCodeOfOrigin": "string",
"harmonizedSystemCode": "string",
"countryHarmonizedSystemCodes": "string",
"provinceCodeOfOrigin": "string",
"measurement": "string",
"requiresShipping": "string"
},
"mediaId": "string",
"metafields": [
"string"
],
"optionValues": [
"string"
],
"price": "string"
}
],
"productId": "string",
"media": [
{
"originalSource": "string",
"mediaContentType": "VIDEO",
"alt": "string"
}
],
"allowPartialUpdates": false
}
Response
Read the result with {{productvariantsbulkupdate.response.data.data.productVariantsBulkUpdate}}. If the API returns errors, the step fails and they are at {{productvariantsbulkupdate.response.data.errors}}.
Need more? See the Shopify guide for connection setup and behaviour shared by every action.
Was this page helpful?