Update customer profile
Added by IBM contributorIBM | Edited by Claudia R Elbourn on June 15, 2015
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Update the profile of a single customer who is part of the organization of the authenticated user. Editable attributes include organization name, address, location, contact information, job title and more.


The API caller must have either the CustomerAdministrator or VSR role to run the API.


Table 1. API details

Method
Resource address
Input representation
PUT
/resource/customer/<id>
A JavaScript™ Object Notation (JSON) entry that represents the customer whose profile needs to be updated.
 

URL parameters


Provide the following parameter.

Table 2. Parameters

Parameter
Required
Description
id
Yes
The internal ID of the customer. To obtain the ID, use one of the GET methods that are defined in the Get customer list by email address or organization name topic.
 

Mutable attributes


Important: Mutable attributes that are not in the payload that you submit are deleted from the database. To avoid inadvertently deleting information, retrieve the most current customer profile for the customer that you intend to update. For more information about creating the payload, see the Creating the payload section later in this document.

Required attributes must be in the payload that you submit, even if you are not updating the values for those attributes.

For examples of valid field values, see Common attribute values.

Table 3. Mutable attributes

 

Attribute
Required
Description
Attribute Type
Maximum Length
CustomerNumber
No
Customer number, if it exists.
String
50 characters
OrgName
Yes
Name of the organization.
String
255 characters
Phone
No
Phone number of the organization.
String
30 characters
AddressLine1
Yes
Mailing address of the organization.
String
255 characters
AddressLine2
No
Additional space for mailing address.
String
100 characters
AddressType
Yes
The address type. Must be one of the following values:
  • BILLING
  • MAILING
  • MULTIPURPOSE
String
15 characters
City
Yes
City of residence.
String
50 characters
Country
Yes
Country or region of residence.
String
50 characters
State
Yes
State of residence.
String
50 characters
PostalCode
Yes
Zip (postal) code for mail.
String
20 characters
FamilyName
Yes
Last name of the primary contact person.
String
255 characters
GivenName
Yes
First name of the primary contact person.
String
255 characters
EmailAddress
Yes
Email address of the primary contact person.
String
255 characters
NamePrefix
No
Name prefix, if one exists.
String
10 characters
NameSuffix
No
Name suffix, if one exists.
String
10 characters
EmployeeNumber
No
Employee number of the person.
String
10 characters
LanguagePreference
No
Language preference of the person.
String
15 characters
WorkPhone
Yes
Workplace phone number.
String
30 characters
HomePhone
No
Residential phone number.
String
30 characters
MobilePhone
No
Mobile phone number.
String
30 characters
Fax
No
Fax number.
String
30 characters
JobTitle
No
Job title of the person.
String
50 characters
WebSiteAddress
No
Website address of the person, if available.
String
255 characters
TimeZone
No
Time zone information.
String
255 characters
Photo
No
Reference to the location where the photo is stored.
String
255 characters
AccountNumber
Yes
Customer account number, if one exists.
 
255 characters
LocationName
Yes
Name of customer location.
String
255 characters
PaymentMethodType
No
The payment method type. Set as one of the following values:
  • CREDIT_CARD
  • PURCHASE_ORDER
  • INVOICE
  • NONE
String
25 characters
CurrencyType
No
Type of currency.
String
25 characters
 

Creating the payload


To create the payload, you must first retrieve the most current customer profile for the customer that you intend to update. To retrieve the most current customer profile, use the GET method Get customer by ID, which returns a JSON payload. Update the payload that you retrieve and use it as the new payload. You can update one or more of the mutable attributes that are described in the table Mutable attributes.

Note: Attributes that do not have values might not be in the payload that you retrieve. If the attribute that you want to modify is not in the payload that you retrieve, add the attribute and its value to the payload that you submit. Mutable attributes that are not in the payload that you submit are deleted from the database.

Sample payload



Sample payload

For a list of common HTTP status codes that are returned for API calls, see HTTP status codes.

Avoiding stale payload error


If you use a stale payload, the following error occurs. To avoid the error, first use the method Get customer by ID to obtain the payload.

{ 

"BSSResponse": { 

"ResponseMessage": "Internalservererror", 

"ExceptionMessage":

"StaleObjectStateExceptionOccured-Rowwasupdatedordeletedbyanothertransaction.", 

"ResponseCode": "500" 

}

}


Output


If the profile update is successful, nothing is returned. To retrieve the payload and verify your changes, see the Get customer by ID topic for details about performing a GET operation.

For a list of common HTTP status codes that are returned for API calls, see HTTP status codes.

Parent topic: Customer management services

Input
Method URI Description
PUT /api/bss/resource/customer/{id} Update the profile of a single customer who is part of the organization of the authenticated user. Editable attributes include organization name, address, location, contact information, job title and more.
The API caller must have either the CustomerAdministrator or VSR role to run the API.
Important: Mutable attributes that are not in the payload that you submit are deleted from the database. To avoid inadvertently deleting information, retrieve the most current customer profile for the customer that you intend to update
Content Type: application/json
Use the table below that represents the expected fields:
Name Type Optional Description
CustomerNumber
string Yes Customer number, if it exists.
OrgName
string No Name of the organization.
Phone
string Yes Phone number of the organization.
AdressLine1
string No Mailing address of the organization.
AdressLine2
string Yes Additional space for mailing address.
AdressType
string No The address type. Must be one of the following values:
BILLING
MAILING
MULTIPURPOSE
City
string No City of residence.
Country
string No Country or region of residence.
State
string No State of residence.
PostalCode
string No Zip (postal) code for mail.
FamilyName
string No Last name of the primary contact person.
GivenName
string No First name of the primary contact person.
EmailAddress
string No Email address of the primary contact person.
NamePrefix
string Yes Name prefix, if one exists.
NameSuffix
string Yes Name suffix, if one exists.
EmployeeNumber
string Yes Employee number of the person.
LanguagePreference
string Yes Language preference of the person. Default value is en_US.
WorkPhone
string Yes Workplace phone number.
HomePhone
string Yes Residential phone number.
MobilePhone
string Yes Mobile phone number.
Fax
string Yes Fax number.
JobTitle
string Yes Job title of the person.
WebsiteAddress
string Yes Website address of the person, if available.
TimeZone
string Yes Time zone information.
Photo
string Yes Reference to the location where the photo is stored.
AccountNumber
string No Customer account number, if one exists.
LocationName
string Yes Name of customer location.
PaymentMethodType
string No The payment method type. Must be one of the following values:
CREDIT_CARD
PURCHASE_ORDER
INVOICE
NONE
CurrencyType
string Yes Type of currency.
Name Type Optional Description
id
string No The internal ID of the customer. To obtain the ID, use one of the GET methods that are defined in the [[Get customer list by email address or organization name bss: Get customer list by email address or organization name]] topic.