updateMember
put
/ccagent/v1/organizationMembers/{id}
Update Member. This operation is used to update customer name, email, role, status and dynamic properties of a customer profile. Takes X-CCAgentContext header which is a JSON object with 'shopperProfileId' as a property. If 'shopperProfileId' is not provided, it is considered as an anonymous profile. Also it takes X-CCOrganization header which is a JSON field with organization ID as value.If this header is not provided, then the endPoint will consider first active organization as the current organization.
Request
Supported Media Types
- application/json
Path Parameters
-
id: string
The ID of the shopper profile to be updated.
Header Parameters
-
X-CCAgentContext: string
The Agent Context is a JSON object with shopperProfileId as a property.
-
X-CCAsset-Language(optional): string
The asset language of the request
-
X-CCOrganization(optional): string
The organization Id associated with the shopper profile
-
X-CCSite(optional): string
The site Id to update the site specific shopper profile properties
Root Schema : updateMember_request
Type:
Show Source
object
-
active(optional):
boolean
the status of the profile. Should be true or false
-
customerContactId(optional):
string
The external customer contact id.
-
email(optional):
string
the email address of the profile
-
firstName:
string
the first name of the profile
-
lastName(optional):
string
the last name of the profile
-
receiveEmail(optional):
string
this is email marketing flag. can be yes or no
-
roles(optional):
array roles
List of role's function that need to associate with the user
Example:
{
"dynamicProperty":"dynamicProperty value",
"firstName":"kim",
"lastName":"Anderson",
"customerContactId":"CRMID_1",
"roles":[
{
"function":"buyer"
},
{
"function":"custom",
"repositoryId":"customOrganizationalRole"
}
],
"receiveEmail":"yes",
"active":true,
"email":"kim@example.com",
"daytimeTelephoneNumber":"212-555-1977"
}
Nested Schema : roles
Type:
array
List of role's function that need to associate with the user
Show Source
Nested Schema : items
Type:
Show Source
object
-
function(optional):
string
Function of the role
-
repositoryId(optional):
string
Repository id of the role. Required if function is custom. Ignored in other cases.
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Root Schema : updateMember_response
Type:
Show Source
object
-
active(optional):
boolean
This is active status of the profile should be true or false.
-
customerContactId(optional):
string
The external customer contact id.
-
email(optional):
string
the email address of the profile
-
firstName(optional):
string
the first name of the profile
-
id(optional):
string
get the shopper profile with id
-
lastName(optional):
string
the last name of the profile
-
locale(optional):
string
the locale of the request/response
-
parentOrganization(optional):
object parentOrganization
This attribute is added for 'Account-Based Commerce', this is required only in case of 'Account-Based Commerce', this is the id of organization to which user is associated
-
profileType(optional):
string
This attribute is added for account-based commerce, It's value is 'b2b_user'
-
receiveEmail(optional):
string
this is email marketing flag. can be yes or no
-
repositoryId(optional):
string
the id of the profile
-
roles(optional):
array roles
List of user roles
Nested Schema : parentOrganization
Type:
object
This attribute is added for 'Account-Based Commerce', this is required only in case of 'Account-Based Commerce', this is the id of organization to which user is associated
Show Source
-
active(optional):
boolean
the status of the parent organization. Should be true or false
-
billingAddress(optional):
object billingAddress
Default billing address of the organization
-
description(optional):
string
Description of the Organization
-
externalOrganizationId(optional):
string
External organization id
-
id(optional):
string
the id of the parent organization
-
name(optional):
string
the name of the parent organization
-
repositoryId(optional):
string
the id of the parent organization
-
secondaryAddresses(optional):
object secondaryAddresses
List of shipping addresses associated with the profile.
-
shippingAddress(optional):
object shippingAddress
Default shipping address of the organization
Nested Schema : billingAddress
Type:
object
Default billing address of the organization
Show Source
-
repositoryId(optional):
string
the id of the billing address
Nested Schema : secondaryAddresses
Type:
object
List of shipping addresses associated with the profile.
Show Source
-
AddressType(optional):
object AddressType
Address type represents nick-name of address.
Nested Schema : shippingAddress
Type:
object
Default shipping address of the organization
Show Source
-
repositoryId(optional):
string
the id of the shipping address
Nested Schema : AddressType
Type:
object
Address type represents nick-name of address.
Show Source
-
repositoryId(optional):
string
Repository ID of the shipping address
Nested Schema : items
Type:
Show Source
object
-
function(optional):
string
Function of the role. Present only if type is organizationalRole
-
relativeTo(optional):
object relativeTo
Organization in which the role applies. Present only if type is organizationalRole
-
repositoryId(optional):
string
Repository id of the role
Nested Schema : relativeTo
Type:
object
Organization in which the role applies. Present only if type is organizationalRole
Show Source
-
id(optional):
string
Organization ID
Example Response (application/json)
{
"lastName":"Dilliard",
"GDPRProfileP13nConsentDate":"2018-03-23T09:02:31.000Z",
"GDPRProfileP13nConsentGranted":true,
"customerContactId":"CRMID_1",
"dynamicProperties":[
{
"uiEditorType":"shortText",
"default":"Field1",
"length":null,
"id":"dynamicProperty1",
"label":"Nickname",
"type":"string",
"value":"dynamicPropertyValue",
"required":false
}
],
"roles":[
{
"function":"admin",
"relativeTo":"or-100001",
"repositoryId":"100001"
},
{
"function":"buyer",
"relativeTo":"or-100001",
"repositoryId":"100002"
}
],
"receiveEmail":"yes",
"active":true,
"locale":"en",
"parentOrganization":{
"active":true,
"description":null,
"secondaryAddresses":{
"Address2":{
"repositoryId":"ci-110024"
},
"Address1":{
"repositoryId":"ci-110023"
}
},
"externalOrganizationId":"EXT_ORG_1",
"orderPriceLimit":50,
"approvalRequired":true,
"repositoryId":"or-100001",
"punchoutUserId":"100012",
"name":"National Discount Auto Parts",
"shippingAddress":{
"repositoryId":"ci-110024"
},
"billingAddress":{
"repositoryId":"ci-110024"
},
"id":"or-100001",
"useExternalApprovalWebhook":false
},
"receiveEmailDate":"2018-03-23T09:02:22.000Z",
"orderPriceLimit":50,
"firstName":"Leota",
"profileType":"b2b_user",
"repositoryId":"bb-110006",
"links":[
{
"rel":"self",
"href":"http://localhost:9080/ccagentui/v1/organizationMembers/bb-110006"
}
],
"id":"bb-110006",
"secondaryOrganizations":[
],
"email":"leota@example.com"
}
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|
|------------------|------------------|
|22000|If the profile id passed is null or empty|
|23012|If no last name is specified|
|22001|If there was any internal error while getting the profile|
|23013|If no first name is specified|
|22002|If there was no profile found with the given id|
|82005000|If there is an error while processing the AgentContext header. Possible reasons include invalid profileId, incorrect JSON format or other errors|
|200019|If an account already exists for the given email address|
|23006|If invalid email address is specified|
|22007|If the profile id passed is not associated to the account of the profile id passed in the AgentContext header|
|22010|If the profile id passed is not associated to the account of the profileId passed in the AgentContext header.|
|89103|If no shopperProfileId is passed in the AgentContext header|
|89102|If the shopperProfile passed in the AgentContext header or the associated account is inactive|
|89101|If the shopperProfile passed in the AgentContext header is not an administrator for the account|
|13036|One of the dynamic properties is not writable by the Agent user|
Root Schema : errorModel
Type:
Show Source
object
-
devMessage(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
errors(optional):
array errors
An optional list of errors if multiple errors were encountered
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code
-
type(optional):
string
The URI to the HTTP state code definition
Nested Schema : errors
Type:
array
An optional list of errors if multiple errors were encountered
Show Source
Nested Schema : items
Type:
Show Source
object
-
devMessage(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code