Customer export for Magento 2
Exported customer data
Customer-level information
| NetSuite field | Magento field | Details |
|---|---|---|
| externalId | email_storeId, i.e. paul.grigoruta@rocketweb.com_1 | |
entityId | email_storeId, i.e. paul.grigoruta@rocketweb.com_1 | This is the "link" field, records that produce the same ids will be considered the same entity. If a customer orders as logged in, then as anonymous with the same email address, both orders will be tied to the same customer entity. |
salutation | customer prefix | |
| firstName | customer first name | |
| lastName | customer last name | |
| middleName | customer middle name | |
| phone | customer telephone | |
| fax | customer fax | |
| vatRegNumber | customer taxVat field | |
| stage | - | Always set to "_customer" |
| isPerson | - | Always set to "true" |
Address fields
| NetSuite fields | Magento fields | Details |
|---|---|---|
| defaultShipping | is default shipping | |
| defaultBilling | is default billing | |
| addressee | customer first name + customer last name | |
| addr1 | Street1 | |
| addr2 | Street2 | |
| city | City | |
| zip | PostCode | |
| state | RegionCode | Note that for states to be exported properly, they must be defined in NetSuite accordingly. While this is not an issue for US, it may be one for other countries. If you find out that specific customers cannot be exported due to states not being defined, make sure the NetSuite information at Setup->Company->States/Provinces/Countries matches the one in Magento. |
| country | countryId | Transformed from ISO to the format NetSuite requires |
| telephone | telephone | Will default to customer telephone if no entry is supplied in the address |
| fax | fax | Will default to customer fax if no entry is supplied in the address |
Customer identifier
In Magento, the customer identifier is the email address and website id, i.e. multiple customers with the same email may exist on different websites if configured. To prevent integrity constraints, we use email_websiteId for the externalId field in NetSuite, i.e. john@example.com_1 . While the site suffix may be unnecessary for some merchants, it is there to fully support all Magento configurations. Note that the email without suffix is still stored in the email field, on which NetSuite does not impose a unique constraint.
When exporting the customer we try to resolve the existing customer in the following order (we query NetSuite for each of these):
- by netsuite_internal_id custom customer attribute
by externalIdString
by email
by contact email
Customer export & sync time
To honor the concept of "customer" in NetSuite, customers are not pushed from Magento when registering, but when placing their first order. After this point, customer data will be pushed again when:
- placing another order
- changing account information
Since customer data can be edited in the Magento front-end, it will always be pushed to NetSuite when changed. This means that any manual edits for the customer in NetSuite will be lost, if affecting the address book, name, or email.
No comments to display
No comments to display