younifyd
Menu

productRecommendations

Returns recommended products for a given product, identified by either ID or handle. Use the intent argument to control the recommendation strategy.

Use it in a workflow

  1. Add a step and choose the Shopify Storefront connector.
  2. Pick the productRecommendations action (under Product).
  3. Fill in the fields below, then reference the result from later steps as {{productrecommendations.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 ProductRecommendations($productId: ID, $productHandle: String, $intent: ProductRecommendationIntent) {
  productRecommendations(
    productId: $productId
    productHandle: $productHandle
    intent: $intent
  ) {
    availableForSale
    category {
      ancestors
      id
      name
    }
    compareAtPriceRange {
      maxVariantPrice {
        amount
        currencyCode
      }
      minVariantPrice {
        amount
        currencyCode
      }
    }
    createdAt
    descriptionHtml
    encodedVariantAvailability
    encodedVariantExistence
    featuredImage {
      altText
      height
      id
      originalSrc
      src
      thumbhash
      width
    }
    handle
    id
    isGiftCard
    onlineStoreUrl
    priceRange {
      maxVariantPrice {
        amount
        currencyCode
      }
      minVariantPrice {
        amount
        currencyCode
      }
    }
    productType
    publishedAt
    requiresSellingPlan
    seo {
      description
      title
    }
    tags
    title
    totalInventory
    trackingParameters
    updatedAt
    variantsCount {
      count
      precision
    }
    vendor
  }
}

Variables

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

productIdstring

The id of the product.

productHandlestring

The handle of the product.

intentstring

The recommendation intent that is used to generate product recommendations. You can use intent to generate product recommendations on various pages across the channels, according to different strategies.

One ofRELATEDCOMPLEMENTARY

json
{
  "productId": "string",
  "productHandle": "string",
  "intent": "RELATED"
}

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

Was this page helpful?