younifyd
Menu

productDuplicate

Duplicates a product. If you need to duplicate a large product, such as one that has many variants that are active at several locations, you might encounter timeout errors.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the productDuplicate action (under Product).
  3. Fill in the fields below, then reference the result from later steps as {{productduplicate.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 ProductDuplicate($productId: ID!, $newTitle: String!, $newStatus: ProductStatus, $includeImages: Boolean, $includeTranslations: Boolean, $synchronous: Boolean) {
  productDuplicate(
    productId: $productId
    newTitle: $newTitle
    newStatus: $newStatus
    includeImages: $includeImages
    includeTranslations: $includeTranslations
    synchronous: $synchronous
  ) {
    imageJob {
      done
      id
      query {
        appDiscountTypes
        availableBackupRegions
        availableCarrierServices
        availableLocales
        backupRegion
        businessEntities
        catalogOperations
        collectionConditionMetafieldDefinitions
        collectionRulesConditions
        consentPolicyRegions
        currentAppInstallation
        currentStaffMember
        deliveryPromiseSettings
        financeAppAccessPolicy
        financeKycInformation
        fulfillmentConstraintRules
        giftCardConfiguration
        inventoryProperties
        locationsAvailableForDeliveryProfiles
        metafieldDefinitionTypes
        onlineStore
        pendingOrdersCount
        primaryMarket
        privacySettings
        publicApiVersions
        serverPixel
        shop
        shopBillingPreferences
        shopifyPaymentsAccount
        storeCreditConfiguration
        taxonomy
      }
    }
    newProduct {
      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
    }
    productDuplicateOperation {
      id
      newProduct {
        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
      }
      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 {
        field
        message
      }
    }
    shop {
      accountOwner {
        accountType
        active
        email
        exists
        firstName
        id
        initials
        isShopOwner
        lastName
        locale
        name
        phone
        privateData
      }
      alerts {
        action
        description
      }
      allProductCategories {
        productTaxonomyNode
      }
      allProductCategoriesList {
        ancestorIds
        childrenIds
        fullName
        id
        isArchived
        isLeaf
        isRoot
        level
        name
        parentId
      }
      analyticsToken
      billingAddress {
        address1
        address2
        city
        company
        coordinatesValidated
        country
        countryCode
        countryCodeV2
        firstName
        formattedArea
        id
        lastName
        latitude
        longitude
        name
        phone
        province
        provinceCode
        zip
      }
      channelDefinitionsForInstalledChannels {
        channelDefinitions
        channelName
      }
      checkoutApiSupported
      contactEmail
      countriesInShippingZones {
        countryCodes
        includeRestOfWorld
      }
      createdAt
      currencyCode
      currencyFormats {
        moneyFormat
        moneyInEmailsFormat
        moneyWithCurrencyFormat
        moneyWithCurrencyInEmailsFormat
      }
      customerAccounts
      customerAccountsV2 {
        customerAccountsVersion
        loginLinksVisibleOnStorefrontAndCheckout
        loginRequiredAtCheckout
        url
      }
      description
      domains {
        host
        id
        localization
        marketWebPresence
        sslEnabled
        url
      }
      email
      enabledPresentmentCurrencies
      entitlements {
        b2b
        markets
      }
      features {
        avalaraAvatax
        branding
        bundles
        buyerExperienceDepositEnabled
        captcha
        captchaExternalDomains
        cartTransform
        deliveryProfiles
        directConnectionCatalogAssignmentEnabled
        dynamicRemarketing
        eligibleForSubscriptionMigration
        eligibleForSubscriptions
        giftCards
        harmonizedSystemCode
        internationalDomains
        internationalPriceOverrides
        internationalPriceRules
        legacySubscriptionGatewayEnabled
        liveView
        marketDrivenShipping
        onboardingVisual
        paypalExpressSubscriptionGatewayStatus
        reports
        sellsSubscriptions
        shopifyPlus
        showMetrics
        storefront
        subCountryMarketsEnabled
        unifiedMarkets
        usingShopifyBalance
      }
      fulfillmentServices {
        callbackUrl
        fulfillmentOrdersOptIn
        handle
        id
        inventoryManagement
        location
        requiresShippingMethod
        serviceName
        trackingSupport
        type
      }
      ianaTimezone
      id
      limitedPendingOrderCount {
        atMax
        count
      }
      marketingSmsConsentEnabledAtCheckout
      merchantApprovalSignals {
        identityVerified
        verifiedByShopify
        verifiedByShopifyTier
      }
      myshopifyDomain
      name
      navigationSettings {
        id
        title
        url
      }
      orderNumberFormatPrefix
      orderNumberFormatSuffix
      paymentSettings {
        supportedDigitalWallets
      }
      plan {
        displayName
        partnerDevelopment
        publicDisplayName
        shopifyPlus
      }
      primaryDomain {
        host
        id
        localization
        marketWebPresence
        sslEnabled
        url
      }
      publicationCount
      resourceLimits {
        locationLimit
        maxProductOptions
        maxProductVariants
        redirectLimitReached
      }
      richTextEditorUrl
      searchFilters {
        productAvailability
      }
      setupRequired
      shipsToCountries
      shopAddress {
        address1
        address2
        city
        company
        coordinatesValidated
        country
        countryCode
        countryCodeV2
        firstName
        formattedArea
        id
        lastName
        latitude
        longitude
        name
        phone
        province
        provinceCode
        zip
      }
      shopOwnerName
      shopPolicies {
        body
        createdAt
        id
        title
        type
        updatedAt
        url
      }
      storefrontUrl
      taxShipping
      taxesIncluded
      timezoneAbbreviation
      timezoneOffset
      timezoneOffsetMinutes
      transactionalSmsDisabled
      unitSystem
      updatedAt
      url
      weightUnit
    }
    userErrors {
      field
      message
    }
  }
}

Variables

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

productIdstringrequired

The ID of the product to be duplicated.

newTitlestringrequired

The new title of the product.

newStatusstring

The new status of the product. If no value is provided the status will be inherited from the original product.

One ofACTIVEARCHIVEDDRAFTUNLISTED

includeImagesboolean

Specifies whether or not to duplicate images.

includeTranslationsboolean

Specifies whether or not to duplicate translations.

synchronousboolean

Specifies whether or not to run the mutation synchronously.

json
{
  "productId": "string",
  "newTitle": "string",
  "newStatus": "ACTIVE",
  "includeImages": false,
  "includeTranslations": false,
  "synchronous": false
}

Response

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

imageJobobject
doneboolean
idstring
queryobject31 fields
newProductobject
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
productDuplicateOperationobject
idstring
newProductobject40 fields
productobject40 fields
statusstring

One ofCREATEDACTIVECOMPLETE

userErrorsarray<object>
shopobject
accountOwnerobject13 fields
alertsarray<object>
allProductCategoriesarray<object>
allProductCategoriesListarray<object>
analyticsTokenstring
billingAddressobject19 fields
channelDefinitionsForInstalledChannelsarray<object>
checkoutApiSupportedboolean
contactEmailstring
countriesInShippingZonesobject2 fields
createdAtstring
currencyCodestring

One ofUSDEURGBPCADAFNALLDZDAOAARSAMDAWGAUDBBDAZNBDTBSDBHDBIFBYNBZDBMDBTNBAMBRLBOBBWPBNDBGNMMKKHRCVEKYDXAFCLPCNYCOPKMFCDFCRCHRK

currencyFormatsobject4 fields
customerAccountsstring

One ofREQUIREDOPTIONALDISABLED

customerAccountsV2object4 fields
descriptionstring
domainsarray<object>
emailstring
enabledPresentmentCurrenciesarray<object>
entitlementsobject2 fields
featuresobject30 fields
fulfillmentServicesarray<object>
ianaTimezonestring
idstring
limitedPendingOrderCountobject2 fields
marketingSmsConsentEnabledAtCheckoutboolean
merchantApprovalSignalsobject3 fields
myshopifyDomainstring
namestring
navigationSettingsarray<object>
orderNumberFormatPrefixstring
orderNumberFormatSuffixstring
paymentSettingsobject1 fields
planobject4 fields
primaryDomainobject6 fields
publicationCountnumber
resourceLimitsobject4 fields
richTextEditorUrlstring
searchFiltersobject1 fields
setupRequiredboolean
userErrorsarray<object>
fieldobject
messageobject

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