younifyd
Menu

productVariantByIdentifier

Fetch a single product variant by its ID.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the productVariantByIdentifier action (under Product).
  3. Fill in the fields below, then reference the result from later steps as {{productvariantbyidentifier.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.

graphql
query ProductVariantByIdentifier($identifier: ProductVariantIdentifierInput!) {
  productVariantByIdentifier(identifier: $identifier) {
    availableForSale
    availablePublicationsCount {
      count
      precision
    }
    barcode
    compareAtPrice
    createdAt
    defaultCursor
    deliveryProfile {
      activeMethodDefinitionsCount
      coversAllItems
      default
      id
      locationsWithoutRatesCount
      name
      originLocationCount
      productVariantsCount {
        count
        precision
      }
      productVariantsCountV2 {
        capped
        count
      }
      unassignedLocations {
        activatable
        address
        addressVerified
        createdAt
        deactivatable
        deactivatedAt
        deletable
        fulfillmentService
        fulfillsOnlineOrders
        hasActiveInventory
        hasUnfulfilledOrders
        id
        isActive
        isFulfillmentService
        isPrimary
        legacyResourceId
        localPickupSettingsV2
        name
        shipsInventory
        suggestedAddresses
        updatedAt
      }
      version
      zoneCountryCount
    }
    displayName
    id
    inventoryItem {
      countryCodeOfOrigin
      createdAt
      duplicateSkuCount
      harmonizedSystemCode
      id
      inventoryHistoryUrl
      legacyResourceId
      locationsCount {
        count
        precision
      }
      measurement {
        id
        weight
      }
      provinceCodeOfOrigin
      requiresShipping
      sku
      tracked
      trackedEditable {
        locked
        reason
      }
      unitCost {
        amount
        currencyCode
      }
      updatedAt
      variant
    }
    inventoryPolicy
    inventoryQuantity
    legacyResourceId
    position
    price
    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
    }
    publishedOnCurrentChannel
    publishedOnCurrentPublication
    requiresComponents
    selectedOptions {
      name
      optionValue {
        hasVariants
        id
        linkedMetafieldValue
        name
        swatch
      }
      value
    }
    sellableOnlineQuantity
    sellingPlanGroupCount
    sellingPlanGroupsCount {
      count
      precision
    }
    showUnitPrice
    sku
    storefrontId
    taxCode
    taxable
    title
    unitPrice {
      amount
      currencyCode
    }
    unitPriceMeasurement {
      measuredType
      quantityUnit
      quantityValue
      referenceUnit
      referenceValue
    }
    updatedAt
  }
}

Variables

Pass these as a JSON object in the step's Variables field.

identifierobjectrequired

The identifier of the product variant.

idstring
customIdobject3 fields
json
{
  "identifier": {
    "id": "string",
    "customId": {
      "key": "string",
      "value": "string",
      "namespace": "string"
    }
  }
}

Response

Read the result with {{productvariantbyidentifier.response.data.data.productVariantByIdentifier}}. If the API returns errors, the step fails and they are at {{productvariantbyidentifier.response.data.errors}}.

availableForSaleboolean
availablePublicationsCountobject
countnumber
precisionstring

One ofEXACTAT_LEAST

barcodestring
compareAtPricestring
createdAtstring
defaultCursorstring
deliveryProfileobject
activeMethodDefinitionsCountnumber
coversAllItemsboolean
defaultboolean
idstring
locationsWithoutRatesCountnumber
namestring
originLocationCountnumber
productVariantsCountobject2 fields
productVariantsCountV2object2 fields
unassignedLocationsarray<object>
versionnumber
zoneCountryCountnumber
displayNamestring
idstring
inventoryItemobject
countryCodeOfOriginstring

One ofAFAXALDZADAOAIAGARAMAWACAUATAZBSBHBDBBBYBEBZBJBMBTBOBABWBVBRIOBNBGBFBIKHCACVBQKY

createdAtstring
duplicateSkuCountnumber
harmonizedSystemCodestring
idstring
inventoryHistoryUrlstring
legacyResourceIdstring
locationsCountobject2 fields
measurementobject2 fields
provinceCodeOfOriginstring
requiresShippingboolean
skustring
trackedboolean
trackedEditableobject2 fields
unitCostobject2 fields
updatedAtstring
variantobject

Recursive reference to ProductVariant, not further expanded.

inventoryPolicystring

One ofDENYCONTINUE

inventoryQuantitynumber
legacyResourceIdstring
positionnumber
pricestring
productobject
availablePublicationsCountobject2 fields
bodyHtmlstring
bundleConsolidatedOptionsarray<object>
categoryobject10 fields
combinedListingobject1 fields
combinedListingRolestring

One ofPARENTCHILD

compareAtPriceRangeobject2 fields
createdAtstring
customProductTypestring
defaultCursorstring
descriptionHtmlstring
descriptionPlainSummarystring
featuredImageobject7 fields
featuredMediaobject7 fields
feedbackobject3 fields
giftCardSettingsobject2 fields
giftCardTemplateSuffixstring
handlestring
hasOnlyDefaultVariantboolean
hasOutOfStockVariantsboolean
hasVariantsThatRequiresComponentsboolean
idstring
isGiftCardboolean
legacyResourceIdstring
mediaCountobject2 fields
onlineStorePreviewUrlstring
onlineStoreUrlstring
priceRangeobject2 fields
priceRangeV2object2 fields
productCategoryobject1 fields
productComponentsCountobject2 fields
productTypestring
publishedAtstring
publishedOnCurrentChannelboolean
publishedOnCurrentPublicationboolean
requiresSellingPlanboolean
resourcePublicationOnCurrentPublicationobject4 fields
sellingPlanGroupCountnumber
sellingPlanGroupsCountobject2 fields
seoobject2 fields
publishedOnCurrentChannelboolean
publishedOnCurrentPublicationboolean
requiresComponentsboolean
selectedOptionsarray<object>
nameobject
optionValueobject
valueobject
sellableOnlineQuantitynumber
sellingPlanGroupCountnumber
sellingPlanGroupsCountobject
countnumber
precisionstring

One ofEXACTAT_LEAST

showUnitPriceboolean
skustring
storefrontIdstring
taxCodestring
taxableboolean
titlestring
unitPriceobject
amountstring
currencyCodestring

One ofUSDEURGBPCADAFNALLDZDAOAARSAMDAWGAUDBBDAZNBDTBSDBHDBIFBYNBZDBMDBTNBAMBRLBOBBWPBNDBGNMMKKHRCVEKYDXAFCLPCNYCOPKMFCDFCRCHRK

unitPriceMeasurementobject
measuredTypestring

One ofVOLUMEWEIGHTLENGTHAREACOUNTUNKNOWN

quantityUnitstring

One ofMLCLLM3FLOZPTQTGALMGGKGOZLBMMCMMINFTYDM2FT2ITEMUNKNOWN

quantityValuenumber
referenceUnitstring

One ofMLCLLM3FLOZPTQTGALMGGKGOZLBMMCMMINFTYDM2FT2ITEMUNKNOWN

referenceValuenumber
updatedAtstring

Need more? See the Shopify guide for connection setup and behaviour shared by every action.