AI-generated Key Takeaways
- 
          Allows for retrieving, inserting, updating, and deleting multiple Merchant Center (sub-)accounts through a single POSTrequest to the specified endpoint.
- 
          The request body must contain an AccountsCustomBatchRequestobject specifying the desired operations on the accounts.
- 
          Each operation within the batch is represented by an AccountsCustomBatchRequestEntry, detailing the action, target account, and related data.
- 
          The response includes an AccountsCustomBatchResponsewith individualAccountsCustomBatchResponseEntryobjects for each operation, indicating success or errors encountered.
- 
          Proper authorization with the contentscope is required to use this functionality.
- HTTP request
- Request body
- Response body
- Authorization scopes
- AccountsCustomBatchRequest
- AccountsCustomBatchRequestEntry
- AccountsCustomBatchRequestEntryLinkRequest
- AccountsCustomBatchResponseEntry
- 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 AccountsCustomBatchRequest.
Response body
If successful, the response body contains data with the following structure:
| JSON representation | 
|---|
| {
  "entries": [
    {
      object ( | 
| Fields | |
|---|---|
| entries[] | 
 The result of the execution of the batch requests. | 
| kind | 
 Identifies what kind of resource this is. Value: the fixed string " | 
Authorization scopes
Requires one of the following OAuth scopes:
- https://www.googleapis.com/auth/content
For more information, see the OAuth 2.0 Overview.
AccountsCustomBatchRequest
| JSON representation | 
|---|
| {
  "entries": [
    {
      object ( | 
| Fields | |
|---|---|
| entries[] | 
 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 ( | 
| Fields | |
|---|---|
| batchId | 
 An entry ID, unique within the batch request. | 
| merchantId | 
 The ID of the managing account. | 
| method | 
 The method of the batch entry. Acceptable values are: 
 | 
| accountId | 
 The ID of the targeted account. Only defined if the method is not  | 
| account | 
 The account to create or update. Only defined if the method is  | 
| overwrite | 
 Only applicable if the method is  | 
| force | 
 Whether the account should be deleted if the account has offers. Only applicable if the method is  | 
| linkRequest | 
 Details about the  | 
| view | 
 Controls which fields are visible. Only applicable if the method is 'get'. | 
| labelIds[] | 
 Label IDs for the 'updatelabels' request. | 
AccountsCustomBatchRequestEntryLinkRequest
| JSON representation | 
|---|
| { "action": string, "linkedAccountId": string, "linkType": string, "services": [ string ] } | 
| Fields | |
|---|---|
| action | 
 Action to perform for this link. The  Acceptable values are: 
 | 
| linkedAccountId | 
 The ID of the linked account. | 
| linkType | 
 Type of the link between the two accounts. Acceptable values are: 
 | 
| services[] | 
 Provided services. Acceptable values are: 
 | 
AccountsCustomBatchResponseEntry
A batch entry encoding a single non-batch accounts response.
| JSON representation | 
|---|
| { "batchId": integer, "kind": string, "account": { object ( | 
| Fields | |
|---|---|
| batchId | 
 The ID of the request entry this entry responds to. | 
| kind | 
 Identifies what kind of resource this is. Value: the fixed string " | 
| account | 
 The retrieved, created, or updated account. Not defined if the method was  | 
| errors | 
 A list of errors for failed custombatch entries. |