Export and import profile data
Profiles contain information about shoppers, such as their name, phone number and email address.
This section applies to Open Storefront Framework (OSF) and Storefront Classic.
You can export or import profile data, which you may have configured in your environment as outlined in Import and Export Catalog Items and Inventory, allowing you to share the data with external systems. The following section describes the fields and validation that occurs when exporting or importing profile data.
Profile export and import fields
The following table displays the profile fields that can be exported and imported:
Field | Description |
---|---|
firstName , lastName |
The name associated with the profile. This includes the first and last name, which are required during import. |
email |
The email associated with the profile. This field is required when creating a new profile. |
userSiteProperties |
This is a site level property that contains the receiveEmail
flag property for the site. It indicates if the profile is configured to receive
email. This defaults to false .
|
receiveEmail |
This is a user item level property that indicates if the profile is configured
to receive email. This defaults to false .
|
registrationDate |
This optional field indicates the date that the profile was registered. |
profileType |
The type of profile being exported or imported. If the profile type is
b2b_user , the shipping and billing addresses are not imported. If
the profile type is b2c_user , the organization is not
imported.
|
shippingAddresses |
The shipping addresses associated with the profile. There can be only one addressed denoted as the default shipping address. If phone numbers are provided in the shipping address, validation occurs to ensure they are in the correct format. Address type is an optional property, and the value is validated when provided against the setup values. Note that |
locale |
This field, which is required when creating new profiles, indicates the locale associated with the profile. Validation occurs to ensure that the locale is valid. |
roles |
The roles associated with the profile. Validation occurs to ensure that the role is available with one of the parent organizations. |
dateOfBirth |
Date of birth associated with the profile. Validation occurs in the format you have chosen, either MM/dd/yy or DD/mm/YY. |
shippingAddress , billingAddress |
Export only. The contact information for the profile. Address type is an optional property, and the value is validated when provided against the setup values. Note that |
parentOrganization |
Export only. The organization associated with the profile. The organization ID is used to associate the profile with the organization. Note: The |
Price lists (including the list and sales prices, as well as shippingSurcharge )
|
Export only. This read-only field indicates the price lists associated with the profile. |
Price list groups | Export only. This read-only field indicates the price list groups associated with the profile. |
Note that the following audience-based profile properties are read only:
lifetimeSpend
lifetimeAOV
numberOfOrders
lastPurchaseAmount
firstPurchaseDate
lastPurchaseDate
lastVisitDate
previousVisitDate
For audience-based information, see Define Audiences.
Profile validations
The following validations are performed when importing profiles:
- The buyer role of a profile, which is the default role, must be present.
- If the profile type is
b2b_user
, the shipping and billing addresses are not included. If the profile type isb2c_user
, the parent organization is not included. - The
login
field defaults to the profile’s email address. - When creating an initial import file, the
email
,locale
,firstName
andlastName
contain valid values. - The
receiveEmail
flag is disabled by default. - All phone numbers are in the correct format.
- All addresses contain a
phoneNumber
,address1
,city
,state
,country
andpostalCode
. - The
country
andstate
combination is valid. - The site properties have been set. This is the
userSiteProperties
that contains thereceiveEmail
property.
Profile approver role validations during import
When profiles are configured as approvers, specific validations occur:
If a profile is the last active approver in the organization and approval is required, or the organization has at least one order that is either in the pending_approval
or the pending_approval_template
state, the following modifications cannot be made:
- The profile approver role cannot be removed from the profile.
- The profile’s active status cannot be removed.
- The parent organization of a profile cannot be modified.
Bulk profile import with the GDPR
If you are importing profiles and want to set the European Union General Data Protection Regulation (GDPR) consent values, ensure that you have the shopper’s consent, which may have been given on the system from which you are exporting profiles. You should also set the consent date in the import file to the consent date that was recorded on the other system.
Note: If you do not have an explicit consent from the shopper, it is best that you do not set the consent fields during a bulk profile import. For detailed information on working with the GDPR, refer to the Manage the use of personal data section.
Create a new password during import
You can generate new passwords when importing profiles. When the import occurs, a token is triggered for the profile. When the shopper selects the token link, the system navigates the shopper to the change password page, where they have the option to provide their user name, and create a new password. The token is a one-time password that expires within a time frame that you configure. Generating a new token does not clear a shopper’s existing password.
To allow a shopper to request a new password, use the emailTemplate
parameter in the request. This provides the name of the email template used during the
creation of new profiles, for example, shopper_acc_reg_v1
. If an email
template is not provided, email will not be sent.
The following is a sample profile import with a new password request:
{
"fileName": "profile.zip",
"items": [
{
"id": "bulkProfileHandler",
"format": "json",
"params": {
"emailTemplate": "shopper_acc_reg_v1"
}
}
]
}
Understand triggering emails during import in a multiple site environment
When working in a multiple site environment, an email is triggered during import that contains all of the sites related to the profile. Note that up to five sites are listed per profile. Additionally, account changes, role updates, approval information, and password information is also included in the email, if applicable. All event information is displayed in a table that identifies the changes that occurred.
When you add a profile to an organization, an email with the name of previous organizations and roles, if any, are added.
Note: Email template settings are copied from the default site. They can be disabled and updated as needed.
Trigger webhook during import
When a new profile is created or an existing profile is updated during an import, a webhook can be triggered with the profile information. The production-registerProfile
webhook is triggered when a profile is created. The production-updateProfile
webhook is triggered when the profile is updated.
To trigger the webhook during import, you need to set the triggerWebHook
parameter in the request to true. For example:
{
"fileName": "profileImport.json",
"id": "Profiles",
"format": "json",
"mode": "standalone",
"params": {
"triggerWebHook": "true"
}
}
Contact email triggers with deactivated contact
profileDeactivatedEmail
template:{
"fileName": "profileImport.json",
"id": "Profiles",
"format": "json",
"mode": "standalone",
"params": {
"profileDeactivatedEmailTemplate":"re_v1"
}
}
Contact email triggers when organization list changes
While performing an import, if a parent organization or secondary organization list is modified or deleted, an email is triggered, notifying the contact of the change. However, the email is only sent if the contact is active and is a member of an organization of at least one active account, or is an account that has an assigned contract. To trigger emails during the import, set the specific email template as a parameter in the request payload.
The following example shows how you would identify using an organizationChangeEmailTemplate
template:
{
"fileName": "profileImport.json",
"id": "Profiles",
"format": "json",
"mode": "standalone",
"params": {
"profileDeactivatedEmailTemplate":"re_v1"
}
}