Edit

Share via


UpdateCustomer Service Operation - Customer Management

Updates the details of the specified customer.

Note

Only a user with Super Admin credentials can update customers. For more information, see the User Roles technical guide.

Because the update operation requires the time stamp of the most recent customer write operation, you must first call the GetCustomer operation. The GetCustomer operation returns the customer's data, which includes the time stamp. The update call will fail if you use an old time stamp e.g., the customer data is updated by your application or another application after you obtained the time stamp.

Because the update operation completely overwrites the existing customer data, the customer data must contain all required data; otherwise, the operation will fail.

Request Elements

The UpdateCustomerRequest 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
Customer A customer object that contains the updated customer information.

This operation overwrites the existing customer data with the contents of the customer object that you pass. This operation performs a full update, and not a partial update. The Customer object must contain the time stamp value from the last time that the Customer object was written to. To ensure that the time stamp contains the correct value, call the GetCustomer operation. You can then update the customer data as appropriate, and call UpdateCustomer.
Customer

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 UpdateCustomerResponse 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
LastModifiedTime The date and time that the customer was last updated. The value is in Coordinated Universal Time (UTC).

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">UpdateCustomer</Action>
    <AuthenticationToken i:nil="false">ValueHere</AuthenticationToken>
    <DeveloperToken i:nil="false">ValueHere</DeveloperToken>
  </s:Header>
  <s:Body>
    <UpdateCustomerRequest xmlns="https://bingads.microsoft.com/Customer/v13">
      <Customer xmlns:e281="https://bingads.microsoft.com/Customer/v13/Entities" i:nil="false">
        <e281:CustomerFinancialStatus i:nil="false">ValueHere</e281:CustomerFinancialStatus>
        <e281:Id i:nil="false">ValueHere</e281:Id>
        <e281:Industry i:nil="false">ValueHere</e281:Industry>
        <e281:LastModifiedByUserId i:nil="false">ValueHere</e281:LastModifiedByUserId>
        <e281:LastModifiedTime i:nil="false">ValueHere</e281:LastModifiedTime>
        <e281:MarketCountry i:nil="false">ValueHere</e281:MarketCountry>
        <e281:ForwardCompatibilityMap xmlns:e282="http://schemas.datacontract.org/2004/07/System.Collections.Generic" i:nil="false">
          <e282:KeyValuePairOfstringstring>
            <e282:key i:nil="false">ValueHere</e282:key>
            <e282:value i:nil="false">ValueHere</e282:value>
          </e282:KeyValuePairOfstringstring>
        </e281:ForwardCompatibilityMap>
        <e281:MarketLanguage i:nil="false">ValueHere</e281:MarketLanguage>
        <e281:Name i:nil="false">ValueHere</e281:Name>
        <e281:ServiceLevel i:nil="false">ValueHere</e281:ServiceLevel>
        <e281:CustomerLifeCycleStatus i:nil="false">ValueHere</e281:CustomerLifeCycleStatus>
        <e281:TimeStamp i:nil="false">ValueHere</e281:TimeStamp>
        <e281:Number i:nil="false">ValueHere</e281:Number>
        <e281:CustomerAddress i:nil="false">
          <e281:City i:nil="false">ValueHere</e281:City>
          <e281:CountryCode i:nil="false">ValueHere</e281:CountryCode>
          <e281:Id i:nil="false">ValueHere</e281:Id>
          <e281:Line1 i:nil="false">ValueHere</e281:Line1>
          <e281:Line2 i:nil="false">ValueHere</e281:Line2>
          <e281:Line3 i:nil="false">ValueHere</e281:Line3>
          <e281:Line4 i:nil="false">ValueHere</e281:Line4>
          <e281:PostalCode i:nil="false">ValueHere</e281:PostalCode>
          <e281:StateOrProvince i:nil="false">ValueHere</e281:StateOrProvince>
          <e281:TimeStamp i:nil="false">ValueHere</e281:TimeStamp>
          <e281:BusinessName i:nil="false">ValueHere</e281:BusinessName>
        </e281:CustomerAddress>
      </Customer>
    </UpdateCustomerRequest>
  </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>
    <UpdateCustomerResponse xmlns="https://bingads.microsoft.com/Customer/v13">
      <LastModifiedTime>ValueHere</LastModifiedTime>
    </UpdateCustomerResponse>
  </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<UpdateCustomerResponse> UpdateCustomerAsync(
	Customer customer)
{
	var request = new UpdateCustomerRequest
	{
		Customer = customer
	};

	return (await CustomerManagementService.CallAsync((s, r) => s.UpdateCustomerAsync(r), request));
}
static UpdateCustomerResponse updateCustomer(
	Customer customer) throws RemoteException, Exception
{
	UpdateCustomerRequest request = new UpdateCustomerRequest();

	request.setCustomer(customer);

	return CustomerManagementService.getService().updateCustomer(request);
}
static function UpdateCustomer(
	$customer)
{

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

	$request = new UpdateCustomerRequest();

	$request->Customer = $customer;

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

Requirements

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