Edit

Share via


AddAccount Service Operation - Customer Management

Creates a new account within an existing customer.

A user with Super Admin credentials can add accounts under their own customer.

Tip

Resellers typically should call SignupCustomer instead of AddAccount. For more details see the Account Hierarchy technical guide.

Note

Customers in the closed Unified smart campaigns pilot can add a new account for Unified smart campaigns. The AccountMode must be set to "UnifiedSmart".

Request Elements

The AddAccountRequest object defines the body and header elements of the service operation request. The elements must be in the same order as shown in the Request SOAP.

Note

Unless otherwise noted below, all request elements are required.

Request Body Elements

Element Description Data Type
Account The account that you want to add to the existing customer.

You must set the ParentCustomerId in the advertiser account object.
AdvertiserAccount

Request Header Elements

Element Description Data Type
AuthenticationToken The OAuth access token that represents the credentials of a user who has permissions to Microsoft Advertising accounts.

For more information see Authentication with OAuth.
string
DeveloperToken The developer token used to access the Bing Ads API.

For more information see Get a Developer Token.
string
Password This element is reserved for internal use and will be removed from a future version of the API. You must use the AuthenticationToken element to set user credentials. string
UserName This element is reserved for internal use and will be removed from a future version of the API. You must use the AuthenticationToken element to set user credentials. string

Response Elements

The AddAccountResponse object defines the body and header elements of the service operation response. The elements are returned in the same order as shown in the Response SOAP.

Response Body Elements

Element Description Data Type
AccountId A system-generated account identifier corresponding to the new account specified in the request.

Use this identifier with operation requests that require an AccountId body element and a CustomerAccountId SOAP header element.
long
AccountNumber The system-generated account number that is used to identify the account in the Microsoft Advertising web application.

The account number has the form xxxxxxxx, where xxxxxxxx is a series of any eight alphanumeric characters.
string
CreateTime The date and time that the account was added. The date and time value reflects the date and time at the server, not the client. For information about the format of the date and time, see the dateTime entry in Primitive XML Data Types. dateTime

Response Header Elements

Element Description Data Type
TrackingId The identifier of the log entry that contains the details of the API call. string

Request SOAP

This template was generated by a tool to show the order of the body and header elements for the SOAP request. For supported types that you can use with this service operation, see the Request Body Elements reference above.

<s:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header xmlns="https://bingads.microsoft.com/Customer/v13">
    <Action mustUnderstand="1">AddAccount</Action>
    <AuthenticationToken i:nil="false">ValueHere</AuthenticationToken>
    <DeveloperToken i:nil="false">ValueHere</DeveloperToken>
  </s:Header>
  <s:Body>
    <AddAccountRequest xmlns="https://bingads.microsoft.com/Customer/v13">
      <Account xmlns:e457="https://bingads.microsoft.com/Customer/v13/Entities" i:nil="false">
        <e457:BillToCustomerId i:nil="false">ValueHere</e457:BillToCustomerId>
        <e457:CurrencyCode i:nil="false">ValueHere</e457:CurrencyCode>
        <e457:AccountFinancialStatus i:nil="false">ValueHere</e457:AccountFinancialStatus>
        <e457:Id i:nil="false">ValueHere</e457:Id>
        <e457:Language i:nil="false">ValueHere</e457:Language>
        <e457:LastModifiedByUserId i:nil="false">ValueHere</e457:LastModifiedByUserId>
        <e457:LastModifiedTime i:nil="false">ValueHere</e457:LastModifiedTime>
        <e457:Name i:nil="false">ValueHere</e457:Name>
        <e457:Number i:nil="false">ValueHere</e457:Number>
        <e457:ParentCustomerId>ValueHere</e457:ParentCustomerId>
        <e457:PaymentMethodId i:nil="false">ValueHere</e457:PaymentMethodId>
        <e457:PaymentMethodType i:nil="false">ValueHere</e457:PaymentMethodType>
        <e457:PrimaryUserId i:nil="false">ValueHere</e457:PrimaryUserId>
        <e457:AccountLifeCycleStatus i:nil="false">ValueHere</e457:AccountLifeCycleStatus>
        <e457:TimeStamp i:nil="false">ValueHere</e457:TimeStamp>
        <e457:TimeZone i:nil="false">ValueHere</e457:TimeZone>
        <e457:PauseReason i:nil="false">ValueHere</e457:PauseReason>
        <e457:ForwardCompatibilityMap xmlns:e458="http://schemas.datacontract.org/2004/07/System.Collections.Generic" i:nil="false">
          <e458:KeyValuePairOfstringstring>
            <e458:key i:nil="false">ValueHere</e458:key>
            <e458:value i:nil="false">ValueHere</e458:value>
          </e458:KeyValuePairOfstringstring>
        </e457:ForwardCompatibilityMap>
        <e457:LinkedAgencies i:nil="false">
          <e457:CustomerInfo>
            <e457:Id i:nil="false">ValueHere</e457:Id>
            <e457:Name i:nil="false">ValueHere</e457:Name>
          </e457:CustomerInfo>
        </e457:LinkedAgencies>
        <e457:SalesHouseCustomerId i:nil="false">ValueHere</e457:SalesHouseCustomerId>
        <e457:TaxInformation xmlns:e459="http://schemas.datacontract.org/2004/07/System.Collections.Generic" i:nil="false">
          <e459:KeyValuePairOfstringstring>
            <e459:key i:nil="false">ValueHere</e459:key>
            <e459:value i:nil="false">ValueHere</e459:value>
          </e459:KeyValuePairOfstringstring>
        </e457:TaxInformation>
        <e457:BackUpPaymentInstrumentId i:nil="false">ValueHere</e457:BackUpPaymentInstrumentId>
        <e457:BillingThresholdAmount i:nil="false">ValueHere</e457:BillingThresholdAmount>
        <e457:BusinessAddress i:nil="false">
          <e457:City i:nil="false">ValueHere</e457:City>
          <e457:CountryCode i:nil="false">ValueHere</e457:CountryCode>
          <e457:Id i:nil="false">ValueHere</e457:Id>
          <e457:Line1 i:nil="false">ValueHere</e457:Line1>
          <e457:Line2 i:nil="false">ValueHere</e457:Line2>
          <e457:Line3 i:nil="false">ValueHere</e457:Line3>
          <e457:Line4 i:nil="false">ValueHere</e457:Line4>
          <e457:PostalCode i:nil="false">ValueHere</e457:PostalCode>
          <e457:StateOrProvince i:nil="false">ValueHere</e457:StateOrProvince>
          <e457:TimeStamp i:nil="false">ValueHere</e457:TimeStamp>
          <e457:BusinessName i:nil="false">ValueHere</e457:BusinessName>
        </e457:BusinessAddress>
        <e457:AutoTagType i:nil="false">ValueHere</e457:AutoTagType>
        <e457:SoldToPaymentInstrumentId i:nil="false">ValueHere</e457:SoldToPaymentInstrumentId>
        <e457:TaxCertificate i:nil="false">
          <e457:TaxCertificateBlobContainerName i:nil="false">ValueHere</e457:TaxCertificateBlobContainerName>
          <e457:TaxCertificates xmlns:e460="http://schemas.datacontract.org/2004/07/System.Collections.Generic" i:nil="false">
            <e460:KeyValuePairOfstringbase64Binary>
              <e460:key i:nil="false">ValueHere</e460:key>
              <e460:value i:nil="false">ValueHere</e460:value>
            </e460:KeyValuePairOfstringbase64Binary>
          </e457:TaxCertificates>
          <e457:Status i:nil="false">ValueHere</e457:Status>
        </e457:TaxCertificate>
        <e457:AccountMode i:nil="false">ValueHere</e457:AccountMode>
      </Account>
    </AddAccountRequest>
  </s:Body>
</s:Envelope>

Response SOAP

This template was generated by a tool to show the order of the body and header elements for the SOAP response.

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header xmlns="https://bingads.microsoft.com/Customer/v13">
    <TrackingId d3p1:nil="false" xmlns:d3p1="http://www.w3.org/2001/XMLSchema-instance">ValueHere</TrackingId>
  </s:Header>
  <s:Body>
    <AddAccountResponse xmlns="https://bingads.microsoft.com/Customer/v13">
      <AccountId>ValueHere</AccountId>
      <AccountNumber d4p1:nil="false" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">ValueHere</AccountNumber>
      <CreateTime>ValueHere</CreateTime>
    </AddAccountResponse>
  </s:Body>
</s:Envelope>

Code Syntax

The example syntax can be used with Bing Ads SDKs. See Bing Ads API Code Examples for more examples.

public async Task<AddAccountResponse> AddAccountAsync(
	AdvertiserAccount account)
{
	var request = new AddAccountRequest
	{
		Account = account
	};

	return (await CustomerManagementService.CallAsync((s, r) => s.AddAccountAsync(r), request));
}
static AddAccountResponse addAccount(
	AdvertiserAccount account) throws RemoteException, Exception
{
	AddAccountRequest request = new AddAccountRequest();

	request.setAccount(account);

	return CustomerManagementService.getService().addAccount(request);
}
static function AddAccount(
	$account)
{

	$GLOBALS['Proxy'] = $GLOBALS['CustomerManagementProxy'];

	$request = new AddAccountRequest();

	$request->Account = $account;

	return $GLOBALS['CustomerManagementProxy']->GetService()->AddAccount($request);
}
response=customermanagement_service.AddAccount(
	Account=Account)

Requirements

Service: CustomerManagementService.svc v13
Namespace: https://bingads.microsoft.com/Customer/v13

Request Url

https://clientcenter.api.bingads.microsoft.com/CustomerManagement/v13/Account

Request Elements

The AddAccountRequest object defines the body and header elements of the service operation request.

Note

Unless otherwise noted below, all request elements are required.

Request Body Elements

Element Description Data Type
Account The account that you want to add to the existing customer.

You must set the ParentCustomerId in the advertiser account object.
AdvertiserAccount

Request Header Elements

Element Description Data Type
Authorization The OAuth access token that represents the credentials of a user who has permissions to Microsoft Advertising accounts. Please ensure that the token is prefixed with "Bearer ", this is necessary for proper authentication.

For more information see Authentication with OAuth.
string
DeveloperToken The developer token used to access the Bing Ads API.

For more information see Get a Developer Token.
string
Password This element is reserved for internal use and will be removed from a future version of the API. You must use the AuthenticationToken element to set user credentials. string
UserName This element is reserved for internal use and will be removed from a future version of the API. You must use the AuthenticationToken element to set user credentials. string

Response Elements

The AddAccountResponse object defines the body and header elements of the service operation response. The elements are returned in the same order as shown in the Response JSON.

Response Body Elements

Element Description Data Type
AccountId A system-generated account identifier corresponding to the new account specified in the request.

Use this identifier with operation requests that require an AccountId body element and a CustomerAccountId SOAP header element.
long
AccountNumber The system-generated account number that is used to identify the account in the Microsoft Advertising web application.

The account number has the form xxxxxxxx, where xxxxxxxx is a series of any eight alphanumeric characters.
string
CreateTime The date and time that the account was added. The date and time value reflects the date and time at the server, not the client. For information about the format of the date and time, see the dateTime entry in Primitive XML Data Types. dateTime

Response Header Elements

Element Description Data Type
TrackingId The identifier of the log entry that contains the details of the API call. string

Request JSON

This template was generated by a tool to show the body and header elements for the JSON request. For supported types that you can use with this service operation, see the Request Body Elements reference above.

{
  "Account": {
    "AccountFinancialStatus": "ValueHere",
    "AccountLifeCycleStatus": "ValueHere",
    "AccountMode": "ValueHere",
    "AutoTagType": "ValueHere",
    "BackUpPaymentInstrumentId": "LongValueHere",
    "BillingThresholdAmount": DecimalValueHere,
    "BillToCustomerId": "LongValueHere",
    "BusinessAddress": {
      "BusinessName": "ValueHere",
      "City": "ValueHere",
      "CountryCode": "ValueHere",
      "Id": "LongValueHere",
      "Line1": "ValueHere",
      "Line2": "ValueHere",
      "Line3": "ValueHere",
      "Line4": "ValueHere",
      "PostalCode": "ValueHere",
      "StateOrProvince": "ValueHere",
      "TimeStamp": "ValueHere"
    },
    "CurrencyCode": "ValueHere",
    "ForwardCompatibilityMap": [
      {
        "key": "ValueHere",
        "value": "ValueHere"
      }
    ],
    "Id": "LongValueHere",
    "Language": "ValueHere",
    "LastModifiedByUserId": "LongValueHere",
    "LastModifiedTime": "ValueHere",
    "LinkedAgencies": [
      {
        "Id": "LongValueHere",
        "Name": "ValueHere"
      }
    ],
    "Name": "ValueHere",
    "Number": "ValueHere",
    "ParentCustomerId": "LongValueHere",
    "PauseReason": "ValueHere",
    "PaymentMethodId": "LongValueHere",
    "PaymentMethodType": "ValueHere",
    "PrimaryUserId": "LongValueHere",
    "SalesHouseCustomerId": "LongValueHere",
    "SoldToPaymentInstrumentId": "LongValueHere",
    "TaxCertificate": {
      "Status": "ValueHere",
      "TaxCertificateBlobContainerName": "ValueHere",
      "TaxCertificates": [
        {
          "key": "ValueHere",
          "value": "ValueHere"
        }
      ]
    },
    "TaxInformation": [
      {
        "key": "ValueHere",
        "value": "ValueHere"
      }
    ],
    "TimeStamp": "ValueHere",
    "TimeZone": "ValueHere"
  }
}

Response JSON

This template was generated by a tool to show the body and header elements for the JSON response.

{
  "AccountId": "LongValueHere",
  "AccountNumber": "ValueHere",
  "CreateTime": "ValueHere"
}

Code Syntax

To call REST API through SDKs, you need to upgrade SDK to a certain version and configure the system parameters.The example syntax can be used with Bing Ads SDKs. See Bing Ads API Code Examples for more examples.

public async Task<AddAccountResponse> AddAccountAsync(
	AdvertiserAccount account)
{
	var request = new AddAccountRequest
	{
		Account = account
	};

	return (await CustomerManagementService.CallAsync((s, r) => s.AddAccountAsync(r), request));
}
static AddAccountResponse addAccount(
	AdvertiserAccount account) throws RemoteException, Exception
{
	AddAccountRequest request = new AddAccountRequest();

	request.setAccount(account);

	return CustomerManagementService.getService().addAccount(request);
}
static function AddAccount(
	$account)
{

	$GLOBALS['Proxy'] = $GLOBALS['CustomerManagementProxy'];

	$request = new AddAccountRequest();

	$request->Account = $account;

	return $GLOBALS['CustomerManagementProxy']->GetService()->AddAccount($request);
}
response=customermanagement_service.AddAccount(
	Account=Account)