E-Commerce Customer Creation and Updates

Purpose: You can create or update a customer through the following e-commerce processes:

E-Commerce Order message; see Customer Selection/Creation Logic in E-Commerce Orders

E-Commerce Name/Address Change message; see Customer Creation/Update Logic in E-Commerce Name/Address Change

E-Commerce Catalog Request message; see Customer Creation/Update Logic in E-Commerce Catalog Requests

In this topic:

Customer Creation/Update Logic in E-Commerce Name/Address Change

Creating/Updating Sold To Customers in E-Commerce Customer Updates

Updating Bill To Customers in E-Commerce Customer Updates

Updating Individuals in E-Commerce Customer Updates

E-Commerce Customer Updates Response

E-Commerce Name/Address Change Message (CWAddressChg)

E-Commerce Name/Address Change Response Message (CWCchgResponse)

Customer Creation/Update Logic in E-Commerce Name/Address Change

The EC_CST_UPD job, started through Working with E-Commerce Job Control (EJCT), creates and updates customers through the e-commerce interface. The main purposes of this job:

• receive and process name and address updates for sold to, bill to, or individual customers. For example, a customer may wish to change address information if he or she moved.

• receive and process new sold to customers. For example, a customer may wish to register on the web storefront without requesting a catalog or entering an order. You cannot create a new bill to customer or individual. Note: Creating sold to customers is available for XML messages only, not name/value pair messages.

The processing_type value in the E-Commerce Name/Address Change Message (CWAddressChg) indicates if the customer information passed should create a new customer or update an existing customer.

Note: The processing_type value is available for XML messages only, not name/value pair messages.

If the processing_type value is:

C (create customer, send response): the system creates a new sold to customer, using the name and address information in the message and also sends an E-Commerce Name/Address Change Response Message (CWCchgResponse) back to the web storefront.

• The system will not create or update a bill to customer, regardless if bill to information is included in the message.

• The system will not create or update an individual, regardless if individual information is included in the message.

U (update customer, send response): the system updates an existing:

• sold to customer, using the sold to number provided in the customer_number field and also sends an E-Commerce Name/Address Change Response Message (CWCchgResponse) back to the web storefront.

• bill to customer (only if a sold to is defined in the customer_number field), using the bill to number provided in the ar_number field and also sends an E-Commerce Name/Address Change Response Message (CWCchgResponse) back to the web storefront.

• individual (only if a sold to is defined in the customer_number field), using the individual number provided in the ind_number field and also sends an E-Commerce Name/Address Change Response Message (CWCchgResponse) back to the web storefront.

Blank or a value other than C or U (update customer, no response): the system updates an existing sold to, bill to, and/or individual, but does not send an e-commerce name/address change response message back to the web storefront.

Creating/Updating Sold To Customers in E-Commerce Customer Updates

Creation sold to logic: If the processing_type value is C (create customers), the system creates a new sold to customer, using the name and address information in the new fields and sends an E-Commerce Name/Address Change Response Message (CWCchgResponse) back to the web storefront with the new customer number in the customer_number field and C (customer create) in the response_type field.

• If a number is passed in the customer_number field, the system does not create a new customer or update an existing customer. The system sends an E-Commerce Name/Address Change Response Message (CWCchgResponse) back to the web storefront with a blank response_type and 00000000000 in the customer_number field, indicating a sold to customer was not created.

• If the new customer information does not contain a valid address, the system does not create a new customer. The system sends an E-Commerce Name/Address Change Response Message (CWCchgResponse) back to the web storefront with a blank response_type and 00000000000 in the customer_number field, indicating a sold to customer was not created. A sold to address is considered invalid if:

• required address fields are missing or invalid (such as last name, company, street, zip, state, city, or country).

• the zip code and state do not match, based on SCF.

• Before creating the new customer, the system checks for a duplicate by searching for customers who have the same match code as the customer information in the message, and uses the Phone Interface Values (F70) to determine whether an exact match is required on specific name and address fields.

• If a duplicate customer is found, the system updates the customer with the changes.

• If more than one duplicate customer is found, the system updates the customer with the highest customer number.

• If the duplicate customer is a ghost customer, the system updates the target customer associated with the ghost customer instead of updating the ghost customer. Additionally, the system displays the target customer that was updated in the customer_number field in the customer update response.

• The system sends an E-Commerce Name/Address Change Response Message (CWCchgResponse) back to the web storefront with a U (customer update) in the response_type field and the existing customer number in the customer_number field.

When you create a new customer through the customer update message, the system creates the new customer in the Customer Sold To file. The current and original mail type fields are set to S (suspect). The system applies formats to the sold to phone numbers, as specified at the Work with Telephone Number Format Screen.

Example: The E-Commerce Name/Address Change Message (CWAddressChg) contains the following sold to customer values to create a new sold to customer.

Field

Value passed

Sold to created

company_code

555

555

customer_number

 

 

processing_type

C

 

new_prefix

MS

MS

new_fname

GINGER

GINGER

new_initial

A

A

new_lname

MCSTAY

MCSTAY

new_busres

R

R

new_address1

1829 SOUTH ST

1829 SOUTH ST

new_apartment

APT 47

APT 47

new_city

BLAIR

BLAIR

new_state

NE

NE

new_zip

68008

68008

new_country

USA

USA

new_email

gmcstay@att.net

gmcstay@att.net

new_day_phone

508 652 9489

508 652 9489

new_eve_phone

978 632 2724

978 632 2724

allow_rent

1

Y

allow_email

1

Y

allow_mail

1

Y

new_opt_in

O1

O1

new_user_field_1

12/30

12/30

new_user_field_2

Y

Y

new_user_field_3

 

 

new_user_field_4

 

 

Update sold to logic: If the processing_type value is U (update customers), blank, or a value other than C, the system updates an existing customer, using the customer number provided in the customer_number field in the E-Commerce Name/Address Change Message (CWAddressChg) to find the existing customer.

• If a number is not passed in the customer_number field or the number is invalid, the system does not search for a customer; no existing customer is updated and a new customer is not created.

• If the customer_number is a ghost customer, the system updates the target customer associated with the ghost customer instead of updating the ghost customer. Additionally, the system displays the target customer that was updated in the customer_number field in the customer update response.

• If the processing_type value is U, the system sends an E-Commerce Name/Address Change Response Message (CWCchgResponse) back to the web storefront with the updated customer number in the customer_number field and U (customer update) in the response_type field. If a customer was not updated, the system sends the message with a 000000000000 customer_number and blank response_type, indicating an existing customer was not found.

All name and address information must be specified in the new fields in the message or it will be overwritten with blanks. For example, to change just the street address, the request must still include the complete, existing customer name, city, state, and any other address and phone information. However, if the new_user_fields in the message are blank, the system will not update the existing user fields defined for the customer to blank; the existing user fields are updated only if the new_user_fields in the message contain values.

Example: The E-Commerce Name/Address Change Message (CWAddressChg) contains the following sold to customer values to update an existing sold to customer.

Field

Existing sold to

Value passed

Updated sold to

company_code

555

555

555

customer_number

244

244

244

processing_type

 

U

 

new_prefix

 

MS

MS

new_fname

KAREN

KAREN

KAREN

new_initial

A

A

A

new_lname

LETENDRE

BOTTGER

BOTTGER

new_busres

R

R

R

new_address1

11 SANFORD ST

109 TURNER LN

109 TURNER LN

new_apartment

FRONT

 

 

new_city

MEDWAY

TEMPLETON

TEMPLETON

new_state

MA

MA

MA

new_zip

02053

01468

01468

new_country

USA

USA

USA

new_email

kletendre@att.net

kbottger@att.net

kbottger@att.net

new_day_phone

508 626 2600

508 652 9489

508 652 9489

new_eve_phone

508 626 2460

978 632 2724

978 632 2724

allow_rent

Y

N

N

allow_email

Y

Y

Y

allow_mail

N

Y

Y

new_opt_in

O2

O1

O1

new_user_field_1

12/30

 

12/30

new_user_field_2

 

Y

Y

new_user_field_3

 

 

 

new_user_field_4

 

 

 

Customer ownership: You can create or update customer ownership records for the sold to customer using the CustomerOwnership element in the E-Commerce Name/Address Change Message (CWAddressChg). Customer ownership allows you to capture and confirm information about the products a customer currently owns or previously owned.

The system looks at the Company, Customer #, and Ownership ID fields in the Customer Ownership file to determine if the customer ownership record passed in the name/address change message is a new record or updated record.

• If the company, customer number, and ownership ID values on the name/address change message match a record in the Customer Ownership file, the system updates the Active flag, Entry date, Confirm date, and Description fields for the existing customer ownership record.

• If the company, customer number, and ownership ID values on the name/address change message do not match a record in the Customer Ownership file, the system creates a new customer ownership record for the sold to customer.

If a value is not defined for the cust_own_ID field, the system creates a customer note indicating the customer ownership record was not created/updated: Missing Ownership ID: Ownership Description. The system does not place the e-commerce name/address change message in an error status because of customer ownership errors.

See Working with Customer Ownership for more information on creating and updating customer ownership records for a sold to customer.

Updating Bill To Customers in E-Commerce Customer Updates

The processing_type value in the E-Commerce Name/Address Change Message (CWAddressChg) indicates if the customer bill to information passed should update an existing bill to customer. You cannot create a new bill to customer using the customer update message.

Note: The bill to customer is identified as the ar customer in the customer update message.

If the processing_type value is:

C: the system will not create or update a bill to customer.

U: the system updates an existing bill to customer, using the bill to number provided in the ar_number field, only if an existing sold to customer number is defined in the customer_number field.

• If an existing sold to customer is not defined in the customer_number field, the system will not update the bill to customer.

• If a bill to number is not defined in the ar_number field, the system does not check for a duplicate customer; a bill to customer is not updated.

• Regardless if a bill to customer is updated or not, the system sends an E-Commerce Name/Address Change Response Message (CWCchgResponse) back to the web storefront. The response_type is C if the bill to was updated and blank if the bill to was not updated. However, the customer_number defined in the customer update response is the sold to customer, not the bill to customer.

blank or value other than C or U: the system updates an existing bill to customer, using the bill to number provided in the ar_number field.

• If a bill to customer does not exist for the ar_number provided, the system does not update or create a bill to customer.

• The system does not send an e-commerce customer update response message to the web storefront.

Note: If you update a bill to customer and also create or update a sold to customer in the same e-commerce name/address change message, the system does not assign the bill to customer to the sold to customer.

Example: The system updates the bill to customer whose number matches the ar_number in the name/address change message. All name and address information must be specified in the ar fields in the message or it will be overwritten with blanks. For example, to change just the street address, the request must still include the complete, existing bill to name, city, state, and any other address and phone information.

Field

Existing bill to

Value passed

Updated bill to

company_code

555

555

555

processing_type

 

 

 

ar_number

17

17

17

ar_prefix

 

DR.

DR.

ar_fname

STAN

STANLEY

STANLEY

ar_initial

 

J

J

ar_lname

KASS

KASS

KASS

ar_suffix

 

 

 

ar_company_name

FAMILY DENTAL

FAMILY DENTAL CARE

FAMILY DENTAL CARE

ar_street_address

434 OLD CONN

434 OLD CONN PATH

434 OLD CONN PATH

ar_address_2

 

RM 202

RM 202

ar_city

FRAMINGHAM

FRAMINGHAM

FRAMINGHAM

ar_state

MA

MA

MA

ar_country

USA

USA

USA

ar_zip

01701

01701

01701

ar_day_phone

508 533 8038

508 533 8038

508 533 8038

ar_eve_phone

 

508 533 8038

508 533 8038

ar_email_address

skass@familydental.com

kass@familydental.com

kass@familydental.com

ar_opt_in

O4

O1

O1

ar_print_statement

Y

1

Y

Updating Individuals in E-Commerce Customer Updates

The processing_type value in the E-Commerce Name/Address Change Message (CWAddressChg) indicates if the individual information passed should update an existing individual. You cannot create a new individual using the customer update message.

Note: The individual is identified as the ind customer in the customer update message.

If the processing_type value is:

C: the system will not create or update an individual.

U: the system updates an existing individual, using the individual number provided in the ind_number field, only if an existing sold to customer number is defined in the customer_number field.

• If an existing sold to customer is not defined in the customer_number field, the system will not update the individual.

• If an individual number is not defined in the ind_number field, the system does not check for a duplicate customer; an individual is not updated.

• Regardless if an individual is updated or not, the system sends an E-Commerce Name/Address Change Response Message (CWCchgResponse) back to the web storefront. The response_type is C if the individual was updated and blank if the individual was not updated. However, the customer_number defined in the customer update response is the sold to customer, not the individual.

blank or value other than C or U: the system updates an existing individual, using the individual number provided in the ind_number field, only if an existing sold to customer number is defined in the customer_number field.

• If an existing sold to customer is not defined in the customer_number field, the system will not update the individual.

• If an individual does not exist for the ind_number provided, the system does not update or create an individual.

• If an individual number is not defined in the ind_number field, the system does not check for a duplicate customer; an individual is not updated.

• The system does not send an e-commerce name/address change response message to the web storefront.

All name and address information must be specified in the ind fields in the message or it will be overwritten with blanks. For example, to change just the street address, the request must still include the complete, existing individual name, city, state, and any other address and phone information. However, if the ind_user_fields in the message are blank, the system will not update the existing user fields defined for the individual to blank; the existing user fields are updated only if the ind_user_fields in the message contain values.

Example: The system updates the individual whose number matches the ind_number in the customer update message.

Field

Existing individual

Value passed

Updated individual

company_code

555

555

555

customer_number

354 (associated sold to)

354

354

processing_type

 

U

U

ind_number

1

1

1

ind_dept

SRV

ENG

ENG

ind_position

DOC

DOC

DOC

ind_prefix

 

 

 

ind_fname

KAREN

KAREN

KAREN

ind_initial

 

A

A

ind_lname

LETENDRE

BOTTGER

BOTTGER

ind_suffix

 

 

 

ind_day_phone

508 652 9489

508 652 9489

508 652 9489

ind_eve_phone

508 652 2600

978 632 2723

978 632 2723

ind_fax_phone

 

 

 

ind_email_address

kletendre@att.net

kbottger@att.net

kbottger@att.net

ind_opt_in

O4

O1

O1

ind_mail_flag

N

1

Y

ind_rent_flag

N

1

Y

ind_user_field_1

12/30

 

12/30

ind_user_field_2

 

Y

Y

ind_user_field_3

 

 

 

ind_user_field_4

 

 

 

E-Commerce Customer Updates Response

If the processing_type field in the E-Commerce Name/Address Change Message (CWAddressChg) contains a C (create sold to customer) or U (update customer), the system sends an E-Commerce Name/Address Change Response Message (CWCchgResponse) back to the web storefront.

Note: The e-commerce name/address change response message is available for XML messages only, not name/value pair messages.

This message indicates:

company_code: the company where the customer was created or updated.

customer_number: the sold to customer that was created or updated. A 000000000000 customer_number indicates the sold to customer was not created or updated (for example, a customer number was passed for a customer create or an existing sold to customer was not found for a customer update).

response_type:

C: the customer was created

U: the customer was updated

• blank: a customer was not created or updated

If the processing_type field in the customer update message is blank or a value other than C or U, the system does not send a name/address change response message to the web storefront.

SO10_03 CWDirect 18.0.x 2018 OTN