updateProfile
put
/ccadmin/v1/profiles/{id}
Update Profile. This operation is used to update customer name, email address, phone number, shipping address and email marketing flag status of a customer profile. Optionally takes the x-ccasset-language header to get translated content in another language.
Request
Supported Media Types
- application/json
Path Parameters
- id
-
Type:
string
Required:true
The ID of the shopper profile to be updated.
Header Parameters
- X-CCAsset-Language
-
Type:
string
The asset language of the request
Body Parameter
Root Schema : updateProfile_request
{
"firstName":"Jack",
"lastName":"Black",
"gender":"male",
"receiveEmail":"yes",
"dateOfBirth":"null",
"locale":"en",
"email":"jack@example.com",
"shippingAddresses":[
{
"lastName":"Black",
"country":"United States",
"address3":"",
"address2":"",
"city":"Wake Forest",
"prefix":"",
"address1":"405 Example Street",
"defaultCountryCode":"US",
"postalCode":"27587",
"jobTitle":"",
"companyName":"",
"county":"",
"isDefaultAddress":true,
"suffix":"",
"selectedCountry":"US",
"firstName":"Jack",
"phoneNumber":"555123456",
"alias":"Address",
"faxNumber":"",
"middleName":"",
"state":"North Carolina",
"selectedState":"NC",
"state_ISOCode":"US-NC"
},
{
"lastName":"Hill",
"country":"United States",
"address3":"",
"address2":"",
"city":"Wake Forest",
"prefix":"",
"address1":"415 Example Road",
"defaultCountryCode":"US",
"postalCode":"27587",
"jobTitle":"",
"companyName":"",
"county":"",
"isDefaultAddress":false,
"suffix":"",
"selectedCountry":"US",
"firstName":"Jill",
"phoneNumber":"55512345",
"alias":"Address##0",
"faxNumber":"",
"middleName":"",
"state":"North Carolina",
"selectedState":"NC",
"state_ISOCode":"US-NC"
}
]
}
- dateOfBirth
-
Type:
string
The date of birth of the profile user. - daytimeTelephoneNumber
-
Type:
string
The phone Number of the profile. -
Type:
string
The email address of the profile. - firstName
-
Type:
string
The first name of the profile. - gender
-
Type:
string
The gender of the profile user. - lastName
-
Type:
string
The last name of the profile. - newConfirmPassword
-
Type:
string
Confirmation of the new password. This should match the new password value. - newPassword
-
Type:
string
The new password. - oldPassword
-
Type:
string
The current password. - receiveEmail
-
Type:
string
This is email marketing flag. can be yes or no. - shippingAddress
-
Type:
object
shippingAddressAdditional Properties Allowed:Default shipping address of the profile (Deprecated, please use 'shippingAddresses' instead). - shippingAddresses
-
Type:
array
shippingAddressesAdditional Properties Allowed:List of shipping addresses associated with profile.
Nested Schema : shippingAddress
Type:
object
Default shipping address of the profile (Deprecated, please use 'shippingAddresses' instead).
- address1
-
Type:
string
Required:true
The address line 1 of the shipping address. - address2
-
Type:
string
The address line 2 of the shipping address. - address3
-
Type:
string
The address line 3 of the shipping address. - alias
-
Type:
string
The alias of the shipping address. - companyName
-
Type:
string
The company name of the shipping address. - country
-
Type:
string
Required:true
The country code of the shipping address. - county
-
Type:
string
The county of the shipping address. - firstName
-
Type:
string
Required:true
The first name of the shipping address. - lastName
-
Type:
string
Required:true
The last name of the shipping address. - phoneNumber
-
Type:
string
The phone Number of the shipping address. - postalCode
-
Type:
string
Required:true
The postal Code of the shipping address. - prefix
-
Type:
string
The prefix of the shipping address. - repositoryId
-
Type:
string
The repository ID of the shipping address. - selectedCountry
-
Type:
string
The country code of the shipping address. If selectedCountry is sent in the request then it takes precedence over country. - selectedState
-
Type:
string
The state ISO alpha-2 code of the shipping address. If selectedState is sent in the request then it takes precedence over state. - state
-
Type:
string
Required:true
The state code of the shipping address. - state_ISOCode
-
Type:
string
The state ISO alpha-4 code of the shipping address.
Nested Schema : shippingAddresses
Nested Schema : items
Type:
object
- address1
-
Type:
string
Required:true
The address line 1 of the shipping address. - address2
-
Type:
string
The address line 2 of the shipping address. - address3
-
Type:
string
The address line 3 of the shipping address. - alias
-
Type:
string
The alias of the shipping address. - city
-
Type:
string
Required:true
The city of the shipping address. - companyName
-
Type:
string
The company name of the shipping address. - country
-
Type:
string
Required:true
The country of the shipping address. - county
-
Type:
string
The county code of the shipping address. - firstName
-
Type:
string
Required:true
The first name of the shipping address. - isDefaultAddress
-
Type:
boolean
Whether to store this address in the default shipping address slot. - lastName
-
Type:
string
Required:true
The last name of the shipping address. - phoneNumber
-
Type:
string
The phone Number of the shipping address. - postalCode
-
Type:
string
Required:true
The postal Code of the shipping address. - prefix
-
Type:
string
The prefix of the shipping address. - repositoryId
-
Type:
string
The repository ID of the shipping address. - selectedCountry
-
Type:
string
The country code of the shipping address. If selectedCountry is sent in the request then it takes precedence over country. - selectedState
-
Type:
string
The state ISO alpha-2 code of the shipping address. If selectedState is sent in the request then it takes precedence over state. - state
-
Type:
string
Required:true
The state code of the shipping address. - state_ISOCode
-
Type:
string
The state ISO alpha-4 code of the shipping address.
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Body
Root Schema : updateProfile_response
- dateOfBirth
-
Type:
string
The date of birth of the profile user. - daytimeTelephoneNumber
-
Type:
string
The phone Number of the profile. - dynamicProperties
-
Type:
array
dynamicPropertiesAdditional Properties Allowed:Read-only list of dynamic properties associated with profile along with meta-data. -
Type:
string
The email address of the profile. - firstName
-
Type:
string
The first name of the profile. - gender
-
Type:
string
The gender of the profile user. - id
-
Type:
string
The ID of the profile to retrieve. - lastName
-
Type:
string
The last name of the profile. - receiveEmail
-
Type:
string
This is email marketing flag. Can be yes or no. - roles
-
Type:
array
rolesAdditional Properties Allowed:List of role assigned to the profile. - shippingAddress
-
Type:
object
shippingAddressAdditional Properties Allowed:Default shipping address of the profile (Deprecated, please use 'shippingAddresses' instead). - shippingAddresses
-
Type:
array
shippingAddressesAdditional Properties Allowed:List of shipping addresses associated with profile.
Nested Schema : dynamicProperties
Nested Schema : roles
Nested Schema : shippingAddress
Type:
object
Default shipping address of the profile (Deprecated, please use 'shippingAddresses' instead).
- address1
-
Type:
string
The address line 1 of the shipping address. - address2
-
Type:
string
The address line 2 of the shipping address. - address3
-
Type:
string
The address line 3 of the shipping address. - alias
-
Type:
string
The alias of the shipping address. - city
-
Type:
string
the city of the shipping address. - companyName
-
Type:
string
The company name of the shipping address. - country
-
Type:
string
the country code of the shipping address. - county
-
Type:
string
The county of the shipping address. - faxNumber
-
Type:
string
The fax Number of the shipping address. - firstName
-
Type:
string
The first name of the shipping address. - jobTitle
-
Type:
string
The job Title of the shipping address. - lastName
-
Type:
string
The last name of the shipping address. - middleName
-
Type:
string
The Middle Name of the shipping address. - phoneNumber
-
Type:
string
The phone Number of the shipping address. - postalCode
-
Type:
string
The postal Code of the shipping address. - prefix
-
Type:
string
The prefix of the shipping address. - repositoryId
-
Type:
string
The repository ID of the shipping address. - state
-
Type:
string
The state code of the shipping address. - suffix
-
Type:
string
The suffix of the shipping address.
Nested Schema : shippingAddresses
Nested Schema : items
Type:
object
- default
-
Type:
string
The default value of the dynamic property. - id
-
Type:
string
The ID of the dynamic property. - label
-
Type:
string
The label of the dynamic property. - length
-
Type:
number
The length attribute of the dynamic property. - required
-
Type:
boolean
The required attribute of the dynamic property. - type
-
Type:
string
The type of the dynamic property. Supported types are boolean, date, float, string, timestamp, enumerated, big string. - uiEditorType
-
Type:
string
The uiEditorType attribute of the dynamic property. - value
-
Type:
string
The value of the dynamic property.
Nested Schema : items
Type:
object
- function
-
Type:
string
Name of the role. - repositoryId
-
Type:
string
Repository Id of the role.
Nested Schema : items
Type:
object
- address1
-
Type:
string
The address line 1 of the shipping address. - address2
-
Type:
string
The address line 2 of the shipping address. - address3
-
Type:
string
The address line 3 of the shipping address. - alias
-
Type:
string
The alias of the shipping address. - city
-
Type:
string
The city of the shipping address. - companyName
-
Type:
string
The company name of the shipping address. - country
-
Type:
string
The country code of the shipping address. - countryName
-
Type:
string
The display name for the country of the shipping address - county
-
Type:
string
The county of the shipping address. - firstName
-
Type:
string
The first name of the shipping address. - lastName
-
Type:
string
The last name of the shipping address. - phoneNumber
-
Type:
string
The phone Number of the shipping address. - postalCode
-
Type:
string
The postal Code of the shipping address. - prefix
-
Type:
string
The prefix of the shipping address. - regionName
-
Type:
string
The display name for the state of the shipping address - repositoryId
-
Type:
string
The repository ID of the shipping address. - state
-
Type:
string
The state code of the shipping address.
Example application/json
{
"derivedPriceListGroup":null,
"lastName":"Anderson",
"gender":"female",
"catalog":null,
"roles":[
{
"function":"buyer",
"relativeTo":{
"id":"900004"
},
"repositoryId":"100006"
}
],
"locale":"en",
"parentOrganization":{
"name":"Oracle",
"repositoryId":"100001",
"description":"Oracle Org",
"active":true,
"shippingAddress":{
},
"secondaryAddresses":[
{
"firstName":"Harry",
"lastName":"Potter",
"country":"United States",
"phoneNumber":"9088988999",
"city":"Arcadia",
"address2":"Suite 400",
"address1":"Grundy Lane",
"postalCode":"91006",
"repositoryId":"110033",
"state":"CA"
}
],
"id":"900004",
"billingAddress":{
}
},
"shippingSurchargePriceList":null,
"profileType":"b2b_user",
"translations":{
},
"loyaltyPrograms":[
{
"programName":"XTRAREWARDS",
"repositoryId":100001,
"membershipId":"abc123",
"programId":"prog1",
"status":"Enrolled"
},
{
"programName":"XTRAMILES",
"repositoryId":100002,
"membershipId":"xyz123",
"programId":"prog2",
"status":"RequestForEnrollment"
}
],
"id":"se-570031",
"email":"kim@example.com",
"daytimeTelephoneNumber":"212-555-1977",
"derivedSalePriceList":null,
"taxExempt":false,
"receiveEmail":"yes",
"active":"true",
"priceListGroup":null,
"dateOfBirth":null,
"firstName":"Kim",
"repositoryId":"se-570031",
"shippingAddress":{
},
"billingAddress":{
},
"userType":null,
"derivedShippingSurchargePriceList":null,
"secondaryOrganizations":[
],
"shippingAddresses":[
]
}
Default Response
The error response.
The following are the internal error codes thrown by this API when the request processing fails in Oracle Commerce Cloud:
|Error Code|Description|
|------------------|------------------|
|100088|You cannot remove the Approver role from this contact. The account has no other active Approvers. Approvals are still enabled and/or there are orders pending approval.|
|22000|If the profile id passes is null or empty|
|100089|You cannot deactivate this contact. The account has no other active Approvers. Approvals are still enabled and/or there are orders pending approval|
|22001|If there was any internal error while getting the profile|
|22002|If there was no profile found with the given id|
|89003|If user is removing admin role for himself|
|22007|If invalid input is provided|
|89001|If invalid roles are provided|
|22024|{0}({1}) must be a String|
|22025|Format for loyaltyPrograms is incorrect. Please refer to API doc for more information|
|22026|{0} is either missing or incorrect.|
|22027|Invalid state is provided.
Body
Root Schema : errorModel
Type:
object
- devMessage
-
Type:
string
An optional non-localized message containing technical information for developers - errorCode
-
Type:
string
The numerical code identifying the error - errors
-
Type:
array
errorsAdditional Properties Allowed:An optional list of errors if multiple errors were encountered - message
-
Type:
string
The localized message describing the error - moreInfo
-
Type:
string
An optional non-localized message with more information - o:errorPath
-
Type:
string
An optional machine readable description of where the error occurred - status
-
Type:
string
The HTTP status code - type
-
Type:
string
The URI to the HTTP state code definition
Nested Schema : errors
Nested Schema : items
Type:
object
- devMessage
-
Type:
string
An optional non-localized message containing technical information for developers - errorCode
-
Type:
string
The numerical code identifying the error - message
-
Type:
string
The localized message describing the error - moreInfo
-
Type:
string
An optional non-localized message with more information - o:errorPath
-
Type:
string
An optional machine readable description of where the error occurred - status
-
Type:
string
The HTTP status code
Examples
Sample Request:
{ "firstName": "kim", "lastName": "Anderson", "profileType": "b2b_user", "gender": "female", "loyaltyPrograms": [ { "programName": "XTRAREWARDS", "membershipId": "abc123", "programId": "prog1", "status": "Enrolled" }, { "programName": "XTRAMILES", "membershipId": "xyz123", "programId": "prog2", "status": "Enrolled" } ], "roles": [{ "funtion": "buyer", "relativeTo": {"id": "900004"} }], "receiveEmail": "yes", "active": true, "dateOfBirth": null, "parentOrganization": "900004", "email": "kim@example.com", "daytimeTelephoneNumber": "212-555-1977" }
Sample Response Payload returned by endpoint:
{ "derivedPriceListGroup": null, "lastName": "Anderson", "gender": "female", "catalog": null, "roles": [{ "function": "buyer", "relativeTo": {"id": "900004"}, "repositoryId": "100006" }], "locale": "en", "parentOrganization": { "name": "Oracle", "repositoryId": "100001", "description": "Oracle Org", "active": true, "shippingAddress": {}, "secondaryAddresses": [{ "firstName": "Harry", "lastName": "Potter", "country": "United States", "phoneNumber": "9088988999", "city": "Arcadia", "address2": "Suite 400", "address1": "Grundy Lane", "postalCode": "91006", "repositoryId": "110033", "state": "CA" }], "id": "900004", "billingAddress": {} }, "shippingSurchargePriceList": null, "profileType": "b2b_user", "translations": {}, "loyaltyPrograms": [ { "programName": "XTRAREWARDS", "repositoryId": 100001, "membershipId": "abc123", "programId": "prog1", "status": "Enrolled" }, { "programName": "XTRAMILES", "repositoryId": 100002, "membershipId": "xyz123", "programId": "prog2", "status": "RequestForEnrollment" } ], "id": "se-570031", "email": "kim@example.com", "daytimeTelephoneNumber": "212-555-1977", "derivedSalePriceList": null, "taxExempt": false, "receiveEmail": "yes", "active": "true", "priceListGroup": null, "dateOfBirth": null, "firstName": "Kim", "repositoryId": "se-570031", "shippingAddress": {}, "billingAddress": {}, "userType": null, "derivedShippingSurchargePriceList": null, "secondaryOrganizations": [], "shippingAddresses": [] }