This command registers a guest user. After the user is registered, the user automatically logs onto the WebSphere Commerce system. Information for new users are stored in the MEMBER, USERS, USERREG, MBRREL, USERPROF, BUSPROF, USERDEMO, and ADDRESS database tables.
A B2B direct or value chain user can be created by specifying the profileType to have a value of 'B'. B2B direct or value chain users may needed to be approved. To register a user under an organization or organizational unit, specify a value for the parentMemberparameter.
Use this command with SSL (Secure Sockets Layer) to ensure that the user's information is encrypted. To do so type the command with the HTTPS secure protocol.
Command structure
- http://host_name/path/
- The fully qualified name of your WebSphere Commerce Server and the configuration path.
Parameter values
- URL (Required)
- The URL to be called when the command completes successfully.
- logonId (Required)
- The registrant's logon ID.
- logonPassword (Required)
- The registrant's password. In database mode, the password is encrypted before it is saved in the database. In LDAP mode, the password is only stored on the LDAP server.
- logonPasswordVerify (Required)
- The registrant's password, entered a second time.
- parentMember
- The member ID of the parent organization or organizational unit being updated; it is a foreign key reference to the MEMBER table. If parentMember is null, set it to the Default Organization (DN). If parentMember is not null, it can take two different type of values:
-
- Encrypted orgEntityId (using "wcs_encrypt -e orgentityId")
- DN of orgEntity (for example "o=Default Organization, o=Root
- profileType
- Indicate the type of registration:
-
- C=business-to-consumer registration profile data; authentication data and also data for the USERPROF table (this is the default). If the profileType is null and the parentMember is the Default Organization, by default, the profileType is "C".
- B=business-to-business registration profile data; authentication data and also data for the BUSPROF table. If the profileType is null and the parentMember is not the Default Organization, by default, the profileType is "B".
- preferredCurrency
- The registrant's preferred currency for transactions; a foreign key that references the SETCCURR column of the SETCURR table.
- preferredLanguage
- The registrant's preferred language; a foreign key that references the LANGUAGE_ID column of the LANGUAGE table.
- userField1 through userField3
- Customizable fields.
- challengeQuestion
- Challenge question for verbal confirmation of the registrant's identity.
- challengeAnswer
- Answer to the challenge question.
- description
- A description of the registrant.
- displayName
- Name used when displaying the name of the registrant in a summary list.
- userProfileField1 and userProfileField2
- Customizable fields.
- photo
- URL or path to a photo of the registrant.
- preferredCommunication
- The preferred phone for the registrant (stored in the ADDRESS table), for example:
-
- P1=phone 1
- P2=phone 2
- preferredDelivery
- The registrant's preferred mode of delivery.
- preferredMeasure
- The registrant's preferred unit of measure.
- taxPayerId
- A string used to identify the user for taxation, especially useful with tax software.
- alternateId
- A special ID assigned by the registrant's business organization or organizational unit to this particular registrant.
- departmentNumber
- The department identifier for the registrant.
- employeeId
- The registrant's ID with his or her employer.
- employeeType
- The registrant's status as an employee (for example, regular, permanent, contractor, or part time).
- manager
- The name of the registrant's manager.
- secretary
- The name of the registrant's secretary.
- age
- The registrant's age.
- children
- The number of children the registrant has.
- companyName
- The company name of the organization that the registrant represents, obtained when filling in demographic information .
- demographicField1 through demographicField4
- Customizable fields for demographic information; these are single-character fields.
- demographicField5
- Customizable field for demographic information; a field of 254 characters.
- demographicField6
- Customizable field for demographic information; an integer field.
- demographicField7
- Customizable field for demographic information; a field varchar, length 64.
- gender
- The registrant's gender.
- hobbies
- The registrant's hobbies.
- household
- The number of people in the registrant's household; the default is 1.
- income
- The registrant's annual income.
- incomeCurrency
- The currency in which the registrant's income is paid.
- maritalStatus
- The registrant's marital status.
- orderBefore
- Whether the registrant has previously placed an order. This value is supplied by the registrant.
- timeZone
- The time zone in which the registrant does business (report as GMT +/- hours) .
- address1 through address3
- The registrant's street address, to a maximum of three lines of information.
- addressField1 through addressField3
- Customizable fields.
- addressType
- Type of address, valid values are configurable by using a properties file: S (shipto), B (billto), and SB (both shipto and billto). A single address may be of different types. If a properties file cannot be found, a default of SB will be used.
- bestCallingTime
-
- D=An indicator that daytime is the best time to call the registrant.
- E=An indicator that evening is the best time to call the registrant.
- billingCode
- The registrant's organization's code to identify the shipping or billing addresses and cost center.
- billingCodeType
- Code designating the method of code structure used for the billing code. The default value is D, assigned by buyer. The value 02 indicates that it is assigned by Ariba.
- city
- The name of the city where the registrant resides.
- country
- The name of the country or region where the registrant resides.
- email1
- The registrant's primary e-mail or Web address.
- email2
- The registrant's secondary e-mail or Web address.
- fax1
- The registrant's primary facsimile number.
- fax2
- The registrant's secondary facsimile number.
- firstName
- The first name of the registrant.
- lastName
- (Required if the authentication mode is LDAP) The last name of the registrant. If the authentication mode is LDAP, this parameter is mandatory.
- middleName
- The middle name of the registrant.
- organizationName
- The name of the organization that the registrant represents.
- organizationUnitName
- The name of the unit within the organization that the registrant represents.
- packageSuppression
-
- 1=An indicator to include package inserts when the order is shipped
- 0=An indicator to not include package inserts when the order is shipped
There is no default for this field. If the field is left unused, it remains null in the database.
- personTitle
- The title of the user whose address is being entered (for example, Dr., Rev., Mr. or Ms.).
- phone1
- The registrant's primary phone number.
- phone1Type
- The type of phone used for the registrant's primary phone number, for example TTY for hearing impaired, PCM for pulse-coded modulation, or CEL for mobile. This is a field of 3 characters.
- phone2
- The registrant's secondary phone number.
- phone2Type
- The type of phone used for the registrant's secondary phone number, for example TTY for hearing impaired, PCM for pulse-coded modulation, or CEL for mobile. This is a field of 3 characters.
- publishPhone1
-
- 1=An indicator that the registrant's primary phone number is listed
- 0=An indicator that the registrant's primary phone number is unlisted
There is no default for these publishPhone fields. If the field is left unused, it remains null in the database.
- publishPhone2
-
- 1=An indicator that the registrant's secondary phone number is listed
- 0=An indicator that the registrant's secondary phone number is unlisted
- shippingGeoCode
- A shipping code based on geographical region, especially useful with tax software.
- state
- The name of the state, province, or equivalent where the registrant resides.
- taxGeoCode
- A tax code based on geographical region, especially useful with tax software.
- zipCode
- The ZIP or postal code of the registrant's address.
Note: In addition to the above parameters, you can define custom attributes or parameters to this command. These custom member attributes can be added, deleted, or changed. The syntax for the custom parameters is &attributeName_storeName_action_number=value
where:
- attributeName
- The name of the custom attribute or parameter you have defined.
- storeName
- The name of the store for which the attributeName applies.
- action
- Specifies whether the attributeName can be replaced (in which case, specify r) or deleted (in which case, specify d).
- number
- In the case of multi-valued attributeNames, specify this parameter to assign multiple entries with the same attributeName, storeName, or action.
- value
- The value that you want to assign to the attribute.
The following are examples of syntax for customer attributes or parameters:
- The following example updates the database with the value of red for a defined customer attribute for the user's favorite color within store 10001:
&favoritecolor_10001_r_1=red - The following example updates the database two attributes: in store 10001, the user's favorite color is red, and if in store 10002, the user's favorite color is blue: &favoritecolor_10001_r_1=red&favoritecolor_10002_r_1=blue
- The following example deletes an attribute from store 10001: &favoritecolor_10001_d_1=red
Example 1
The following example registers a B2C user
https://myhostname/webapp/wcs/stores/servlet/UserRegistrationAdd? logonId=user1&logonPassword=pass&logonPasswordVerify=pass&URL=MallFrontView
Example 2
The following example registers a B2B user under the Default Organization by specifying the distinguished name as the value for the parentMember parameter.
https://myhostname/webapp/wcs/stores/servlet/UserRegistrationAdd? logonId=b2buser1&logonPassword=pass&logonPasswordVerify=pass&profileType=B &parentMember=o=Default Organization,o=Root Organization&URL=MallFrontView
Example 3
The following example registers a B2B user under the Default Organization by specifying the encrypted orgEntityId as the value of the parentMember parameter.
https://myhostname/webapp/wcs/stores/servlet/UserRegistrationAdd?logonId=b2buser1 &logonPassword=pass&logonPasswordVerify=pass&profileType=B &parentMember=fpqG/Uw9Pdw=&URL=MallFrontView
Behavior
- Calls an empty task command called PreUserRegistrationAddCmd. Store Developers can overwrite it to change the input to the command.
- Updates the record of the current guest user in the USERS table and changes the registration type from 'G' (guest) to 'R' (registered) and populates the distinguished name (DN).
- Creates a new record in the USERREG table. If the authentication mode is LDAP, the logonId field in the USERREG table stores the distinguished name of the user. The logon password is only stored on the LDAP server, not in the USERREG table. Member relationship information is stored in MBRREL table.
- If one or more fields related to the USERPROF, BUSPROF or USERDEMO tables are specified, a new record will be created in these tables; otherwise, no record will be created.
- If one or more fields related to the ADDRESS table are specified, a self address (also called a register address, with the selfAddress field set to '1' and the nickname is the same as the logonId) will also be created. Otherwise, no record will be created in the ADDRESS table. Each user can only have one self address.
- Calls the ProcessParentMemberCmd task command to validate the parentMember. If the parentMember is null, the default parent is the Default Organization (that is, the orgEntityId = -2000). If the parentMember is not null, it can take two different types of values:
- Encrypted orgEntityId (that is, using "wcs_encrypt -e orgentityid ")
- Distinguished name of the organization or organizational unit (such as "o=Default Organization or o=Root Organization").
- Calls the ProcessProfileTypeCmd task command to determinate and validate the profileType. If the profileType is not specified, and the parentMember is not specified or if it is the Default Organization, by default, the profileType is set to 'C' and a B2C user will be created. If the profileType is not specified and the parentMember is not the Default Organization, by default, the profiletype is set to 'B' and a B2B user will be created.
- Calls the AuthenticationPolicyCmd task command to verify or update a user's credentials.
- If preferredCurrency is not specified, the default is the preferred currency in command context.
- If a new address needs to be created but the addressType is not specified, the default is 'SB' (shipping and billing address).
- Checks the required registration information parameters.
- Calls the AuditUserRegistrationCmd task command to check additional parameters. Store Developers need to add new code to the AuditUserRegistrationCmd task command if they want to customize the check.
- Calls the SetCurrencyPrefCmd task command to set preferred currency to command context.
- Calls the UserRegistrationRoleAssignCmd task command to assign roles during self-registration. This command requires customization needs to be overriden by a Store Developer to enable role assignment during self-registration.
- If the authentication mode is 'LDAP', a user entry will be created on the LDAP server.
- Calls an empty task command called PostUserRegistrationAddCmd. Store Developers can overwrite it to perform additional operations.
- If the command fails, the UserRegistrationErrorView view command is called. Upon successful completion, the specified URL is called.
- Reads the MemberRegistrationAttributes.xml file. Specifically, it reads the <UserRoles> element and applies the roles that have a qualifier of registrationQualifier="UserRegistration".
- Applies the roles that have the qualifier 'UserRegistration'. The MemberRegistrationAttributes.xml file lists the default roles that the customer will play (for example, a registered customer in the store to which they are registering). The Site Administrator can configure this file to assign roles based on the organization to which the user registers and the store from which they are registering. Additional roles can be applied using the Organization Administration Console.
Note: WebSphere Commerce does not support the concurrent login of two or more users that log in using the same user ID. For example, consider the scenario where two users at a company regularly share an account at a store. Suppose the first user is on the store's payment page, and just before submitting his or her order, the second user logs in. The following is what will take place:
- Browser one ... User 1 logs in as user "xyz"; adds an item to the shopping cart.
- Browser two ... User 2 logs in as user "xyz" as well, and goes to the shopping cart page and then proceeds to checkout.
- Browser one ... User 1 clicks on checkout, but is informed that he or she has been logged off.
- Browser two ... User 2 completes the checkout, as normal.
Another scenario is when businesses use a common user ID for their employees to shop at a B2B store. Either only one user should use the common user ID at a given time, or each user should be setup with their own user ID, or else one of the users will likely not complete their transactions.
Exception conditions
- If the URL parameter is null, the system throws an exception with the message key _ERR_CMD_MISSING_PARAM
- If the length of the value of the URL parameter equals 0, the system throws an exception with the message key _ERR_CMD_INVALID_PARAM.
- If the logonId parameter is null, the system throws an exception with the message key _ERR_CMD_MISSING_PARAM.
- If the length of the value of the logonId parameter equals 0, the system throws an exception with the message key _ERR_CMD_INVALID_PARAM.
- If the logonId already exists in database, the system throws an exception with the message key EC_UREG_ERR_LOGONID_EXISTS.
- In LDAP mode, if the formulated distinguished name (DN) already exists on the LDAP sever or the WebSphere Commerce database, the system throws an exception with the message key _ERR_RDN_ALREADY_EXIST.
- If the logonPassword parameter is null, the system throws an exception with the message key _ERR_CMD_MISSING_PARAM.
- If the length of the value of the logonPassword parameter equals 0 or if it is greater than 70, the system throws an exception with the message key _ERR_CMD_INVALID_PARAM.
- If the logonPasswordVerify parameter is null, the system throws an exception with the message key _ERR_CMD_MISSING_PARAM.
- If the logonPassword value is not equal to the logonPasswordVerify value, the system throws an exception with the message key EC_UREG_ERR_PASSWORDS_NOT_SAME.
- If the profileType parameter is not null, and it is not equal to 'B' or 'C', the system throws an exception with the message key _ERR_CMD_INVALID_PARAM.
- If the parentMemberId value is not null, and it is not a foreign key set to the ORGENTITY table, the system throws an exception with the message key _ERR_CMD_INVALID_PARAM.
- If the preferredCurrency value is not null, and it is not a foreign key set to the SETCCURR table, the system throws an exception with the message key _ERR_CMD_INVALID_PARAM.
- If the preferredLanguage value is not null, and it is not a foreign key set to the LANGUAGE table, the system throws an exception with the message key _ERR_CMD_INVALID_PARAM.
- If the any of the following parameters: age, income, children, household, demographicField6, publishPhone1, publishPhone2, or packageSupression, are not null and are not integers, the system throws an exception with the message key _ERR_CMD_INVALID_PARAM.