OrgEntityAdd URL

This command registers a new organization or organizational unit.

This command registers a new organization or organizational unit. Information for new organizations or organizational units are stored in the MEMBER, ORGENTITY, MBRREL, and ADDRESS database tables.

Use this command with SSL (Secure Sockets Layer) to ensure that the information are encrypted. To do so type the command with the HTTPS secure protocol.

URL 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.
orgEntityName
Required: The name of the organization or organizational unit.
Leading and trailing spaces will be trimmed. When the system is configured with LDAP, the following characters are not allowed when the orgEntityName is used to construct the distinguished name:
  • The # character occurring at the beginning of orgEntityName.
  • Any of the following characters: = , + " \ < > ;
orgEntityType
Required: The type of the organizational entity being added.
O
Organization
OU
Organizational Unit
parentMemberId
Required if orgEntityType equals 'OU': The member ID of the parent organizational entity where the new organizational entity will be added. For an organization (orgEntityType=O), this parameter is not mandatory; it defaults to Root Organization.
distinguishedName
DN of the organization or organizational unit, for LDAP use.
administratorFirstName
The first name of the administrator.
administratorLastName
The last name of the administrator.
administratorMiddleName
The middle name of the administrator.
businessCategory
Describes the kind of business performed by an organization or organizational unit.
description
A description of the registrant.
legalId
Registered organization identifier; may be null for an organizational unit.
orgEntityField1 through orgEntityField3
Customizable fields.
taxPayerId
A string used to identify the user for taxation, especially useful with tax software.
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.
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.
preferredDelivery
The registrant's preferred mode of delivery.
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.
Custom member attributes
You can manage custom member attributes (MBRATTRVAL table) for this organization using the following syntax: &attributeName_storeId_action_number=value

Where:

attributeName
The name of the custom attribute that has already been defined in the NAME column of the MBRATTR table.
storeId
The store ID of the store for which the attributeName applies. Specify "null" if the attribute is not store specific
action
Specifies the action to perform with the value:
a
add value
r
replace value
d
delete value
number
In the case of multi-valued attributeNames, specify this parameter to assign multiple entries with the same attributeName, storeId, 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 adds a custom attribute named "OrgEntitySize" with the value of "100". It is not store specific, so the "storeId" attribute is set to "null":
    &OrgEntitySize_null_a_1=500
  • The following example updates two custom attributes named "OrgEntityOwners" with the values of "Smith" and "Brown", for store 10001.
    &OrgEntityOwners_10001_r_1=Smith&OrgEntityOwners_10001_r_2=Brown

Example 1

The following example adds an organization named IBM under the Root Organization. The Root Organization has an organization entity ID of -2001.

https://myhostname/webapp/wcs/stores/servlet/OrgEntityAdd?   
orgEntityName=IBM&orgEntityType=O&parentMemberId=-2001&URL=MallFrontView

Example 2

The following example adds an organization unit named Commerce, and associated address information for Commerce, under an existing organization with an entity ID of 7000000000000000001.

https://myhostname/webapp/wcs/stores/servlet/OrgEntityAdd?   
orgEntityName=Torolab&orgEntityType=OU&parentMemberId=7000000000000000001
    &address1=8200
Warden&city=Toronto&URL=MallFrontView

Behavior

  • Calls an empty task command called PreOrgEntityUpdateCmd. Store Developers can overwrite it to change the input to the command.
  • Checks the required parameters.
  • Calls the SetBusinessEntityCmd task command to set the BusinessEntity attribute.
  • Calls the AuditOrgEntityCmd task command to perform additional parameter checking. Store Developers need to add new code to the AuditOrgEntityCmd task command if they want to customize the check.
  • If any field related to the ADDRESS table is specified, a self address (also called a register address, with selfAddress field set to '1' and the nickname is the same as orgEntityName) will be created. Otherwise, no record will be created in the ADDRESS table.
  • Calls an empty task command called PostOrgEntityAddCmd. Store Developers can overwrite it to perform additional operations.
  • If the command fails, the OrgEntityErrorView view command is called. Upon successful completion, the specified URL is called and then

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 orgEntityType parameter is 'OU' and parentMemberId is null, the system throws an exception with the message key _ERR_CMD_MISSING_PARAM.
  • If the parentMemberId parameter 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 orgEntityName parameter is null, the system throws an exception with the message key _ERR_CMD_MISSING_PARAM.
  • If the length of the value of the orgEntityName parameter equals 0, the system throws an exception with the message key _ERR_CMD_INVALID_PARAM.
  • If the orgEntityType parameter is null, the system throws an exception with the message key _ERR_CMD_MISSING_PARAM.
  • If the orgEntityType parameter is not 'O' or 'OU', the system throws an exception with the message key _ERR_CMD_INVALID_PARAM.
  • If the formulated DN already exists, on the LDAP server in LDAP mode or the WebSphere Commerce database, the system throws an exception with the message key _ERR_RDN_ALREADY_EXIST.
  • If the distinguishedName specified already exists, on the LDAP server in LDAP mode or WebSphere Commerce database, the system throws an exception with the message key _ERR_DN_ALREADY_EXIST.