---
schema_version: "1"
id: 015b01bfd0f93bdc365cd6ce5410f0e342a45127c4966ac7c09c846af7eaeb43
title: Shop Search Suggestion (deprecated)
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/b2c-commerce/references/generated-api-specs/ocapi-shop-search-suggestion.md
canonical_url: https://developer.salesforce.com/docs/commerce/b2c-commerce/references/ocapi-shop-search-suggestion
source_site: developer.salesforce.com
content_type: documentation
content_hash: db6313124339ca3af944a7221d9504e751c61da01f4bb6cdd0aadbc9ecba5b19
products:
  - B2C Commerce
  - Salesforce APIs
---
Shop Search Suggestion (deprecated)

# Shop Search Suggestion (deprecated)

The Shop API endpoints enable developers to build full shopper-experience applications such as storefronts. They are designed for high-scale usage, and include a number of areas such as Baskets & Orders, Customers, Products and Pricing. Shop API endpoints are typically read-only APIs, with the exception of baskets and orders.

**Version:** 25.6

## Servers

*   `https://{host}/s/{siteId}/dw/shop/v25_6`

Protocols: https.

## Security

*   `customers_auth` (basic) User authentication either for a registered or a guest customer (selectable in request body). Access via Base64 encoded customer:password string as 'Authorization: Basic' header.
*   `oauth2_application` (oauth2) Authentication flow with client ID and password with account manager.
    *   OAuth flow application (tokenUrl: https://account.demandware.com:443/dwsso/oauth2/access\_token)
    *   Scope x-info: Scopes are NOT supported. This is just a dummy, because the 'scopes' field is required.
*   `client_id` (apiKey) Add client ID for application identification. Alternative as 'client\_id' query parameter.
    *   API key in header: x-dw-client-id

## Operations

### GET Get search suggestions

`GET /search_suggestion`

Operation ID: `Get search suggestions`. Tags: search\_suggestion. Security: client\_id; customers\_auth.

Provides keyword search functionality for products, categories, content, brands and custom suggestions. Returns suggested products, suggested categories, suggested content, suggested brands and custom suggestions for the given search phrase.

#### Parameters

*   `q` (query, string, required) The query phrase to search for.  
    Minimum length: 3. Maximum length: 50.
*   `count` (query, integer (int32)) The maximum number of suggestions per request. Default value is 5. This affects all types of suggestions (category, product, content, brand, custom suggestions).  
    Minimum: 1. Maximum: 10.
*   `currency` (query, string) The currency mnemonic specified for price. This parameter is effective only for product suggestions.
*   `locale` (query, string)

#### Responses

*   **default**
    
    Media type: `application/json, text/xml`. Schema: `suggestion_result`.
    

## Schemas

### suggestion\_result

Document representing a search suggestion result.

*   `brand_suggestions` (_suggestion_) Returns the suggested brands.
*   `category_suggestions` (_suggestion_) Returns the suggested categories.
*   `content_suggestions` (_suggestion_) Returns the suggested content.
*   `custom_suggestions` (_suggestion_) Returns the suggested custom suggestions.
*   `product_suggestions` (_suggestion_) Returns the suggested products.
*   `query` (_string_) The query phrase to search for.

_Example_

```
{
  "brand_suggestions": {
    "brands": [
      "Sega"
    ],
    "suggested_phrases": [
      {
        "exact_match": false,
        "phrase": "Sega"
      }
    ],
    "suggested_terms": [
      {
        "original_term": "shi",
        "terms": [
          {
            "completed": false,
            "corrected": true,
            "exact_match": false,
            "value": "sega"
          }
        ]
      }
    ]
  },
  "category_suggestions": {
    "categories": [
      {
        "id": "mens-clothing-dress-shirts",
        "link": "http://example.com/dw/shop/{version}/categories/mens-clothing-dress-shirts?count=1&q=shi&currency=EUR",
        "name": "Dress Shirts",
        "parent_category_name": "Clothing"
      }
    ],
    "suggested_phrases": [
      {
        "exact_match": false,
        "phrase": "Dress Shirts"
      }
    ],
    "suggested_terms": [
      {
        "original_term": "shi",
        "terms": [
          {
            "completed": true,
            "corrected": false,
            "exact_match": false,
            "value": "shirts"
          }
        ]
      }
    ]
  },
  "content_suggestions": {
    "content": [
      {
        "id": "super-save-shipping",
        "link": "http://example.com/dw/shop/{version}/content/super-save-shipping?count=1&q=shi&currency=EUR",
        "name": "Super Saver Shipping"
      }
    ],
    "suggested_phrases": [
      {
        "exact_match": false,
        "phrase": "shipping"
      }
    ],
    "suggested_terms": [
      {
        "original_term": "shi",
        "terms": [
          {
            "completed": true,
            "corrected": false,
            "exact_match": false,
            "value": "shipping"
          }
        ]
      }
    ]
  },
  "custom_suggestions": {
    "custom_suggestions": [
      "Point and Shoot"
    ],
    "suggested_phrases": [
      {
        "exact_match": false,
        "phrase": "Point and Shoot"
      }
    ],
    "suggested_terms": [
      {
        "original_term": "shi",
        "terms": [
          {
            "completed": false,
            "corrected": true,
            "exact_match": false,
            "value": "shoot"
          },
          {
            "completed": false,
            "corrected": true,
            "exact_match": false,
            "value": "short"
          }
        ]
      }
    ]
  },
  "product_suggestions": {
    "products": [
      {
        "currency": "EUR",
        "link": "http://example.com/dw/shop/{version}/products/25591125?count=1&q=shi&currency=EUR",
        "price": 29.51,
        "product_id": "25591125",
        "product_name": "Striped Shirt"
      }
    ],
    "suggested_phrases": [
      {
        "exact_match": false,
        "phrase": "shirt"
      }
    ],
    "suggested_terms": [
      {
        "original_term": "shi",
        "terms": [
          {
            "completed": true,
            "corrected": false,
            "exact_match": false,
            "value": "shirt"
          },
          {
            "completed": true,
            "corrected": false,
            "exact_match": false,
            "value": "shirts"
          }
        ]
      }
    ]
  },
  "query": "shi"
}
```

### suggestion

Document representing a suggestion.

*   `brands` (_array of string_) The sorted list of suggested brands. This list can be empty.
*   `categories` (_array of suggested\_category_) The sorted list of suggested categories. This list can be empty.
*   `content` (_array of suggested\_content_) The sorted list of suggested content. This list can be empty.
*   `custom_suggestions` (_array of string_) The sorted list of suggested custom suggestions. This list can be empty.
*   `products` (_array of suggested\_product_) The sorted list of suggested products. This list can be empty.
*   `suggested_phrases` (_array of suggested\_phrase_) A list of suggested phrases. This list can be empty.
*   `suggested_terms` (_array of suggested\_terms_) A list of suggested terms. This list can be empty.

_Example_

```
{
  "categories": [
    {
      "id": "mens-clothing-dress-shirts",
      "link": "http://example.com/dw/shop/{version}/categories/mens-clothing-dress-shirts?count=1&q=shi&currency=EUR",
      "name": "Dress Shirts",
      "parent_category_name": "Clothing"
    }
  ],
  "suggested_phrases": [
    {
      "exact_match": false,
      "phrase": "Dress Shirts"
    }
  ],
  "suggested_terms": [
    {
      "original_term": "shi",
      "terms": [
        {
          "completed": true,
          "corrected": false,
          "exact_match": false,
          "value": "shirts"
        }
      ]
    }
  ]
}
```

### suggested\_category

*   `id` (_string_) The id of the category.
*   `link` (_string_) The URL addressing the category.
*   `name` (_string_) The localized name of the category.
*   `parent_category_name` (_string_) The name of the parent category.

### suggested\_content

*   `id` (_string_) The id of the content.
*   `link` (_string_) The URL addressing the content.
*   `name` (_string_) The localized name of the content.

### suggested\_product

Document representing a product search hit.

*   `currency` (_string_) The ISO 4217 mnemonic code of the currency.
*   `image` (_image_) The first image of the product hit for the configured viewtype.
*   `link` (_string_) The URL addressing the product.
*   `price` (_number (double)_) The sales price of the product. In the case of complex products like a master or a set, this is the minimum price of related child products.
*   `product_id` (_string_) The id (SKU) of the product.
*   `product_name` (_string_) The localized name of the product.

### suggested\_phrase

Document representing a suggested search phrase.

*   `exact_match` (_boolean_) Returns whether this suggested phrase exactly matches the user input search phrase.
*   `phrase` (_string_) Returns the suggested search phrase.

_Example_

```
{
  "exact_match": false,
  "phrase": "Sega"
}
```

### suggested\_terms

Document representing a list of suggested terms for each term of a search phrase.

*   `original_term` (_string_) Returns the original term that the suggested terms relates to.
*   `terms` (_array of suggested\_term_) Returns the suggested terms.

_Example_

```
{
  "original_term": "shi",
  "terms": [
    {
      "completed": false,
      "corrected": true,
      "exact_match": false,
      "value": "sega"
    }
  ]
}
```

### image

Document representing a product image.

*   `alt` (_string_) The localized alternative text of the image.
*   `dis_base_link` (_string_) Base URL for dynamic image service address. This is only shown, if the image is stored on the server and DIS is enabled.
*   `link` (_string_, required) The URL of the actual image.  
    Minimum length: 1.
*   `title` (_string_) The localized title of the image.

_Example_

```
{
  "alt": "ALT main swatch",
  "link": "https://example.com/foo/bar/main_swatch.jpg",
  "title": "TITLE main swatch"
}
```

### suggested\_term

Document representing a suggested term.

*   `completed` (_boolean_) Returns whether this term value is a completion match.
*   `corrected` (_boolean_) Returns whether this term value is a correction match.
*   `exact_match` (_boolean_) Returns whether this term value is a exact match.
*   `value` (_string_) Returns the term value.

_Example_

```
{
  "completed": false,
  "corrected": true,
  "exact_match": false,
  "value": "sega"
}
```

### cause

*   `cause` (_cause_)
*   `message` (_string_)
*   `type` (_string_)

### fault

Document representing a fault message that is returned whenever the HTTP status code is greater than or equal to 400 (which indicates an error).

*   `arguments` (_object_)
    
    A map that provides fault arguments.
    
    Data can be used to provide error messages on the client side.
    
    Additional properties: `object`.
    
*   `cause` (_cause_)
*   `display_message_pattern` (_string_) The localized display message pattern, if the request parameter display\_locale was given
*   `message` (_string_) The message text of the java exception.
*   `stack_trace` (_string_)
*   `type` (_string_) The name of the java exception.