younifyd
Menu

Product Search

Search Products

GET/organizations/{organizationId}/product-search

Use it in a workflow

  1. Add a step and choose the Salesforce Commerce Cloud connector.
  2. Pick the Product Search action (under Shopper Search).
  3. Fill in the fields below, then reference the result from later steps as {{productSearch.response.data}}.

Request

Path parameters

organizationIdstringrequired

An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).

Query parameters

selectstring

The property selector declaring which fields are included in the product search response payload. For details, see [Property Selection.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/scapi-property-selection.html)

siteIdstringrequired

The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.

qstring

The query phrase to search for. For example to search for a product "shirt", type q=shirt. **Note:** - Lexical search queries are limited to a maximum of 50 characters.

refinestring

Parameter that represents a refinement attribute or values pair. Refinement attribute ID and values are separated by '='.<br> Multiple values are supported by a subset of refinement attributes and can be provided by separating them using a pipe (URL encoded = \"|\"), for example: refine=c_refinementColor=red|green|blue.<br> Value ranges can be specified like this: refine=price=(100..500).<br> Multiple refine parameters can be provided by using the refine as the key, for example: refine=price=(0..10)&refine=c_refinementColor=green.<br> The refinements can be a collection of custom defined attributes IDs and the system defined attributes IDs but the search can only accept a total of 9 refinements at a time.<br> The following system refinement attribute ids are supported:<br> `cgid`: Allows refinement per single category ID. Multiple category ids are not supported. `price`: Allows refinement per single price range. Multiple price ranges are not supported. `htype`: Allow refinement by including only the provided hit types. Accepted types are 'product', 'master', 'set', 'bundle', 'slicing_group' (deprecated), 'variation_group'.<br> `orderable_only`: Unavailable products are excluded from the search results if true is set. Multiple refinement values are not supported.<br> `ilids`: Allows refining by inventory list IDs. Supports up to 10 inventory list IDs per request.<br> `pmid`: Allows refinement on the supplied promotion ID(s). When used with `pmpt`, filters products by their role in the promotion.<br> `pmpt`: Allows refinement per promotion product type. Must be used with `pmid` to filter products by their role in the promotion. Valid values are: - `all`: Returns all products related to the promotion (default) - `qualifying`: Returns only products that qualify for the promotion but don't receive the discount/bonus - `discounted`: Returns only products that receive a discount in the promotion - `bonus`: Returns only products that are given as bonuses in the promotion **Note:** To refine a search using multiple promotion filters—for example, to find products in both the spring and summer campaigns—see [Refining by Multiple Promotions](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-promotions-for-developers.html#refining-by-multiple-promotions).

sortstring

The ID of the sorting option to sort the search hits.

currencystring

A three letter uppercase currency code conforming to the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, or the string `N/A` indicating that a currency is not applicable.

localeoneOf

A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.

expandarray<string>

A comma-separated list with allowed values - `availability`, `images`, `prices`, `represented_products`, `variations`, `promotions`, `custom_properties`. By default, the expand parameter includes `availability, images, prices, represented_products, variations`. Use none to disable all expand options.

allImagesboolean

When the `images` expand parameter is used with this flag, the response includes the `imageGroups` property, which contains an image model. If this flag is true, the full image model is returned and you can combine with `imgTypes` to filter image types and counts. If false, only matching images are included. If no flag is passed, the `imageGroups` property is omitted from the response.

imgTypesstring

Filters product images by type with optional count limits per type. This parameter requires both the `images` expand parameter and `allImages=true`. When used, the response includes the `imageGroups` property filtered by the specified image types. The format is a comma-separated list of image types with optional counts: `<imageType>:<count>,<imageType>:<count>`. If the count is omitted, all images of that type are returned. If specified, the count limits the number of images returned for that type. For example, `imgTypes=large:2,small:1` returns up to 2 large images and 1 small image per product in the imageGroups. If `imgTypes` is used without `allImages=true`, it is ignored and imageGroups aren't included in the response.

perPricebookboolean

When this flag is set to `true` and is used with the `prices` expand parameter, the response includes per PriceBook prices and tiered prices (if available).

allVariationPropertiesboolean

The flag that determines which variation properties are included in the result. When set to `true` with the `variations` expand parameter, all variation properties (`variationAttributes`, `variationGroups`, `variants`) are returned. When set to false, only the default property `variationAttributes` is returned.

includedCustomVariationPropertiesarray<string>

A comma-separated list of custom property ids to be returned for variant products. The `variants` expand parameter and `allVariationProperties` query parameter are required for these properties to be returned.

limitinteger (int32)

Number of records to retrieve per request. Must be between 1 (minimum) and 200 (maximum). Defaults to 25.

Default 25

offsetinteger (int32)

Used to retrieve the results based on a particular resource offset.

Default 0

Response

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

hitsarray<object>

A sorted array of search hits (`ProductSearchHit` objects). The array can be empty.

currencystring

A three letter uppercase currency code conforming to the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, or the string `N/A` indicating that a currency is not applicable.

hitTypestring

The type information for the search hit.

imageany

The first image of the product hit for the configured viewtype.

orderableboolean

A flag indicating whether the product is orderable.

pricenumber (double)

The sales price of the product. In complex products, like master or set, this is the minimum price of related child products.

priceMaxnumber (double)

The maximum sales of related child products in complex products like master or set.

productIdstringrequired

The ID (SKU) of the product.

productNamestring

The localized name of the product.

productTypeany

The type information for the product.

representedProductany

The first represented product.

representedProductsarray<object>1 fields

All the represented products.

variationAttributesarray<object>3 fields

The array of represented variation attributes, for the master product only. This array can be empty.

imageGroupsarray<object>3 fields

The array of product image groups.

priceRangesarray<object>3 fields

Array of one or more price range objects representing one or more Pricebooks in context for the site.

productPromotionsarray<object>3 fields

The array of active customer product promotions for this product. This array can be empty. Coupon promotions are not returned in this array.

tieredPricesarray<object>3 fields

The document represents list of tiered prices if the product is a variant

variantsarray<object>6 fields

The array of actual variants. Only for master, variation group, and variant types. This array can be empty.

variationGroupsarray<object>4 fields

The array of actual variation groups. Only for master, variation group, and variant types. This array can be empty.

pageMetaTagsarray<object>

Page Meta tags associated with the search result.

idstring

The ID of the Page Meta Tag.

valuestring

Locale-specific value of the Page Meta Tag, evaluated by resolving the rule set for the given Business Manager ID.

typestring

The kind of Page Meta Tag, indicating how the storefront should render the value. Documented values are `name`, `property`, `title`, and `jsonld`: * `name` — render as `<meta name="...">`. * `property` — render as `<meta property="...">` (e.g. Open Graph tags). * `title` — render as the HTML `<title>` element. * `jsonld` — JSON-LD structured data, intended for rendering inside `<script type="application/ld+json">`. The field may be absent when the kind cannot be determined. Clients should treat unknown values as opaque so additional kinds can be introduced without breaking the contract.

querystring

The query string that was searched for.

processedQueryany

The result of query processing.

refinementsarray<object>

The sorted array of search refinements. This array can be empty.

attributeIdstringrequired

The ID of the search refinement attribute. In the case of an attribute refinement, this is the attribute ID. Custom attributes are marked by the prefix "c_" (for example, "c_refinementColor"). In the case of a category refinement, the ID must be "cgid". In the case of a price refinement, the ID must be "price".

labelstring

The localized label of the refinement.

valuesarray<object>6 fields

The sorted array of refinement values. This array can be empty.

searchPhraseSuggestionsany

The suggestion given by the system for the submitted search phrase.

selectedRefinementsobject

A map of selected refinement attribute ID or value pairs. The sorting order is the same as in request URL.

selectedSortingOptionstring

The ID of the applied sorting option.

sortingOptionsarray<object>

The sorted array of search sorting options. This array can be empty.

idstringrequired

The ID of the sorting option.

labelstringrequired

The localized label of the sorting option.

json
{
  "hits": [
    {
      "productId": "74974310",
      "currency": "USD",
      "hitType": "product",
      "image": null,
      "orderable": true,
      "price": 135,
      "priceMax": 150,
      "productName": "Modern Dress Shirt",
      "productType": null,
      "representedProduct": null,
      "representedProducts": [
        {
          "id": "74974310"
        }
      ],
      "variationAttributes": [
        {
          "id": "size",
          "name": "size",
          "values": [
            {
              "value": null,
              "description": null,
              "image": null,
              "imageSwatch": null,
              "name": null,
              "orderable": null
            }
          ]
        }
      ]
    }
  ],
  "query": "dresses",
  "refinements": [
    {
      "attributeId": "refinementColor",
      "label": "Color",
      "values": [
        {
          "hitCount": 3,
          "label": "Beige",
          "value": "Beige",
          "description": "The Beige objects",
          "presentationId": "beige",
          "values": [
            {}
          ]
        }
      ]
    }
  ],
  "searchPhraseSuggestions": null,
  "sortingOptions": [
    {
      "id": "best-matches",
      "label": "Best Matches"
    }
  ],
  "pageMetaTags": [
    {
      "id": "title",
      "value": "Buy the Long Sleeve Covered Placket Blouse for USD 61.99.",
      "type": "name"
    }
  ],
  "processedQuery": null,
  "selectedRefinements": {},
  "selectedSortingOption": "best-matches"
}

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