Accounts: custombatch

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

Request

HTTP request

POST https://www.googleapis.com/content/v2/accounts/batch

Parameters

Parameter name Value Description
Optional query parameters
dryRun boolean Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).

Authorization

This request requires authorization with the following scope:

Scope
https://www.googleapis.com/auth/content

For more information, see the authentication and authorization page.

Request body

In the request body, supply data with the following structure:

{
  "entries": [
    {
      "batchId": unsigned integer,
      "merchantId": unsigned long,
      "method": string,
      "accountId": unsigned long,
      "account": accounts Resource,
      "overwrite": boolean,
      "force": boolean,
      "linkRequest": {
        "linkedAccountId": string,
        "linkType": string,
        "action": string
      }
    }
  ]
}
Property name Value Description Notes
entries[] list The request entries to be processed in the batch.
entries[].batchId unsigned integer An entry ID, unique within the batch request.
entries[].merchantId unsigned long The ID of the managing account.
entries[].method string

Acceptable values are:
  • "claimWebsite"
  • "delete"
  • "get"
  • "insert"
  • "link"
  • "update"
entries[].accountId unsigned long The ID of the targeted account. Only defined if the method is not insert.
entries[].account nested object The account to create or update. Only defined if the method is insert or update.
entries[].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.
entries[].force boolean Whether the account should be deleted if the account has offers. Only applicable if the method is delete.
entries[].linkRequest nested object Details about the link request.
entries[].linkRequest.linkedAccountId string The ID of the linked account.
entries[].linkRequest.linkType string Type of the link between the two accounts.

Acceptable values are:
  • "channelPartner"
  • "eCommercePlatform"
entries[].linkRequest.action string Action to perform for this link. The "request" action is only available to select merchants.

Acceptable values are:
  • "approve"
  • "remove"
  • "request"

Response

If successful, this method returns a response body with the following structure:

{
  "kind": "content#accountsCustomBatchResponse",
  "entries": [
    {
      "kind": "content#accountsCustomBatchResponseEntry",
      "batchId": unsigned integer,
      "account": accounts Resource,
      "linkStatus": string,
      "errors": {
        "errors": [
          {
            "domain": string,
            "reason": string,
            "message": string
          }
        ],
        "code": unsigned integer,
        "message": string
      }
    }
  ]
}
Property name Value Description Notes
kind string Identifies what kind of resource this is. Value: the fixed string "content#accountsCustomBatchResponse".
entries[] list The result of the execution of the batch requests.
entries[].kind string Identifies what kind of resource this is. Value: the fixed string "content#accountsCustomBatchResponseEntry".
entries[].batchId unsigned integer The ID of the request entry this entry responds to.
entries[].account nested object The retrieved, created, or updated account. Not defined if the method was delete, claimwebsite or link.
entries[].errors nested object A list of errors defined if and only if the request failed.
entries[].errors.errors[] list A list of errors.
entries[].errors.errors[].domain string The domain of the error.
entries[].errors.errors[].reason string The error code.
entries[].errors.errors[].message string A description of the error.
entries[].errors.code unsigned integer The HTTP status of the first error in errors.
entries[].errors.message string The message of the first error in errors.
entries[].linkStatus string Deprecated. This field is never set.

Acceptable values are:
  • "active"
  • "inactive"
  • "pending"

Try it!

Use the APIs Explorer below to call this method on live data and see the response.