AddressUpdate URL

This URL updates the address entry for a user.

This command updates the address entry for a user. If the addressId parameter is not provided, the AddressAdd command is called to add a new address. 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 WebSphere Commerce 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.
URL
Required: The URL to be called when the command completes successfully.
addressId
Required: The reference number of the address to be updated.
businessTitle
The company position of the user whose address is being updated (for example, President or Manager).
personTitle
The title of the user whose address is being updated (for example, Dr., Rev., Mr. or Ms.).
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, the 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:
D
daytime
E
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

The following example updates an address book entry for the address with ID 128 so that it includes the first name Jeffery.


     https://myhostname/webapp/wcs/stores/servlet/AddressUpdate?
    
addressId=128&firstName=Jeffery&URL=/webapp/wcs/stores/servlet/

Behavior

  • The AddressUpdate command cannot update other member's addresses and cannot update a temporary address.
  • For each address type, there can be zero or one primary address (primary field equals to 1). If the update is to change this address to primary from non-primary, then this command will change the existing primary address in this address type (if one exists) to not-primary.
  • The nickname cannot be updated.
  • If the Authentication Mode is LDAP and this address is the registration address (selfAddress = 1), then update the information of this address on the LDAP server.
  • Call the AuditAddressCmd task command to perform additional parameter checking. Store Developers need to add new code to AuditAddressCmd task command if they want to customize the check.
  • Inserts a new address into the ADDRESS table with the specified nickname. The old address is marked as temporary, and the new address is marked as permanent.
  • 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 must be non-null and it must have a length greater than 0.
  • The parameter addressId must be non-null and it must point to a address in the ADDRESS table which belongs to the current user and is not a temporary address.
  • The parameter nickName should be same as the old nickname if there is nickName parameter specified.
  • 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 _ERR_CMD_INVALID_PARAM
    addressId is empty or non-existent _ERR_CMD_INVALID_PARAM (5015)
    addressId refers to temporary address _ERR_UPDATE_TEMPORARY_ADDRESS (5006)
    nickName is specified and is not equal to existing _ERR_UPDATE_NICKNAME
    primary is specified and is not equal 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)