younifyd
Menu

productSet

Declaratively create or update a product and its options, variants, and media in a single call — the state you pass becomes the product's state.

Use it in a workflow

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

graphql
mutation ProductSet($input: ProductSetInput!, $synchronous: Boolean, $identifier: ProductSetIdentifiers) {
  productSet(input: $input, synchronous: $synchronous, identifier: $identifier) {
    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
    }
    productSetOperation {
      id
      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
      }
      status
      userErrors {
        code
        field
        message
      }
    }
    userErrors {
      code
      field
      message
    }
  }
}

Variables

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

inputobjectrequired

The properties of the newly created or updated product.

descriptionHtmlstring
handlestring
seoobject2 fields
productTypestring
tagsarray<string>
templateSuffixstring
giftCardTemplateSuffixstring
titlestring
vendorstring
categorystring
giftCardboolean
redirectNewHandleboolean
statusstring

One ofACTIVEARCHIVEDDRAFTUNLISTED

collectionsarray<string>
metafieldsarray<object>5 fields
filesarray<object>6 fields
productOptionsarray<object>5 fields
idstring
variantsarray<object>18 fields
requiresSellingPlanboolean
claimOwnershipobject1 fields
combinedListingRolestring

One ofPARENTCHILD

synchronousboolean

Whether the mutation should be run synchronously or asynchronously. If `true`, the mutation will return the updated `product`. If `false`, the mutation will return a `productSetOperation`. Defaults to `true`. Setting `synchronous: false` may be desirable depending on the input complexity/size, and should be used if you are experiencing timeouts. **Note**: When run in the context of a [bulk operation](https://shopify.dev/api/usage/bulk-operations/imports), the mutation will always run synchronously and this argument will be ignored.

identifierobject

Specifies the identifier that will be used to lookup the resource.

idstring
handlestring
customIdobject3 fields
json
{
  "input": {
    "descriptionHtml": "string",
    "handle": "string",
    "seo": {
      "title": "string",
      "description": "string"
    },
    "productType": "string",
    "tags": [
      "string"
    ],
    "templateSuffix": "string",
    "giftCardTemplateSuffix": "string",
    "title": "string",
    "vendor": "string",
    "category": "string",
    "giftCard": false,
    "redirectNewHandle": false
  },
  "synchronous": false,
  "identifier": {
    "id": "string",
    "handle": "string",
    "customId": {
      "key": "string",
      "value": "string",
      "namespace": "string"
    }
  }
}

Response

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

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
productSetOperationobject
idstring
productobject40 fields
statusstring

One ofCREATEDACTIVECOMPLETE

userErrorsarray<object>
userErrorsarray<object>
codeobject
fieldobject
messageobject

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