AddressAdd URL
This command adds a new address entry for a user or organization.
Use this command with SSL (Secure Sockets Layer) to ensure that the member's logon password and personal 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 Transaction server and the configuration path.
Parameter values
- langId
- Sets or resets the preferred language for the duration of the session; the supported languages for a store are found in the STORELANG table.
- forUser
- The logon ID of the user or organization on whose behalf the command will be run; only a person with the authority to process orders can specify this parameter.
- forUserId
- Same as forUser, but identifying the user by the internal user ID, as found in the USERS table.
- memberId
- If memberId is not specified, then the default is the current user (the user who is logging on). This parameter can be used to add addresses for organization entities or other users.
- URL
- Required: The URL to be called when the command completes successfully.
- businessTitle
- The company position of the person whose address is being added (for example, President or Manager).
- nickName
- Required: The nickname or identifier of the address being added. A member can have a collection of addresses, each with a nickname. The address that a user provides when registering is treated by the system as the registrant's own address and the system sets the nickname of that address to the user's logon ID.
- personTitle
- The title of the user whose address is being entered (for example, Dr., Rev., Mr. or Ms.).
- lastName
- The last name of the user.
- firstName
- The first name of the user.
- middleName
- The middle name or initial of the user.
- organizationName
- The organization that the user represents.
- organizationUnitName
- The name of the unit within the user's organization.
- officeAddress
- The organizational internal address (for example, mail stop).
- primary
- Whether the given address is a primary address for a particular address type:
- 1
- primary
- 0
- not primary (the default)
- addressType
- The type of address; for example:
- S
- ship-to
- B
- billing
- SB
- ship-to and billing (the default)
- address1
- The first address line of the user's street address.
- address2
- The second address line of the user's street address.
- address3
- The third address line of the user's street address.
- city
- The name of the city where the user resides.
- state
- The name of the state, province, or equivalent where the user resides.
- zipCode
- The ZIP or postal code of the user's address.
- country
- The name of the country or region where the user resides.
- bestCallingTime
- Whether to call the user in the day or the evening:
- mobilePhone1
- The registrant's mobile phone number used for SMS, for example, 4161235555.
- mobilePhone1Country
- The country code used for the registrant's mobile phone number, for example, CA for Canada.
- phone1
- The user's primary phone number.
- phone1Type
- The type of phone used for the user'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.
- publishPhone1
- Whether to list the user's primary phone number:
- 1
- yes
- 0
- no
- phone2
- The user's secondary phone number.
- phone2Type
- The type of phone used for the user'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.
- publishPhone2
- Whether to list the user's secondary phone number:
- 1
- yes
- 0
- no
- fax1
- The user's primary facsimile number.
- fax2
- The user's secondary facsimile number.
- email1
- The user's primary e-mail or Web address.
- email2
- The user's secondary e-mail or Web address.
- billingCode
- The buyer organization's code to identify the shipping or billing addresses and cost center.
- billingCodeType
- The code designating the method of code structure used for the billing code. The default value is D, assigned by buyer.
- taxPayerId
- A string used to identify the user for taxation, especially useful with tax software.
- packageSuppression
- Whether to include package inserts when the order is shipped:
- 1
- include
- 0
- do not include
- addressfield1 through addressfield3
- Customizable fields.
- shippingGeoCode
- A shipping code based on geographical region, especially useful with tax software.
- taxGeoCode
- A tax code based on geographical region, especially useful with tax software.
- outAddressName
- If outAddressName=s is specified (where s is any string), then s= <address_id> will be put as one of the response properties after the command is executed, where <address_id> is the ID of the address being added or updated.
Example 1
The following example adds an entry to the address table using the nickname "mother_address."
https://myhostname/webapp/wcs/stores/servlet/AddressAdd?
nickName=mother_address&address1=7+Elm+St.&city=Toronto&state=Ontario
&country=Canada&zipCode=M4M+2T1&lastName=Lee&URL=/
Example 2
The following example adds a complete billing address.
https://myhostname/webapp/wcs/stores/servlet/AddressAdd?URL=basemall.jsp&nickName=msur1nickB
&addressType=B&primary=1&personTitle=Dr&lastName=last&firstName=first
&middleName=middle&address1=address1&address2=address2
&address3=address3&city=Toronto&state=Ontario&country=Canada
&zipCode=A1A1A1&phone1=111-111-1111&phone2=222-222-2222
&phone1Type=PHN&phone2Type=TTY&publishPhone1=1&publishPhone2=0
&bestCallingTime=E&fax1=333-333-3333&fax2=444-444-4444
&email1=msur1nickB@email1.com&email2=msur1nickB@email2.com
&businessTitle=bustitle&organizationName=organization
&organizationUnitName=oraganizationunit&officeAddress=officeaddress
&packageSuppression=0&addressField1=field1&addressField2=field2
&addressField3=field3&billingCode=billingCode&billingCodeType=BT
&shippingGeoCode=shippinggeocode&taxGeoCode=taxgeocode
Note:
For temporary and permanent addresses, every member can have a collection of addresses. When an
address is created, its status is marked with a "P", meaning "permanent", and indicating the current
address. When an address is updated, a new record of the address is created with the updates. The
new record is marked with a "P" and the earlier record is marked with a "T", meaning "temporary",
and indicating the historical address.
When an address is deleted with the AddressDelete command, its status is marked with a "T".
Behavior
- For each address type, there can be zero or one primary address (the primary field equals to 1). If the new address is primary, then this command will change the existing primary address in this address type (if one exists) to not-primary.
- If the parameter primary is not specified, the default value is 0 (not primary).
- If the parameter addressType is not specified, the default value is 'SB' (ship-to and billing).
- Check whether the specified nickname is already in use.
- Call the AuditAddressCmd task command to perform additional parameter checking. Store Developers need to add new code to the AuditAddressCmd task command if they want to customize the check.
- Create an new address in the ADDRESS table.
- If the member does not have an address book, then a new record is created in the ADDRBOOK table.
- If the command fails, the AddressErrorView command is called.
- Upon successful completion, call the specified URL.
- By default, the command will validate that the string lengths of the property values are less than or equal to the default size of the corresponding database column. An ECApplicationException is thrown if the maximum length is exceeded. This validation can be disabled by adding the following section within the <MemberSubSystem> element in the instance configuration file: <Address PropertyLengthValidation="false" />
Exception conditions
- The parameter URL cannot be null and it must have a length greater than 0.
- The parameter nickName must be non-null, must have length greater than 0, and must not already exist in this address book.
- The parameter primary must be either null or it must be equal to 0 or 1.
- The parameters publishPhone1, publishPhone2, and packageSuppression must be either null or they must be an integer.
- The error handler captures the error code, which can be any one of the following errors.
Explanation Error Code URL parameter is missing _ERR_CMD_MISSING_PARAM URL parameter is empty string _ERR_CMD_INVALID_PARAM nickName is missing _ERR_CMD_MISSING_PARAM (5020) nickName is empty _ERR_CMD_INVALID_PARAM (5030) primary is specified and is not equal to 0 or 1 _ERR_CMD_INVALID_PARAM (5017) publishPhone1 is specified and is not an integer _ERR_CMD_INVALID_PARAM (5170) publishPhone2 is specified and is not an integer _ERR_CMD_INVALID_PARAM (5180) packageSuppression is specified and is not an integer _ERR_CMD_INVALID_PARAM (5190)