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:e465="https://bingads.microsoft.com/Customer/v13/Entities" i:nil="false">
<e465:BillToCustomerId i:nil="false">ValueHere</e465:BillToCustomerId>
<e465:CurrencyCode i:nil="false">ValueHere</e465:CurrencyCode>
<e465:AccountFinancialStatus i:nil="false">ValueHere</e465:AccountFinancialStatus>
<e465:Id i:nil="false">ValueHere</e465:Id>
<e465:Language i:nil="false">ValueHere</e465:Language>
<e465:LastModifiedByUserId i:nil="false">ValueHere</e465:LastModifiedByUserId>
<e465:LastModifiedTime i:nil="false">ValueHere</e465:LastModifiedTime>
<e465:Name i:nil="false">ValueHere</e465:Name>
<e465:Number i:nil="false">ValueHere</e465:Number>
<e465:ParentCustomerId>ValueHere</e465:ParentCustomerId>
<e465:PaymentMethodId i:nil="false">ValueHere</e465:PaymentMethodId>
<e465:PaymentMethodType i:nil="false">ValueHere</e465:PaymentMethodType>
<e465:PrimaryUserId i:nil="false">ValueHere</e465:PrimaryUserId>
<e465:AccountLifeCycleStatus i:nil="false">ValueHere</e465:AccountLifeCycleStatus>
<e465:TimeStamp i:nil="false">ValueHere</e465:TimeStamp>
<e465:TimeZone i:nil="false">ValueHere</e465:TimeZone>
<e465:PauseReason i:nil="false">ValueHere</e465:PauseReason>
<e465:ForwardCompatibilityMap xmlns:e466="http://schemas.datacontract.org/2004/07/System.Collections.Generic" i:nil="false">
<e466:KeyValuePairOfstringstring>
<e466:key i:nil="false">ValueHere</e466:key>
<e466:value i:nil="false">ValueHere</e466:value>
</e466:KeyValuePairOfstringstring>
</e465:ForwardCompatibilityMap>
<e465:LinkedAgencies i:nil="false">
<e465:CustomerInfo>
<e465:Id i:nil="false">ValueHere</e465:Id>
<e465:Name i:nil="false">ValueHere</e465:Name>
</e465:CustomerInfo>
</e465:LinkedAgencies>
<e465:SalesHouseCustomerId i:nil="false">ValueHere</e465:SalesHouseCustomerId>
<e465:TaxInformation xmlns:e467="http://schemas.datacontract.org/2004/07/System.Collections.Generic" i:nil="false">
<e467:KeyValuePairOfstringstring>
<e467:key i:nil="false">ValueHere</e467:key>
<e467:value i:nil="false">ValueHere</e467:value>
</e467:KeyValuePairOfstringstring>
</e465:TaxInformation>
<e465:BackUpPaymentInstrumentId i:nil="false">ValueHere</e465:BackUpPaymentInstrumentId>
<e465:BillingThresholdAmount i:nil="false">ValueHere</e465:BillingThresholdAmount>
<e465:BusinessAddress i:nil="false">
<e465:City i:nil="false">ValueHere</e465:City>
<e465:CountryCode i:nil="false">ValueHere</e465:CountryCode>
<e465:Id i:nil="false">ValueHere</e465:Id>
<e465:Line1 i:nil="false">ValueHere</e465:Line1>
<e465:Line2 i:nil="false">ValueHere</e465:Line2>
<e465:Line3 i:nil="false">ValueHere</e465:Line3>
<e465:Line4 i:nil="false">ValueHere</e465:Line4>
<e465:PostalCode i:nil="false">ValueHere</e465:PostalCode>
<e465:StateOrProvince i:nil="false">ValueHere</e465:StateOrProvince>
<e465:TimeStamp i:nil="false">ValueHere</e465:TimeStamp>
<e465:BusinessName i:nil="false">ValueHere</e465:BusinessName>
</e465:BusinessAddress>
<e465:AutoTagType i:nil="false">ValueHere</e465:AutoTagType>
<e465:SoldToPaymentInstrumentId i:nil="false">ValueHere</e465:SoldToPaymentInstrumentId>
<e465:TaxCertificate i:nil="false">
<e465:TaxCertificateBlobContainerName i:nil="false">ValueHere</e465:TaxCertificateBlobContainerName>
<e465:TaxCertificates xmlns:e468="http://schemas.datacontract.org/2004/07/System.Collections.Generic" i:nil="false">
<e468:KeyValuePairOfstringbase64Binary>
<e468:key i:nil="false">ValueHere</e468:key>
<e468:value i:nil="false">ValueHere</e468:value>
</e468:KeyValuePairOfstringbase64Binary>
</e465:TaxCertificates>
<e465:Status i:nil="false">ValueHere</e465:Status>
</e465:TaxCertificate>
<e465:AccountMode i:nil="false">ValueHere</e465: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)