Customer Related Object Types
Customer
A customer is somebody who has created a customer account in the store. The customer XML file contains standard customer data (name, street, address, etc) and Customer Profile Attributes. For security reasons, a customer’s credit card cannot be imported or exported.
Sample XML:
<customers>
<customer store_code="SNAPITUP" user_id="alana.abercombie@elasticpath.com" guid="0A618B76-CDAA-B3F4-7F57-AA2773638240">
<status>1</status>
<first_time_buyer>false</first_time_buyer>
<creationDate>2010-06-16T00:00:00-07:00</creationDate>
<last_edited>2010-06-16T00:00:00-07:00</last_edited>
<password>f9708c2c03e485b937d430c479e88cb579871f15f97a4fb28e7c3b1f9d669fc1</password>
<salt>c8a03968f60a1e94db8718eea7529f7bf2a5263ff1d5c4d660014cabc5643f1d</salt>
<addresses>
<address guid="2B057A60-C6C3-24B0-163F-20D8965E8A41">
<last_name>Abercombie</last_name>
<first_name>Alana</first_name>
<phone_number>4313895083</phone_number>
<street1>1020 Main Street</street1>
<street2></street2>
<city>Santa Cruz</city>
<subCountry>CA</subCountry>
<zip_postal_code>52844</zip_postal_code>
<country>US</country>
<commercial>false</commercial>
</address>
</addresses>
<sessions/>
<groups>
<group>400</group>
</groups>
<preferred_shipping_address>2B057A60-C6C3-24B0-163F-20D8965E8A41</preferred_shipping_address>
<preferred_billing_address>2B057A60-C6C3-24B0-163F-20D8965E8A41</preferred_billing_address>
<credit_cards/>
<payment_methods>
<credit_card/>
<payment_token>
<payment_token_display_value/>
<payment_token_value/>
<payment_token/>
</payment_methods>
<default_payment_method>
<credit_card/>
</default_payment_method>
<customer_profile>
<profile_value type="AttributeType_ShortText" key="CP_EMAIL">alana.abercombie@elasticpath.com</profile_value>
<profile_value type="AttributeType_ShortText" key="CP_FIRST_NAME">Alana</profile_value>
<profile_value type="AttributeType_ShortText" key="CP_PREF_LOCALE">en</profile_value>
<profile_value type="AttributeType_Date" key="CP_DOB">Sun Feb 23 00:00:00 1941</profile_value>
<profile_value type="AttributeType_ShortText" key="CP_PHONE">4313895083</profile_value>
<profile_value type="AttributeType_ShortText" key="CP_GENDER">F</profile_value>
<profile_value type="AttributeType_Boolean" key="CP_ANONYMOUS_CUST">false</profile_value>
<profile_value type="AttributeType_ShortText" key="CP_LAST_NAME">Abercombie</profile_value>
</customer_profile>
</customer>
...
</customers>
Payment Methods
Generic Payment Methods
The payment_methods
collection element has the ability to take a mixture of payment methods. Currently we support both credit cards and payment tokens. The credit card element specified in the collection is identical to the legacy credit card element in the collection of credit_card
elements. The default value on a credit card specified in the payment_methods collection element is ignored because a default_payment_method
element now exists on customer.
Default Payment Method
The default payment method element wraps a default payment method which can currently be either a payment_token
or credit_card
. This payment method is set as the default payment method on a customer imported into the system.
Backwards Compatibility
The legacy credit_cards
collection element is still supported and can be used to import credit cards on a customer. An exported customer will however populate the payment_methods
collection element with all customer payment methods and the credit_cards
collection element will always be empty for newly exported customers.
The billing address on customer credit cards is no longer supported. Thus, the billing_address_guid
element is deprecated. If used, it will be ignored by the Import-Export tool.
Customer Profile Attribute
Customer profile are a set of information collected by the store for customer.
For example, the customer attribute CP_DOB, shown below, is the attribute for storing the customer’s date of birth. See how the CP_DOB customer profile attribute is used in the customer XML file example.
Sample XML:
<customerprofile_attributes>
<attribute>
<key>CP_DOB</key>
<name>Date of Birth</name>
<usage>CustomerProfile</usage>
<type>Date</type>
<multilanguage>false</multilanguage>
<required>false</required>
<multivalue>false</multivalue>
<global>false</global>
</attribute>
...
</customerprofile_attributes>