Skip to main content

Customer export for Magento 2

[missing screenshot: confluence_logo_new.png]

Exported customer data

Customer-level information

NetSuite fieldMagento fieldDetails
externalIdemail_storeId, i.e. paul.grigoruta@rocketweb.com_1
entityId
email_storeId, i.e. paul.grigoruta@rocketweb.com_1This 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
firstNamecustomer first name
lastNamecustomer last name
middleNamecustomer middle name
phonecustomer telephone
faxcustomer fax
vatRegNumbercustomer taxVat field
stage-Always set to "_customer"
isPerson-Always set to "true"


Address fields

NetSuite fieldsMagento fieldsDetails
defaultShippingis default shipping
defaultBillingis default billing
addresseecustomer first name + customer last name
addr1Street1
addr2Street2
cityCity
zipPostCode
stateRegionCodeNote 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.
countrycountryIdTransformed from ISO to the format NetSuite requires
telephonetelephoneWill default to customer telephone if no entry is supplied in the address
faxfaxWill 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):

  1. by netsuite_internal_id custom customer attribute
  2. by externalIdString

  3. by email

  4. 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.