# Method: datafeeds.custombatch

- [HTTP request](https://developers.google.com/shopping-content/reference/rest/v2.1/datafeeds/custombatch#body.HTTP_TEMPLATE)
- [Request body](https://developers.google.com/shopping-content/reference/rest/v2.1/datafeeds/custombatch#body.request_body)
- [Response body](https://developers.google.com/shopping-content/reference/rest/v2.1/datafeeds/custombatch#body.response_body)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/datafeeds/custombatch#body.DatafeedsCustomBatchResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://developers.google.com/shopping-content/reference/rest/v2.1/datafeeds/custombatch#body.aspect)
- [DatafeedsCustomBatchRequest](https://developers.google.com/shopping-content/reference/rest/v2.1/datafeeds/custombatch#DatafeedsCustomBatchRequest)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/datafeeds/custombatch#DatafeedsCustomBatchRequest.SCHEMA_REPRESENTATION)
- [DatafeedsCustomBatchRequestEntry](https://developers.google.com/shopping-content/reference/rest/v2.1/datafeeds/custombatch#DatafeedsCustomBatchRequestEntry)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/datafeeds/custombatch#DatafeedsCustomBatchRequestEntry.SCHEMA_REPRESENTATION)
- [DatafeedsCustomBatchResponseEntry](https://developers.google.com/shopping-content/reference/rest/v2.1/datafeeds/custombatch#DatafeedsCustomBatchResponseEntry)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/datafeeds/custombatch#DatafeedsCustomBatchResponseEntry.SCHEMA_REPRESENTATION)
- [Try it!](https://developers.google.com/shopping-content/reference/rest/v2.1/datafeeds/custombatch#try-it)

Deletes, fetches, gets, inserts and updates multiple datafeeds in a single request.

### HTTP request

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

### Request body

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

### 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/datafeeds/custombatch#DatafeedsCustomBatchResponseEntry`) } ], "kind": string } ``` |

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

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

## DatafeedsCustomBatchRequest

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

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

## DatafeedsCustomBatchRequestEntry

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

| JSON representation |
|---|
| ``` { "batchId": integer, "merchantId": string, "method": string, "datafeedId": string, "datafeed": { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/datafeeds#Datafeed`) } } ``` |

| 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`" - "`fetchNow`" - "`get`" - "`insert`" - "`update`" <br /> |
| `datafeedId` | `string` The ID of the data feed to get, delete or fetch. |
| `datafeed` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/datafeeds#Datafeed`)`` The data feed to insert. |

## DatafeedsCustomBatchResponseEntry

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

| JSON representation |
|---|
| ``` { "batchId": integer, "datafeed": { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/datafeeds#Datafeed`) }, "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. |
| `datafeed` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/datafeeds#Datafeed`)`` The requested data feed. Defined if and only 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 /> |