younifyd
Menu

Typeahead v1

Typeahead v1

POST/v1/typeahead

Use it in a workflow

  1. Add a step and choose the SCAYLE Storefront connector.
  2. Pick the Typeahead v1 action (under search-v1).
  3. Fill in the fields below, then reference the result from later steps as {{typeaheadV1.response.data}}.

Request

Query parameters

termstringrequired

The `term` parameter specifies the search term.

fullAttributeValueboolean

Changes the values within the `attributeFilters` array to following format: `{"id": 1, "name": "black"}`

Default false

limitinteger

The `limit` parameter allows limiting the number of suggested products returned.

witharray<string>

The `with` parameter can be applied to include related resources, for example, the attributes of a product can be attached using `with=product.attributes`. It is also possible to filter product attributes by key `with=product.attributes:key(plusSize)`, by type `with=product.attributes:type(material_care)` or exclude specific keys `with=product.attributes:exclude(plusSize)`. Nested includes can also be attached when available `with=product.variants.attributes` and multiple combinations are likewise accepted `with=product.siblings,product.variants,category.children`. When using `with=category.children`, you can provide `categoryDepth` parameter to increase child depth. In the following table, there is more information about possible includes. Include | includes | Available Filters ------------ | ------------- | ------------- `category.parents` | | `category.children` | | `category.countryLevelCustomData` | | `key` `category.shopLevelCustomData` | | `key` `category.properties:name(property_name)` | | `product.attributes` | | `key`, `type`, `exclude` `product.advancedAttributes` | | `key`, `type`, `exclude` `product.images` (default) | `images.attributes` | `product.categories` | | `hidden(true)` `product.categories.countryLevelCustomData` | | `key` `product.categories.shopLevelCustomData` | | `key` `product.customData` | | `key` `product.definingAttributes` | | `product.siblings` | | `product.siblings.attributes` | | `key`, `type`, `exclude` `product.siblings.advancedAttributes` | | `key`, `type`, `exclude` `product.siblings.variants.attributes` | | `key`, `type`, `exclude` `product.siblings.variants.advancedAttributes` | | `key`, `type`, `exclude` `product.siblings.customData` | | `key `product.siblings.categories.countryLevelCustomData` | | `key` `product.siblings.categories.shopLevelCustomData` | | `key` `product.siblings.variants.customData` | | `key` `product.siblings.variants.price.customData` | Include custom data of sibling product variant prices. | `key` `product.siblings.priceRange.customData` | Include custom data of the sibling product price range. | `key` `product.siblings.reductionRange.customData` | Include custom data of the sibling product reduction range. | `key` `product.variants` | See available includes for variants at variants endpoint | `product.variants.customData` | | `key` `product.variants.price.customData` | Include custom data of product variant prices. | `key` `product.variants.merchant` | Include merchant data | `product.variants.merchant.customData` | Include custom data of the variant merchant | `key` `product.variants.merchant.customData:key()` | Include the merchant custom data as an empty object | `product.variants.merchant.customData:key(keyA\|...)` | Include the merchant custom data, filtered by the provided key(s) | `product.variants.relatedVariants` | Include the resolved components of a composite product variant. Always an array once requested, even if the variant isn't composite. | `product.variants.relatedVariants.attributes` | Include attributes of related-variant components | `key`, `type`, `exclude` `product.variants.relatedVariants.advancedAttributes` | Include advanced attributes of related-variant components | `key`, `type`, `exclude` `product.variants.relatedVariants.lowestPriorPrice` | Include the lowest prior price of related-variant components | `product.variants.relatedVariants.customData` | Include custom data of related-variant components | `key` `product.variants.relatedVariants.price.customData` | Include custom data of related-variant component prices | `key` `product.priceRange` | | `product.priceRange.customData` | Include custom data of the product price range. | `key` `product.reductionRange` | | `product.reductionRange.customData` | Include custom data of the product reduction range. | `key` `product.lowestPriorPrice` | | `product.searchCategoryIds` | | `product.baseCategories` (deprecated) | | `product.masterCategories` | |

categoryDepthinteger

Defines the number of nested child categories to include in the response.

categoryIdinteger

The categoryId parameter is used to filter the results and limit the returned data to items that belong to the specified category or its child categories.

Default null

Request body

Enter the body as JSON in the step's Body field.

fuzzinessinteger

The fuzziness parameter can enable some typo tolerance. Available values are 0, 1, 2, and auto. Defaults to auto. Note: The value set in the SCAYLE Panel will not impact this search.

One of012

categoryIdinteger

The `categoryId` parameter can filter by category ID.

limitinteger

The `limit` parameter allows limiting the number of suggested products returned.

termstring

The `term` parameter allows you to query for any entity with a full or partial match with the given term.

json
{
  "fuzziness": 0,
  "categoryId": 20201,
  "limit": 10,
  "term": "string"
}

Response

Returns 200 with an object. Read it in later steps with {{typeaheadV1.response.data.<field>}}.

suggestionsoneOf
topMatchobject
brandOrCategorySuggestionobject6 fields
scorenumber
typestring
json
{
  "suggestions": null,
  "topMatch": {
    "brandOrCategorySuggestion": {
      "attributeFilters": [
        {
          "id": 550,
          "name": "brand",
          "slug": "brand",
          "values": [
            53709
          ]
        }
      ],
      "brand": {
        "id": 53709,
        "name": "Nike Sportswear"
      },
      "category": {
        "id": 0,
        "name": "string",
        "slug": "string",
        "path": "string",
        "parentId": 0,
        "rootlineIds": [
          0
        ],
        "childrenIds": [
          0
        ],
        "properties": [
          {
            "name": "string",
            "value": "string"
          }
        ],
        "isHidden": false,
        "depth": 0,
        "supportedFilter": [
          "string"
        ],
        "shopLevelCustomData": {}
      },
      "primaryMatch": "brand",
      "productCount": 140,
      "suggestion": "Nike Sportswear"
    },
    "score": 66.48743,
    "type": "brandOrCategory"
  }
}

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

Was this page helpful?