# Method: accounts.custombatch

- [HTTP request](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/custombatch#body.HTTP_TEMPLATE)
- [Request body](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/custombatch#body.request_body)
- [Response body](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/custombatch#body.response_body)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/custombatch#body.AccountsCustomBatchResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/custombatch#body.aspect)
- [AccountsCustomBatchRequest](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/custombatch#AccountsCustomBatchRequest)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/custombatch#AccountsCustomBatchRequest.SCHEMA_REPRESENTATION)
- [AccountsCustomBatchRequestEntry](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/custombatch#AccountsCustomBatchRequestEntry)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/custombatch#AccountsCustomBatchRequestEntry.SCHEMA_REPRESENTATION)
- [AccountsCustomBatchRequestEntryLinkRequest](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/custombatch#AccountsCustomBatchRequestEntryLinkRequest)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/custombatch#AccountsCustomBatchRequestEntryLinkRequest.SCHEMA_REPRESENTATION)
- [AccountsCustomBatchResponseEntry](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/custombatch#AccountsCustomBatchResponseEntry)
  - [JSON representation](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/custombatch#AccountsCustomBatchResponseEntry.SCHEMA_REPRESENTATION)
- [Try it!](https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/custombatch#try-it)

Retrieves, inserts, updates, and deletes multiple Merchant Center (sub-)accounts in a single request.

### HTTP request

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

### Request body

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

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

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

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

## AccountsCustomBatchRequest

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

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

## AccountsCustomBatchRequestEntry

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

| JSON representation |
|---|
| ``` { "batchId": integer, "merchantId": string, "method": string, "accountId": string, "account": { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/accounts#Account`) }, "overwrite": boolean, "force": boolean, "linkRequest": { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/custombatch#AccountsCustomBatchRequestEntryLinkRequest`) }, "view": string, "labelIds": [ 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: - "`claimWebsite`" - "`delete`" - "`get`" - "`insert`" - "`link`" - "`update`" <br /> |
| `accountId` | `string` The ID of the targeted account. Only defined if the method is not `insert`. |
| `account` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/accounts#Account`)`` The account to create or update. Only defined if the method is `insert` or `update`. |
| `overwrite` | `boolean` Only applicable if the method is `claimwebsite`. Indicates whether or not to take the claim from another account in case there is a conflict. |
| `force` | `boolean` Whether the account should be deleted if the account has offers. Only applicable if the method is `delete`. |
| `linkRequest` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/accounts/custombatch#AccountsCustomBatchRequestEntryLinkRequest`)`` Details about the `link` request. |
| `view` | `string` Controls which fields are visible. Only applicable if the method is 'get'. |
| `labelIds[]` | `string` Label IDs for the 'updatelabels' request. |

## AccountsCustomBatchRequestEntryLinkRequest

| JSON representation |
|---|
| ``` { "action": string, "linkedAccountId": string, "linkType": string, "services": [ string ] } ``` |

| Fields ||
|---|---|
| `action` | `string` Action to perform for this link. The `"request"` action is only available to select merchants. Acceptable values are: - "`approve`" - "`remove`" - "`request`" <br /> |
| `linkedAccountId` | `string` The ID of the linked account. |
| `linkType` | `string` Type of the link between the two accounts. Acceptable values are: - "`channelPartner`" - "`eCommercePlatform`" - "`paymentServiceProvider`" - "`localProductManager`" <br /> |
| `services[]` | `string` Provided services. Acceptable values are: - "`shoppingAdsProductManagement`" - "`shoppingActionsProductManagement`" - "`shoppingActionsOrderManagement`" - "`paymentProcessing`" - "`localProductManagement`" <br /> |

## AccountsCustomBatchResponseEntry

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

| JSON representation |
|---|
| ``` { "batchId": integer, "kind": string, "account": { object (`https://developers.google.com/shopping-content/reference/rest/v2.1/accounts#Account`) }, "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#accountsCustomBatchResponseEntry`" |
| `account` | ``object (`https://developers.google.com/shopping-content/reference/rest/v2.1/accounts#Account`)`` The retrieved, created, or updated account. Not defined if the method was `delete`, `claimwebsite` or `link`. |
| `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 /> |