# Method: recommendations.generate

- [HTTP request](https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#body.PATH_PARAMETERS)
- [Query parameters](https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#body.QUERY_PARAMETERS)
- [Request body](https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#body.request_body)
- [Response body](https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#body.response_body)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#body.GenerateRecommendationsResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#body.aspect)
- [Recommendation](https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#Recommendation)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#Recommendation.SCHEMA_REPRESENTATION)
- [Description](https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#Description)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#Description.SCHEMA_REPRESENTATION)
- [DescriptionType](https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#DescriptionType)
- [CallToAction](https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#CallToAction)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#CallToAction.SCHEMA_REPRESENTATION)
- [Creative](https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#Creative)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#Creative.SCHEMA_REPRESENTATION)
- [CreativeType](https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#CreativeType)
- [Try it!](https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#try-it)

Generates recommendations for a merchant.

### HTTP request

`GET https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/recommendations/generate`

### Path parameters

| Parameters ||
|---|---|
| `merchantId` | `string (https://developers.google.com/discovery/v1/type-format format)` Required. The ID of the account to fetch recommendations for. |

### Query parameters

| Parameters ||
|---|---|
| `languageCode` | `string` Optional. Language code of the client. If not set, the result will be in default language (English). This language code affects all fields prefixed with "localized". This should be set to ISO 639-1 country code. List of currently verified supported language code: en, fr, cs, da, de, es, it, nl, no, pl, pt, pt, fi, sv, vi, tr, th, ko, zh-CN, zh-TW, ja, id, hi |
| `allowedTag[]` | `string` Optional. List of allowed tags. Tags are a set of predefined strings that describe the category that individual recommendation types belong to. User can specify zero or more tags in this field to indicate what categories of recommendations they want to receive. Current list of supported tags: - TREND |

### Request body

The request body must be empty.

### Response body

Response containing generated recommendations.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "recommendations": [ { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#Recommendation`) } ], "responseToken": string } ``` |

| Fields ||
|---|---|
| `recommendations[]` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#Recommendation`)`` Recommendations generated for a request. |
| `responseToken` | `string` Output only. Response token is a string created for each `GenerateRecommendationsResponse`. This token doesn't expire, and is globally unique. This token must be used when reporting interactions for recommendations. |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/content`

For more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2).

## Recommendation

Recommendations are suggested ways to improve your merchant account's performance. For example, to engage with a feature, or start using a new Google product.

| JSON representation |
|---|
| ``` { "type": string, "additionalDescriptions": [ { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#Description`) } ], "defaultCallToAction": { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#CallToAction`) }, "additionalCallToAction": [ { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#CallToAction`) } ], "creative": [ { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#Creative`) } ], "subType": string, "recommendationName": string, "title": string, "defaultDescription": string, "paid": boolean, "numericalImpact": integer } ``` |

| Fields ||
|---|---|
| `type` | `string` Output only. Type of the recommendation. List of currently available recommendation types: - OPPORTUNITY_CREATE_NEW_COLLECTION - OPPORTUNITY_CREATE_EMAIL_CAMPAIGN |
| `additionalDescriptions[]` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#Description`)`` Output only. List of additional localized descriptions for a recommendation. Localication uses the `languageCode` field in `recommendations.generate` requests. Not all description types are guaranteed to be present and we recommend to rely on default description. |
| `defaultCallToAction` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#CallToAction`)`` Optional. Default CTA of the recommendation. |
| `additionalCallToAction[]` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#CallToAction`)`` Output only. CTAs of this recommendation. Repeated. |
| `creative[]` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#Creative`)`` Output only. Any creatives attached to the recommendation. Repeated. |
| `subType` | `string` Optional. Subtype of the recommendations. Only applicable when multiple recommendations can be generated per type, and is used as an identifier of recommendation under the same recommendation type. |
| `recommendationName` | `string` Optional. Localized recommendation name. The localization uses the {@link `GenerateRecommendationsRequest.language_code`} field in {@link `GenerateRecommendationsRequest`} requests. |
| `title` | `string` Optional. Localized Recommendation Title. Localization uses the {@link `GenerateRecommendationsRequest.language_code`} field in {@link `GenerateRecommendationsRequest`} requests. |
| `defaultDescription` | `string` Optional. Localized recommendation description. The localization the {@link `GenerateRecommendationsRequest.language_code`} field in {@link `GenerateRecommendationsRequest`} requests. |
| `paid` | `boolean` Optional. Indicates whether a user needs to pay when they complete the user journey suggested by the recommendation. |
| `numericalImpact` | `integer` Optional. A numerical score of the impact from the recommendation's description. For example, a recommendation might suggest an upward trend in sales for a certain product. Higher number means larger impact. |

## Description

Google-provided description for the recommendation.

| JSON representation |
|---|
| ``` { "text": string, "type": enum (`https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#DescriptionType`) } ``` |

| Fields ||
|---|---|
| `text` | `string` Output only. Text of the description. |
| `type` | ``enum (`https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#DescriptionType`)`` Output only. Type of the description. |

## DescriptionType

Enum specifying type of the description.

| Enums ||
|---|---|
| `DESCRIPTION_TYPE_UNSPECIFIED` | Default value. Will never be provided by the API. |
| `SHORT` | Short description. |
| `LONG` | Long description. |

## CallToAction

Call to action (CTA) that explains how a merchant can implement this recommendation

| JSON representation |
|---|
| ``` { "localizedText": string, "intent": string, "uri": string } ``` |

| Fields ||
|---|---|
| `localizedText` | `string` Output only. Localized text of the CTA. Optional. |
| `intent` | `string` Output only. Intent of the action. This value describes the intent (for example, `OPEN_CREATE_EMAIL_CAMPAIGN_FLOW`) and can vary from recommendation to recommendation. This value can change over time for the same recommendation. Currently available intent values: - OPEN_CREATE_EMAIL_CAMPAIGN_FLOW: Opens a user journey where they can create a marketing email campaign. (No default URL) - OPEN_CREATE_COLLECTION_TAB: Opens a user journey where they can [create a collection](https://support.google.com/merchants/answer/9703228) for their Merchant account. (No default URL) |
| `uri` | `string` Optional. URL of the CTA. This field will only be set for some recommendations where there is a suggested landing URL. Otherwise it will be set to an empty string. We recommend developers to use their own custom landing page according to the description of the intent field above when this uri field is empty. |

## Creative

Creative is a multimedia attachment to recommendation that can be used on the frontend.

| JSON representation |
|---|
| ``` { "uri": string, "type": enum (`https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#CreativeType`) } ``` |

| Fields ||
|---|---|
| `uri` | `string` URL of the creative. |
| `type` | ``enum (`https://developers.google.com/shopping-content/reference/rest/v2.1/recommendations/generate#CreativeType`)`` Type of the creative. |

## CreativeType

Enum containing possible values of creative type.

| Enums ||
|---|---|
| `CREATIVE_TYPE_UNSPECIFIED` | Default value. If provided, shall be considered invalid. |
| `VIDEO` | Video creatives. |
| `PHOTO` | Photo creatives. |