Method: accounts.createAndConfigure

Creates a Merchant Center account with additional configuration. Adds the user that makes the request as an admin for the new account.

HTTP request

POST https://merchantapi.googleapis.com/accounts/v1/accounts:createAndConfigure

The URL uses gRPC Transcoding syntax.

Request body

The request body contains data with the following structure:

JSON representation
{
  "account": {
    object (Account)
  },
  "user": [
    {
      object (AddUser)
    }
  ],
  "service": [
    {
      object (AddAccountService)
    }
  ],
  "setAlias": [
    {
      object (SetAliasForRelationship)
    }
  ]
}
Fields
account

object (Account)

Required. The account to be created.

user[]

object (AddUser)

Optional. Users to be added to the account.

service[]

object (AddAccountService)

Required. An account service between the account to be created and the provider account is initialized as part of the creation. At least one such service needs to be provided. Currently exactly one of these needs to be accountAggregation and accounts.createAndConfigure method can be used to create a sub-account under an existing advanced account through this method. Additional accountManagement or product_management services may be provided.

setAlias[]

object (SetAliasForRelationship)

Optional. If a relationship is created with a provider, you can set an alias for it with this field. The calling user must be an admin on the provider to be able to set an alias.

Response body

If successful, the response body contains an instance of Account.

Authorization scopes

Requires the following OAuth scope:

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

For more information, see the OAuth 2.0 Overview.

AddUser

Instruction for adding a user to the account during creation.

JSON representation
{
  "userId": string,
  "user": {
    object (User)
  },
  "verificationMailSettings": {
    object (VerificationMailSettings)
  }
}
Fields
userId

string

Required. The email address of the user (for example, john.doe@gmail.com).

user

object (User)

Optional. Details about the user to be added. At the moment, only access rights may be specified.

verificationMailSettings

object (VerificationMailSettings)

Optional. Settings related to configuring the verification email that is sent after adding a user.

VerificationMailSettings

Settings related to the verification email that is sent after adding a user.

JSON representation
{
  "verificationMailMode": enum (VerificationMailMode)
}
Fields
verificationMailMode

enum (VerificationMailMode)

Optional. Mode of the verification mail. If not set, the default is SEND_VERIFICATION_MAIL.

VerificationMailMode

The different configuration options for sending a verification email when adding a user.

Enums
VERIFICATION_MAIL_MODE_UNSPECIFIED Default first member of every enum. Do not use.
SEND_VERIFICATION_MAIL An invitation email is sent to the user added shortly after.
SUPPRESS_VERIFICATION_MAIL No invitation email is sent. This can be useful if the user is expected to accept the invitation through the API without needing another notification.

AddAccountService

Additional instructions to add account services during creation of the account.

JSON representation
{
  "externalAccountId": string,

  // Union field service_type can be only one of the following:
  "accountAggregation": {
    object (AccountAggregation)
  },
  "accountManagement": {
    object (AccountManagement)
  },
  "comparisonShopping": {
    object (ComparisonShopping)
  },
  "productsManagement": {
    object (ProductsManagement)
  },
  "campaignsManagement": {
    object (CampaignsManagement)
  }
  // End of list of possible types for union field service_type.
  "provider": string
}
Fields
externalAccountId

string

Immutable. An optional, immutable identifier that Google uses to refer to this account when communicating with the provider. This should be the unique account ID within the provider's system (for example, your shop ID in Shopify).

If you have multiple accounts with the same provider - for instance, different accounts for various regions — the externalAccountId differentiates between them, ensuring accurate linking and integration between Google and the provider.

The external account ID must be specified for the campaigns management service type.

The external account ID must not be specified for the account aggregation service type.

The external account ID is optional / may be specified for all other service types.

Union field service_type. The service type to be added. service_type can be only one of the following:
accountAggregation

object (AccountAggregation)

The provider is an aggregator for the account. Payload for service type Account Aggregation.

accountManagement

object (AccountManagement)

The provider manages this account. Payload for service type Account Management.

comparisonShopping

object (ComparisonShopping)

The provider is a CSS (Comparison Shopping Service) of this account. Payload for service type Comparison Shopping.

productsManagement

object (ProductsManagement)

The provider manages products for this account. Payload for service type products management.

campaignsManagement

object (CampaignsManagement)

The provider manages campaigns for this account. Payload for service type campaigns management.

provider

string

Required. The provider of the service. Either the reference to an account such as providers/123 or a well-known service provider (one of providers/GOOGLE_ADS or providers/GOOGLE_BUSINESS_PROFILE).

SetAliasForRelationship

Set an alias for a relationship between a provider and the account to be created.

JSON representation
{
  "provider": string,
  "accountIdAlias": string
}
Fields
provider

string

Required. The provider of the service. This is a reference to an account such as providers/123 or accounts/123. The same provider must be specified in at least one of the service fields.

accountIdAlias

string

Required. The unique ID of this account in the provider's system. The value must be unique across all accounts on the platform for this provider.