Import address data

By using this plugin, you can perform bulk imports of addresses for shopper-based and account-based profiles.

You can integrate your account-based and customer-based data with an external system.

Import address data

The import address plugin allows you to synchronize address data between Commerce and an external system. This plugin allows you to perform the following:

  • Import data from an external system in JSON and CSV format in standalone or bundle modes, similar to other bulk plugins.
  • Work with custom attributes and address types.
  • Delete addresses for an account or profile using the importOperationCode attribute.
  • Identify an address as the default shipping or billing address for an profile or account using the isDefaultBillingAddress and isDefaultShippingAddress attributes.

The following is an example of a bulk address import record:

{ 
"contactInfo": [ 
  {
   "address1": "21 Cedar Ave",
   "city": "Syracuse",
   "country": "US",
   "createdBy": "admin",
   "firstName": "Kim",
   "id": "se-980031",
   "importOperationCode": "create",
   "isDefaultBillingAddress": true,
   "isDefaultShippingAddress": true,
   "lastName": "Anderson",
   "parentId": "110026",
   "phoneNumber": "212-555-1977",
   "postalCode": "13202",
   "state": "NY",
   "parentType": "contact",
   "addressType": [
     "at100105",
     "at100106"
   ]
  }
]
} 

Note that:

  • Export is not supported.
  • To link an address to a account-based contact, the contact must to have the profileAddressManager role.

You can link an address to a profile or account by providing the following properties in the data file:

Property Name Type Description Required
address1 string The first address line of the address. Yes
address2 string The second address line of the address. No
address3 string The third address line of the address. No
addressType array The predefined values for this property can contain address types such as shipping or billing. For account address types, this property is required. However, for profile address types, if no address type is provided, it defaults to a generic value.
city string The city of the address. Yes
companyName string The company name associated with the address. No
country string The country code of the address. Yes
county string The county of the address. No
createdBy string Creator of the address. No
externalAddressId string The ID used by the external system to identify the address. Ensure that this field contains a unique externalAddressId. No
externalParentId string The external ID of the parent address. For contact address types, this ID is provided by the customerContactId property, for account address types, it is provided by the externalOrganizationId property. Ensure that this field contains valid a externalOrganizationId value. No. However, if the parentId property is not provided, an externalParentId is required.
faxNumber string The fax number associated with the address. No
firstName string The first name of the profile associated with the address. No
id string The ID of the address being imported. Ensure that this field contains a unique addressId. Yes
importOperationCode string

The following values are supported:

merge (default): Creates a new record if no matching record is found, otherwise it updates the record.

create: Creates the record. If a matching record is found, an error is generated. Can be used for performance gains for new records.

delete: Deletes the record.

No
isDefaultBillingAddress boolean This flag is set to true if the address being imported is the default billing address of the parent. No
isDefaultShippingAddress boolean This flag is set to true if the address being imported is the default shipping address of the parent. No
middleName string The middle name of the profile associated with the address. No
parentId string The ID of the parent address. Ensure that this field contains valid profileId and organizationId values. No. However, if the parentId property is not provided, an externalParentId is required.
parentType string

The type of the parent address.

This can be set to either contact or account, depending on which address is being linked.

Yes
phoneNumber string The phone number associated with the address. No
postalCode string The postal code of address. Yes
prefix string The prefix associated with the address. No
province string The province code of the address. No
state string The state code of the address. Yes
suffix string The suffix associated with the address. No