# Method: accounts.generatedImages.generateProductImageBackground

- [HTTP request](https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/generateProductImageBackground#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/generateProductImageBackground#body.PATH_PARAMETERS)
- [Request body](https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/generateProductImageBackground#body.request_body)
  - [JSON representation](https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/generateProductImageBackground#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/generateProductImageBackground#body.response_body)
  - [JSON representation](https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/generateProductImageBackground#body.GenerateProductImageBackgroundResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/generateProductImageBackground#body.aspect)
- [GenerateImageBackgroundConfig](https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/generateProductImageBackground#GenerateImageBackgroundConfig)
  - [JSON representation](https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/generateProductImageBackground#GenerateImageBackgroundConfig.SCHEMA_REPRESENTATION)
- [Try it!](https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/generateProductImageBackground#try-it)

generatedImages.generateProductImageBackground generates a new image where the background of the original image is replaced by an AI generated scene based on provided product information and a text prompt.

### HTTP request

`POST https://merchantapi.googleapis.com/productstudio/v1alpha/{name=accounts/*}/generatedImages:generateProductImageBackground`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The account for which to generate an image. This acts as a container for the request and does not affect the generation itself. Format: accounts/{account} |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "outputConfig": { object (`https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/OutputImageConfig`) }, "inputImage": { object (`https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/InputImage`) }, "config": { object (`https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/generateProductImageBackground#GenerateImageBackgroundConfig`) } } ``` |

| Fields ||
|---|---|
| `outputConfig` | ``object (`https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/OutputImageConfig`)`` Optional. Configuration for how the output image should be returned. |
| `inputImage` | ``object (`https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/InputImage`)`` Required. The input image. |
| `config` | ``object (`https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/accounts.generatedImages/generateProductImageBackground#GenerateImageBackgroundConfig`)`` Required. Configuration parameters for the generation of the background. |

### Response body

Response message for the generatedImages.generateProductImageBackground method.

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

| JSON representation |
|---|
| ``` { "generatedImage": { object (`https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/GeneratedImage`) } } ``` |

| Fields ||
|---|---|
| `generatedImage` | ``object (`https://developers.google.com/merchant/api/reference/rest/productstudio_v1alpha/GeneratedImage`)`` The generated output image. |

### Authorization scopes

Requires the following OAuth scope:

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

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

## GenerateImageBackgroundConfig

Client provided input configuration for generating the background.

| JSON representation |
|---|
| ``` { "productDescription": string, "backgroundDescription": string } ``` |

| Fields ||
|---|---|
| `productDescription` | `string` Required. Example: "Hat on a baseball field" "Hat" = product description Description of product. |
| `backgroundDescription` | `string` Required. Example: "Hat on a baseball field" "on a baseball field" = background description Description of wanted background. |