Using the Personalized Search API

Enhance site search and product discovery with real-time shopping intent and historical data. Powered by advanced machine learning and linguistics research, Monetate Personalized Search lets you create a custom search experience using our robust search APIs.

This article describes how to use the Personalized Search API.

Search API Overview

A search experience involves the following steps:

  1. Set up the search experience.
  2. Return auto-suggestion results as the user types into search.
  3. Return complete records as a query when the user executes a search.

Search Setup

Setting up the search experience involves the following steps:

  1. Obtain the search token. This token is for a configured search experience, and contains all the relevant information for your search experience. The token is returned by the decision request to the Engine API sent on page load, and is required for all search API calls. For optimal performance, use the most recent search token returned by the Engine API.
  2. Optionally, configure any redirects. If the search experience has any redirects defined, you must also make a search API call to configure these redirects. Redirects are predefined search terms that go to a specific page instead of returning a list of search results. Because redirects should not change often, you can cache the configuration and make this call less frequently to improve page load speed. The recommended caching interval is 12 to 24 hours.

Flowchart of a search API call. Shopper loads page, then an Engine API request is made that returns a search token. Optionally, a search API call for redirect configuration also happens.

Return Auto-Suggestions

Auto-suggestions return live results as the user types each character in their search term. Results are returned as a response to a search API call made after the user types a new character. This search type is "AUTO_SUGGESTIONS".

Diagram of auto-suggest search API calls. Every time the user types a new letter, a call occurs that returns updated results.

Execute Search Query

Finally, complete records are returned after the user executes a search. An executed search is referred to as a "query." The process for a query is as follows:

  1. Check for any applicable redirects and handle those as necessary.
  2. If no redirects are applicable, use a search API call with search type "SEARCH" to return these records.

Diagram of a query request. Possible redirects are checked first and used if applicable. Otherwise, a query request occurs.

Basic Search API Call and Response

The search API call is a POST call to the following endpoint:

https://engine.monetate.net/api/search/v1/site-search/{name}/{instance}/{domain}/{actionId}/search

A call to the search API is comprised of the following parts:

  • Request: The top-level object. This contains the search token and can include suggestions and queries.
  • Suggestions: Automatic suggestions based on the text currently typed into the search box. Suggestions are updated live as the user updates their search.
  • Queries: Complete results from a search. An individual result is called a record. Queries are returned after the user formally sends their search request. Requests can contain multiple queries.

Both suggestions and queries can be included in the call.

The basic search API request is as follows:

{
  "request": {
    "search_token": ...search token...,
    "suggestions": [
      {
        ... Suggestions query 1 ...
      },
      {
        ... Suggestions query 2 ...
      }
    ],
    "recordQueries":[
      {
        ... Record query 1 ...
      },
      {
        ... Record query 2 ...
      }
    ]
  }
}

The basic search API response is as follows:

{
  "meta": {
    ...
  },
  "suggestionResults": [
    {
      ... Result of suggestions query 1 ...
    },
    {
      ... Result of suggestions query 2 ...
    }
  ],
  "queryResults": [
    {
      ... Result of record query 1 ...
    },
    {
      ... Result of record query 2 ...
    }
  ],
}

Request and Response Example

The following is an example request:

{
    "search_token": "6.18.eJx9zMEKwjAMxvF3yXlI0mZp2lcREd2Km6CVVVAofXerBw-Cu32QX_4F4vMGgZxBZywqdXCZRwjQb8h414vx2mY7s1hVImHoIMfDMkz7c05XCAWOKeX7eyxxSMuYIWwLfCqOBMWwVd--HnE-Tc0RYu2-gL1xyNj_BYLOylqhAVRdLQh7JvsDdrXWFxW6RIc.gBybjd2bBAKaYWK-YtDumxOanhEReH_Si8o7a2UXkc0",
    "suggestions": [
        {
            "id": "mySuggestionsQuery1",
            "typeOfQuery": "AUTO_SUGGESTIONS",
            "query": "w",
            "limit": 2
        },
        {
            "id": "mySuggestionsQuery2",
            "typeOfQuery": "AUTO_SUGGESTIONS",
            "query": "whi",
            "limit": 3
        }
    ],
    "recordQueries": [
        {
            "id": "productSearch",
            "settings": {
                "query": {
                    "term": "jackets"
                },
                "limit": 5,
                "fields": [
                    "id",
                    "name"
                ],
                "typeOfRecords": [
                    "MONETATE_PRODUCT"
                ]
            }
        }
    ]
}

The following is the response to that example request:

{
    "meta": {
        "qTime": 10,
        "responseCode": 200
    },
    "suggestionResults": [
        {
            "id": "mySuggestionsQuery1",
            "suggestions": [
                {
                    "suggest": "women's"
                },
                {
                    "suggest": "wyoming"
                }
            ]
        },
        {
            "id": "mySuggestionsQuery2",
            "suggestions": []
        }
    ],
    "queryResults": [
        {
            "id": "productSearch",
            "meta": {
                "qTime": 6,
                "noOfResults": 5,
                "totalResultsFound": 2,
                "typeOfSearch": "AND",
                "offset": 0,
                "debuggingInformation": {},
                "notificationCode": 1,
                "searchedTerm": "jackets",
                "isPersonalised": false
            },
            "records": [
                {
                    "name": "Men's Moto Leather Jacket",
                    "id": "7160790917"
                },
                {
                    "name": "Women's Moto Leather Jacket",
                    "id": "7156840197"
                }
            ],
            "filters": []
        }
    ]
}

Response Parameters

Responses include the following parameters:

  • id: The ID of the record query for the returned results.
  • meta: An object that contains the following query-related parameters.
    • qTime: The time taken by Monetate to fetch the response.
    • noOfResults: The number of requested results returned for this query.
    • totalResultsFound: The total number of results for this query.
    • offset: The index of the first result returned in this response.
    • typeOfSearch: The type of query that Monetate executed to retrieve results.
  • records: The records matching the query. Each record is an object that contains the following parameters relating to the individual record.
    • id: The unique identifier of the record within Monetate.
    • itemGroupId: The identifier used to group compound products together. For example, if the record represents a configurable product, this will be the ID of the parent.
    • name: The product name.
    • url: The fully-qualified URL used to access the record in your store.
    • sku: The stock keeping unit of the record.
    • inStock: Whether the record is in stock.
    • price: The original price of the product before any discounts. You can use this as a "was" price in conjunction with salePrice.
    • salePrice: The actual selling price of your product.
    • startPrice: The salePrice of the lowest variant within all records indexed with the same itemGroupId. This can be used to display an "as low as" price.
    • toPrice: The salePrice of the highest variant within all records indexed within the same itemGroupId. This can be used if you want to show a price range.
    • currency: The currency code for the displayed price values.
    • category: A list of the most specific categories with values separated by double semicolons. This does not include their full category path. For example, if a record is in "Mens > Shoes" and "Mens > Tees", the value of this parameter would be "Shoes;;Tees".
    • shortDesc: The short description of the record.
    • rating: The rating of the product, between 0 and 5.
    • ratingCount: The number of ratings given by customers for the product.
    • image: The fully-qualified URL to the main image of the record.
    • imageHover: The sully-qualified URL to the secondary image of the record.
    • score: The score the record achieved, representing how relevant it is to the search. This parameter is used for sorting by relevance. To get this value in your response, you must either explicitly request it in the fields or set enableScores in Search Preferences.
    • tags: Any tags or keywords Monetate has saved for the record.
    • typeOfRecord: The record type. This is always "MONETATE_PRODUCT".
    • Other fields: Depending on the store, you might have various other fields returned depending on the data you have indexed.

Redirects

You might want some terms a user searches for to go to a specific page instead of returning a list of records. For example, if a user searches for "return policy" you want search to automatically go to your returns page. You can set up redirects in the Personalized Search UI to handle these cases.

Once set up, redirects can be retrieved and configured by the search API, allowing you to cache them. After making the Engine API decision request, configure redirects by making a GET call to the following endpoint:

https://engine.monetate.net/api/search/v1/site-search/{name}/{instance}/{domain}/{actionId}/url-redirects

The response to the above call looks like the following:

{
  "monetate_keywordUrlMap": {
    {
      "keywords": [
        "google"
      ],
      "url": "https://www.google.com"
    },
    {
      ... Additional redirects ...
    }
  ]
}

You can then check for these locally instead of making a search API call, improving performance for these terms.

Auto-Suggestion

Auto-suggestions return live results as the user types each character in their search term. Results are returned as a response to a search API call made after the user types a new character. This search type is "AUTO_SUGGESTION".

The recommended interval to wait between calls is 250 ms on key presses and 30 ms on focus.

An auto-suggestion API call looks like the following:

{
  "suggestions": [
    {
      "id": "mySuggestionsQuery1",
      "typeOfQuery": "AUTO_SUGGESTIONS",
      "query": "shirt",
      "limit": 2
    },
    {
      "id": "mySuggestionsQuery2",
      "typeOfQuery": "AUTO_SUGGESTIONS",
      "query": "short",
      "limit": 3,
      "hlStartElem": "<span style='color:red'>",
      "hlEndElem": "</span>"
    }
  ]
}

Parameters:

  • id: An identifier associated with a suggestion request. Every suggestion must have a unique ID.
  • typeOfQuery: The type of suggestion query. Use "AUTO_SUGGESTIONS" for this type.
  • query: The search term.
  • limit: The maximum number of suggestions to return.
  • hlStartElem: An HTML element applied to the start of the matched element in the auto-suggest results. You can use this to style the results to highlight the matching element. If you do not specify this parameter, a value of <b> is automatically applied.
  • hlEndElem: An HTML element applied to the end of the matched element in auto-suggest results. If you do not specify this parameter, a value of </b> is automatically applied.

The response to the the above call looks like the following:

{
  "meta": {
    "qTime": 24,
    "responseCode": 200
  },
  "suggestionResults": [
    {
      "id": "mySuggestionsQuery1",
      "suggestions": [
        {
          "suggest": "sweatshirt"
        },
        {
          "suggest": "street sweatshirt"
        }
      ]
    },
    {
      "id": "mySuggestionsQuery2",
      "suggestions": [
        {
          "suggest": "<span style='color:red'>short</span>"
        },
        {
          "suggest": "<span style='color:red'>short</span>s"
        },
        {
          "suggest": "<span style='color:red'>short</span>-sleeve"
        }
      ]
    }
  ]
}

Queries

Finally, complete records are returned after the user executes a search. An executed search is referred to as a "query." The process for a query is as follows:

  1. Check for any applicable redirects and handle those as necessary. 
  2. If no redirects are applicable, use a search API call with search type "SEARCH" to return these records.

A search query API call looks like the following:

{
  "recordQueries": [
    {
      "id": "productSearch",
      "typeOfRequest": "SEARCH",
      "settings": {
        "query": {
          "term": "short"
        },
        "limit": 5,
        "typeOfRecords": [
          "MONETATE_PRODUCT"
        ]
      }
    }
  ]
}

Parameters:

  • id: An identifier associated with a query request. Every query must have a unique ID.
  • typeOfRequest: The type of query. Use "SEARCH" for this type.
  • settings: Settings used for search results. You can include additional parameters here to further refine the query results.
  • query: The search term.
  • limit: The maximum number of results to return.
  • typeOfRecords: The type of results to return. Use "MONETATE_PRODUCT" for this parameter.

You can enhance your product recommendation algorithms by passing search terms back to Monetate. You can do this by using the Engine API event monetate:context:SearchView, or by including the Javascript method addSearch.

The response includes multiple records, representing the search results. Each record contains data related to a single product. The response to this call looks like the following:

{
  "meta": {
    "qTime": 7,
    "responseCode": 200
  },
  "queryResults": [
    {
      "id": "productSearch",
      "meta": {
        "qTime": 6,
        "noOfResults": 5,
        "totalResultsFound": 104,
        "typeOfSearch": "WILDCARD_AND",
        "offset": 0,
        "debuggingInformation": {},
        "notificationCode": 1,
        "searchedTerm": "short",
        "search_token": "monetate-156925593843210765",
        "isPersonalised": false
      },
      "records": [
        {
          "discount": "",
          "hideGroupPrices": "",
          "type": "Shorts",
          "itemGroupId": "4384016334910",
          "freeShipping": "",
          "storeBaseCurrency": "GBP",
          "price": "45.00",
          "toPrice": "",
          "imageUrl": "",
          "currency": "GBP",
          "inStock": "yes",
          "id": "31366431146046",
          "imageHover": "",
          "sku": "WSH12-28-Green",
          "brand": "KSD",
          "startPrice": "",
          "image": "",
          "deliveryInfo": "",
          "hideAddToCart": "",
          "salePrice": "45.0",
          "swatchesInfo": "",
          "weight": "",
          "monetate_category": "MONETATE_PRODUCT;Products;;Shorts  @ku@kuCategory@ku@",
          "totalVariants": 0,
          "groupPrices": "",
          "url": "",
          "tags": "body-hugging, Green, nylon, Running, Short",
          "size": "Small",
          "name": "Erika Running Short",
          "shortDesc": "A great short with a body-hugging design, the Erika Running Short is perfect for runners who prefer a fitted short rather than the traditional baggy variety. • Seafoam pattern running shorts. • Elastic waistband. • Snug fit. • 4''",
          "category": "Shorts",
          "typeOfRecord": "MONETATE_PRODUCT"
        },
        {
          ... Additional records ....
        }
      ],
      "filters": []
    }
  ]
}

Multiple Queries

You can request multiple auto-suggestions and queries in a single call. All configurations and preferences can be applied to each query separately.

Queries and auto-suggestions in a request are processed simultaneously, so the total time taken for the request to process is the duration of the slowest query. As such, you can improve performance by grouping related queries into a single request.

The following request is an example of grouping one auto-suggestion and two queries in a single request. This can be useful if you want to suggest products as your customer types while also attempting to predict the search term.

{
  "search_token": "6.18.eJx9zE0KAjEMhuG7ZF0k6U_S9ioiojPFGUErU0Gh9O5WFy4EZ_dBnrwV0vMGkUSTCRyYFFzmESK4DTF577xgn_1MRoSRrAYFJR2WYdqfS75CrHDMudzfY0lDXsYCcVvhUxFiZG2ND_3rkebT1B0hNvUFNmhBi-4vYBTDa4UO0PvVAttgyfyAXWvtBRdYRIc.MZ_0lmiO4ciOE47nc4qDWpTEAZ7ntVvI4CPIGtKzpYc",
  "suggestions": [
    {
      "id": "mySuggestionsQuery1",
      "typeOfQuery": "AUTO_SUGGESTIONS",
      "query": "shir",
      "limit": 2
    }
  ],
  "recordQueries": [
    {
      "id": "productSearch1",
      "settings": {
        "query": {
          "term": "shir"
        },
        "limit": 5,
        "fields": [
          "id",
          "name",
          "price"
        ],
        "typeOfRecords": [
          "MONETATE_PRODUCT"
        ]
      }
    },
    {
      "id": "productSearch2",
      "settings": {
        "query": {
          "term": "*"
        },
        "limit": 5,
        "fields": [
          "id",
          "name",
          "price"
        ],
        "typeOfRecords": [
          "MONETATE_PRODUCT"
        ]
      }
    }
  ]
}

Specifying Returned Fields

By default, returned query records include all fields. You can limit this to specific fields by specifying what you want returned in the settings of the call. Limiting returned fields improves response time and decreases response size. As such, you should limit returned fields to only those you intend to render. An example call:

{
  "recordQueries": [
    {
      "id": "productSearch",
      "typeOfRequest": "SEARCH",
      "settings": {
        "query": {
          "term": "short"
        },
        "limit": 5,
        "typeOfRecords": [
          "MONETATE_PRODUCT"
        ]
        "fields": {
          "id",
          "name",
          "price"
        }
      }
    }
  ]
}

The response to that call looks like the following:

{
  "queryResults": [
    {
      "id": "productSearch",
      "meta": {
        "qTime": 6,
        "noOfResults": 5,
        "totalResultsFound": 104,
        "typeOfSearch": "WILDCARD_AND",
        "offset": 0,
        "debuggingInformation": {},
        "notificationCode": 1,
        "searchedTerm": "short",
        "search_token": "monetate-156925593843210765",
        "isPersonalised": false
      },
      "records": [
        {
          "price": "45.00",
          "id": "31366431146046",
          "name": "Erika Running Short"
        }
      ]
    }
  ]
}

Set Up Pagination

A page of search results contains a number of records up to the limit specified in the settings of the call. Additional pages containing records beyond that limit can be created by repeating the query call with an offset specified.

{
  "recordQueries": [
    {
      "id": "productSearch",
      "typeOfRequest": "SEARCH",
      "settings": {
        "query": {
          "term": "short"
        },
        "limit": 5,
        "offset": 5,
        "typeOfRecords": [
          "MONETATE_PRODUCT"
        ]
      }
    }
  ]
}

The offset indicates how many records to skip over. In this example, the returned records are the sixth through tenth matches.

To properly paginate your results, repeat your search call while incrementing the offset in multiple values of the limit. For example, if your limit is 5, the offsets in the sequence of calls should be 0, 5, 10, 15, 20, and so on.

After the first page has been retrieved, you can improve performance and ensure consistency by retrieving the returned typeOfSearch value in the metadata and including it in subsequent requests for additional pages.

Fallback Queries

Fallback queries are an additional query included with the call that return records only when another query returns no results, and are ignored if the other query returns any results.

Setting a fallback query is the recommended practice because you avoid the case where a search results page is empty. With a fallback, you can instead display a preferred list of results, such as best selling products.

To set up a fallback query, include another query that includes another parameter isFallbackQuery set to true. Then in the original query, add the fallbackQueryId parameter to the settings and set it to the ID of the fallback query.

You can also use the fallbackWhenCountLessThan parameter to trigger a fallback query when there are greater than zero results, but fewer than you want to display. For example, if you specify a value of 3, the fallback query triggers when there are two results or fewer.

{
  "recordQueries": [
    {
      "id": "productSearch",
      "typeOfRequest": "SEARCH",
      "settings": {
        "query": {
          "term": "xyz"
        },
        "limit": 5,
        "fallbackQueryId": "productListFallback",
        "fallbackWhenCountLessThan": 3,
        "typeOfRecords": [
          "MONETATE_PRODUCT"
        ]
      }
    },
    {
      "id": "productListFallback",
      "typeOfRequest": "SEARCH",
      "isFallbackQuery": "true",
      "settings": {
        "query": {
          "term": "*"
        },
        "limit": 5,
        "typeOfRecords": [
          "MONETATE_PRODUCT"
        ]
      }
    }
  ]
}

In the above example, the fallback query uses a wildcard search to return records of all products. You can combine this with other functionality such as sorting to display a customized results page to take the place of an empty results page.

Sorting Results

By default, records are sorted by relevance to the search term. You can specify another order by setting the sort parameter in the settings.

{
  "recordQueries": [
    {
      "id": "productSearch",
      "typeOfRequest": "SEARCH",
      "settings": {
        "query": {
          "term": "short"
        },
        "limit": 5,
        "sort": "PRICE_ASC"
        "typeOfRecords": [
          "MONETATE_PRODUCT"
        ]
      }
    }
  ]
}

The options for sort order are:

  • RELEVANCE: The default sort order.
  • PRICE_ASC: Sort by price in ascending order.
  • PRICE_DESC: Sort by price in descending order.
  • NAME_ASC: Sort by name in alphabetical order.
  • NAME_DESC: Sort by name in reverse alphabetical order.
  • RATING_ASC: Sort by average rating in ascending order.
  • RATING_DESC: Sort by average rating in descending order.
  • NEW_ARRIVAL_ASC: Sort by record publish date in ascending order.
  • NEW_ARRIVAL_DESC: Sort by record publish date in descending order.

Facets

Facets are attribute categories for records that users can use to further filter results. For example, if a user searches for shirts, facets might include size, color, or material type. Within a search API call, you can both retrieve applicable facets to display to users and apply facets to filter results.

Retrieving facets is a computationally expensive operation that can slow down your search experience. For optimal performance, you should fetch filters or facets once per unique query and cache them locally. For instance, when using pagination to retrieve records from subsequent pages, you can skip fetching facets again because they remain consistent across pages. Monetate ensures that filters apply to the entire set of records for a given query.

Retrieving Facets

To retrieve facets, add the filters object to the parameters with filtersToReturn.enabled set to true.

{
  "recordQueries": [
    {
      "filters": {
        "filtersToReturn": {
          "enabled": true
        }
      }
      "id": "productSearch",
      "typeOfRequest": "SEARCH",
      "settings": {
        "query": {
          "term": "short"
        },
        "limit": 5,
        "typeOfRecords": [
          "MONETATE_PRODUCT"
        ]
      }
    }
  ]
}

The filtersToReturn object includes the following parameters you can set:

  • enabled: Whether to return facets with the query. The default is false.
  • include: The list of filter keys you want to retrieve as facets. Filters specified here might not be returned if there are not enough applicable records in the results.
  • exclude: The list of filter keys you do not want to retrieve. If a filter key is included in both include and exclude, the key is included.
  • options: An object specifying facet options included in the response.
    • order: How to order the sort options. A value of "FREQ" sorts options based on the number of records for each option in the results. A value of "INDEX" sorts the options alphabetically.
    • limit: The maximum number of options to include with each facet.
    • minCounts: The minimum record count for an option to be included in the results. For example, if this is set to 5, then any facet options with four or fewer records is excluded.
  • rangeFilterSettings: An object specifying settings for numerical range-based facets. By default, the only attribute you can use for this is the product sale price. If you want to use additional attributes for this parameter, contact Monetate to index these attributes as numerical.
    • key: The identifier for the attribute. This attribute must be numerical.
    • minMax: Whether to automatically calculate minimum and maximum values for a range slider.
    • rangeInterval: The range for each interval option to display. For example, if this is set to 100, the displayed options are 0 to 99, 100 to 199, and so on.

The response returns a list of filters:

{
  "filters": [
    {
      "key": "category",
      "label": "category",
      "type": "OPTIONS",
      "options": [
        {
          "count": 3,
          "name": "Capri",
          "value": "Capri",
          "selected": false
        },
        {
          ... Additional options ...
        }
      ]
    },
    {
      ... Additional facets ...
    }
  ]
}

You can use this list of facets to present further options to the user to filter their results.

Responses include the following parameters:

  • key: The unique identifier of the attribute for which options are provided.
  • label: The label or caption associated with the attribute in Monetate.
  • type: The type of filter. This can either be "SLIDER", "RATING", or "OPTIONS". Depending on the type, additional information is provided in the response.
    • For a slider filter, values such as min, max, start, and end are provided.
    • For a rating filter, ratings ranges are provided. Ranges are defined as follows:
      • A range of 4.51 to 5.5 is considered a 5 rating.
      • A range of 3.51 to 4.5 is considered a 4 rating.
      • A range of 2.51 to 3.5 is considered a 3 rating.
      • A range of 1.51 to 2.5 is considered a 2 rating.
      • A rating of 1.50 or less is considered a 1 rating.
    • For an options filter, the following options are provided:
      • name: The label or caption of the option
      • value: The unique identifier to use when applying a facet to search results
      • count: The number of records found with the current option in the search results.
      • selected: Whether the current option is already applied as a filtering condition in the search results.

Applying Facets

Applying facets to a query filters the results based off the selected facets and values. Run this query after a user selects the facets they want to filter by. You can apply facets in a query by using the applyFilters object.

{
  "recordQueries": [
    {
      "filters": {
        "applyFilters": {
          "filters": [
            {
              "key": "size",
              "values": [
                "Small",
                "Medium"
              ],
              "settings": {
                "singleSelect": false
              }
            }
          ]
        }
      },
      "id": "productSearch",
      "typeOfRequest": "SEARCH",
      "settings": {
        "query": {
          "term": "short"
        },
        "limit": 5,
        "typeOfRecords": [
          "MONETATE_PRODUCT"
        ]
      }
    }
  ]
}

Applying facets filters out any record where the facet attribute doesn't match the specified value. You can apply multiple facets to further filter results.

The applyFilters object includes the following parameters you can set:

  • key: The ID of the attribute to use as a filter.
  • values: An array of values to filter by. In most cases, this is an array of strings. For numerical range values, the method of filtering depends on how you specify the values:
    • To retrieve a range, specify the first value as a minimum and the second value as a maximum. For example, to retrieve records with prices between 60 and 80, this value should be [60, 80].
    • To retrieve steps of prices, specify the value ranges as a string. For example, to retrieve records with values between 0 to 50 and values between 150 to 200, this value should be ["0-50", "150-200"].
    • To retrieve exact values, specify the value a range consisting of the exact value. For example, to retrieve records with a value of 100, this value should be ["100-100"].

The singleSelect parameter in the settings object is used to determine the result when there are multiple values specified for a facet. When set to true, the records returned must contain all of the values. When set to false, the records returned must contain at least one of the values.

Multiple Currencies

If your store supports multiple currencies, you can use the priceFieldSuffix parameter to specify what currency to use for the returned price value. Use the currency that your customer is currently viewing for this parameter.

{
  "recordQueries": [
    {
      "id": "productSearch",
      "typeOfRequest": "SEARCH",
      "settings": {
        "priceFieldSuffix": "USD",
        "query": {
          "term": "short"
        },
        "fields": [
          "id",
          "name",
          "price",
          "salePrice",
          "currency",
          "storeCurrency"
        ],
        "limit": 5,
        "typeOfRecords": [
          "MONETATE_PRODUCT"
        ]
      }
    }
  ]
}

When specifying a different currency, the price, salePrice, and currency values in the response are modified to reflect the specified currency.

{
  "queryResults": [
    {
      "id": "productSearch",
      "meta": {
        "qTime": 6,
        "noOfResults": 5,
        "totalResultsFound": 104,
        "typeOfSearch": "WILDCARD_AND",
        "offset": 0,
        "debuggingInformation": {},
        "notificationCode": 1,
        "searchedTerm": "short",
        "search_token": "monetate-156925593843210765",
        "isPersonalised": false
      },
      "records": [
        {
		  "storeBaseCurrency": "GBP",
		  "salePrice": "45.00",
		  "price": "45.00",
		  "id": "31366431146046",
		  "name": "Erika Running Short",
		  "currency": "GBP"
        }
      ]
    }
  ]
}