How do I edit customer address books using CSV?
Export and import customers and addresses using two CSV files in the Control Panel and check key fields before importing.
CSV management of customer address books
Customer address book rows are exported and imported as a CSV file using the Export Addresses and Import Addresses profiles in the Data Exchange view. Always edit the exported file first to ensure that the columns and existing address identifiers are preserved correctly.
Export customer address books to a CSV file
CSV editing of customer addresses starts from the Data Exchange view at /data-exchange . Select the Address Export profile and download the exported file. The export includes all shipping and billing addresses from the customer register, one address book row for each CSV row.
Keep the original export as a backup and make your edits on the copy. Do not build the header row manually, as the import only allows known columns and will block the entire preview if there is an unknown or duplicate column in the headers.
Address file columns
The customer address book CSV file uses the following columns:
-
address_key: address book row ID -
customer_key: customer ID -
entry_gender,entry_company,entry_firstname,entry_lastname -
entry_street_address,entry_postcode,entry_city,entry_state -
entry_vatid: Business ID of the address -
entry_country_code: two-letter ISO country code -
entry_comments: address bar comment
The import also accepts the internal headers address_book_id and customers_id , but address_key and customer_key headers in the export file are a safe format for return import. customer_key or customers_id is required for each row of data.
Update an existing address
The existing customer address is updated by keeping the same customer_key and address_key in the row as in the export. Edit only the desired entry_* fields. If a column is included in the file, its value will be included in the update, so before importing, also check the fields you did not intend to change.
The import only updates the address when address_key belongs to the customer_key of the row. If the address belongs to a different customer, the preview flags the row as an error and blocks the entire execution; the row is not simply skipped. If a positive address_key does not match any existing address, it is classified as a new address. Therefore, identifiers should not be invented or changed manually.
Add a new address bar
A new address line is added by providing the existing customer_key and leaving address_key blank. Fill in at least the name, street address, postal code, city and country information necessary for the purpose. entry_country_code is given as a well-known two-letter ISO country code.
An empty or mismatched address ID is classified as an addition. Always use an empty address_key value for an intentional addition so that the file does not incorrectly appear to be an update of an existing address. Changing or adding a country resets the address's region ID, after which the region must be reset in the customer's address data if necessary.
Preview and import addresses
Customer addresses are imported using the Address Import profile in the Data Exchange view. Upload the edited CSV and preview each row to see if it is classified as an addition, update, or error. Only import when there are no error rows.
An unknown customer, an address belonging to another customer, an unknown country code, a missing customer column, an unknown column, or a duplicate header will prevent the execution. No rows will be partially applied. A successful execution reports the number of rows inserted, updated, skipped, and failed. During the execution, each accepted row is written in its own database transaction.
Change default shipping or billing address
To change a customer's default shipping or billing address in the Control Panel, open Customers at /customers , select the customer, and use the address book functions Set shipping address as default , Set billing address as default , or Use shipping address for billing . The address line must first exist in the customer's address book.
There is a Customer Export in the data exchange, but a corresponding general customer import profile has not been implemented. Therefore, default addresses cannot be changed with CSV import. If the billing address has not been set separately, the customer will also use the shipping address as the default for invoicing.
Check addresses after import
After importing customer addresses, open a few added and updated customers in the Customers view. Check the address book for the name, company, street address, postal code, city, country, and possible business ID. Also, make sure that the address belongs to the correct customer.
If you added a new address, re-export the addresses to capture the new address_key value provided by the system. Check for each customer that at least one address remains in the address book and that the shipping and billing assumptions point to the intended rows. Save the import summary and error report for possible refunds or further investigation.