# Method: products.custombatch

- [HTTP request](https://developers.google.com/shopping-content/reference/rest/v2.1/products/custombatch#body.HTTP_TEMPLATE)
- [Request body](https://developers.google.com/shopping-content/reference/rest/v2.1/products/custombatch#body.request_body)
- [Response body](https://developers.google.com/shopping-content/reference/rest/v2.1/products/custombatch#body.response_body)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/products/custombatch#body.ProductsCustomBatchResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://developers.google.com/shopping-content/reference/rest/v2.1/products/custombatch#body.aspect)
- [ProductsCustomBatchRequest](https://developers.google.com/shopping-content/reference/rest/v2.1/products/custombatch#ProductsCustomBatchRequest)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/products/custombatch#ProductsCustomBatchRequest.SCHEMA_REPRESENTATION)
- [ProductsCustomBatchRequestEntry](https://developers.google.com/shopping-content/reference/rest/v2.1/products/custombatch#ProductsCustomBatchRequestEntry)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/products/custombatch#ProductsCustomBatchRequestEntry.SCHEMA_REPRESENTATION)
- [ProductsCustomBatchResponseEntry](https://developers.google.com/shopping-content/reference/rest/v2.1/products/custombatch#ProductsCustomBatchResponseEntry)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/products/custombatch#ProductsCustomBatchResponseEntry.SCHEMA_REPRESENTATION)
- [Try it!](https://developers.google.com/shopping-content/reference/rest/v2.1/products/custombatch#try-it)

Retrieves, inserts, and deletes multiple products in a single request.

### HTTP request

`POST https://shoppingcontent.googleapis.com/content/v2.1/products/batch`

### Request body

The request body contains an instance of `https://developers.google.com/shopping-content/reference/rest/v2.1/products/custombatch#ProductsCustomBatchRequest`.

### Response body

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

| JSON representation |
|---|
| ``` { "entries": [ { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/products/custombatch#ProductsCustomBatchResponseEntry`) } ], "kind": string } ``` |

| Fields ||
|---|---|
| `entries[]` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/products/custombatch#ProductsCustomBatchResponseEntry`)`` The result of the execution of the batch requests. |
| `kind` | `string` Identifies what kind of resource this is. Value: the fixed string "`content#productsCustomBatchResponse`". |

### 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).

## ProductsCustomBatchRequest

| JSON representation |
|---|
| ``` { "entries": [ { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/products/custombatch#ProductsCustomBatchRequestEntry`) } ] } ``` |

| Fields ||
|---|---|
| `entries[]` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/products/custombatch#ProductsCustomBatchRequestEntry`)`` The request entries to be processed in the batch. |

## ProductsCustomBatchRequestEntry

A batch entry encoding a single non-batch products request.

| JSON representation |
|---|
| ``` { "batchId": integer, "merchantId": string, "method": string, "productId": string, "product": { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/products#Product`) }, "feedId": string, "updateMask": string } ``` |

| Fields ||
|---|---|
| `batchId` | `integer (https://developers.google.com/discovery/v1/type-format format)` An entry ID, unique within the batch request. |
| `merchantId` | `string` The ID of the managing account. |
| `method` | `string` The method of the batch entry. Acceptable values are: - "`delete`" - "`get`" - "`insert`" - "`update`" <br /> |
| `productId` | `string` The ID of the product to get or mutate. Only defined if the method is `get`, `delete`, or `update`. |
| `product` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/products#Product`)`` The product to insert or update. Only required if the method is `insert` or `update`. If the `update` method is used with `updateMask` only to delete a field, then this isn't required. For example, setting `salePrice` on the `updateMask` and not providing a `product` will result in an existing sale price on the product specified by `productId` being deleted. |
| `feedId` | `string` The Content API Supplemental Feed ID. If present then product insertion or deletion applies to a supplemental feed instead of primary Content API feed. |
| `updateMask` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#field-mask` format)`` The comma-separated list of product attributes to be updated. Example: `"title,salePrice"`. Attributes specified in the update mask without a value specified in the body will be deleted from the product. *You must specify the update mask to delete attributes.* Only top-level product attributes can be updated. If not defined, product attributes with set values will be updated and other attributes will stay unchanged. Only defined if the method is `update`. |

## ProductsCustomBatchResponseEntry

A batch entry encoding a single non-batch products response.

| JSON representation |
|---|
| ``` { "batchId": integer, "kind": string, "product": { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/products#Product`) }, "errors": { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/Errors`) } } ``` |

| Fields ||
|---|---|
| `batchId` | `integer (https://developers.google.com/discovery/v1/type-format format)` The ID of the request entry this entry responds to. |
| `kind` | `string` Identifies what kind of resource this is. Value: the fixed string "`content#productsCustomBatchResponseEntry`" |
| `product` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/products#Product`)`` The inserted product. Only defined if the method is `insert` and if the request was successful. |
| `errors` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/Errors`)`` A list of errors for failed custombatch entries. > [!NOTE] > **Note:** Schema errors fail the whole request. <br /> |