-
Notifications
You must be signed in to change notification settings - Fork 2
Customer Synchronization
The package includes customer export and person-customer import. Company synchronization and Adobe Commerce B2B account membership are not included.
The customer_save_after observer queues a customer export only when integration and customer export are enabled, no skip flag is active, and the customer has placed an order. Registration alone does not normally export a customer.
Order export independently resolves or creates the NetSuite customer, including for guest orders. Disabling the customer-save export flag does not remove that dependency from order export. When an existing customer is found during order export, that lookup can return its ID without resending the full profile on every order.
The actual external ID format is email_storeId, using Magento's store ID. The original book contains both store-ID and website-ID descriptions; this version calls getStoreId().
For an order's customer, resolution proceeds through the linked netsuite_internal_id, external ID, email, then contact email before creating a customer. The standalone customer-save processor first searches by external ID and uses add/update handling. Do not assume its matching path is identical to the order path.
Email fallback can associate records across store contexts. Customer import also looks up by NetSuite ID and then email without an explicit website filter. Test duplicate email addresses across websites before adopting this mapping for a multi-website store.
| NetSuite data | Store source or behavior |
|---|---|
externalId, entityId
|
Email and store ID; entity ID is omitted on update. |
| First/last/middle name and salutation | Customer name and prefix; first and last names are limited to 32 characters. |
| Email, VAT registration | Customer email and tax/VAT value. |
| Phone/fax | Customer or address data; phone normalization removes non-digits and rejects fewer than seven digits. |
| Stage/person | Customer stage, isPerson=true. |
| Company name | Billing-address company text where available; this does not create a B2B company entity. |
| Price level | Customer-group price-level mapping. |
| Address book | Default shipping/billing flags, addressee, street, city, region code, postal code, country and phone. |
Address export uses replaceAll=true. NetSuite-only address-book edits can be lost when the store exports a customer. Agree which system owns customer data when enabling both directions.
Customer Settings > Magento Address Id Field names a custom NetSuite address field used for the connector's address identity. Set it explicitly: the mapper reads mageos_netsuite/customer/magento_address_id_field, while the shipped address_id default is under customers_import/magento_address_id_field. The names differ. The export path also writes a hash into the address's netsuite_internal_id, while the setup patch declares that attribute as an integer; address identity needs project validation.
The package adds customer-group NetSuite metadata and a Price Level Mapping configuration. The shipped map includes example group IDs 1 and 2 mapped to price levels 5 and 6. Replace these with account-specific mappings. This is not a general NetSuite group import or B2B price-list synchronization.
Enable getting customer data from NetSuite and configure Customer Import Settings. A record must be a person customer and have an email. If NetSuite Customer "Export to Magento" Field Id is set, that custom field must evaluate as true. Without it, there is no custom-checkbox restriction. The export plugin sets that configured checkbox to true on customer payloads.
Import resolves an existing customer by NetSuite ID, then email. It updates email, names, NetSuite ID, and the address list. The configured default store, website derived from it, and customer group are assigned on new customer creation. Despite the admin comment, the mapper does not reset store/group on every update.
Address import maps country/region, postal code, street, city, and phone, with configured fallback values. Defaults include US, City Not Set, Street Not Set, postal code 12000, and phone 123456789. Confirm the actual data rather than allowing placeholder addresses into operational use.
The Required Address Fields validation has a null-check defect in this revision and should not be treated as reliable validation of incomplete addresses. See Known limitations.
New imported customers receive imported_pwd_not_set. Optional login/registration messages point them to the store's forgotten-password flow, and a successful password reset clears the flag. Passwords are not imported from NetSuite. Verify these messages with the store's actual login templates and authentication extensions.
# NetSuite customer internal ID
bin/magento netsuite:utils:processrecord --type=customer_import --id=123
# Magento customer entity ID
bin/magento netsuite:utils:processrecord --type=customer_export --id=456These are direct processing commands. They do not have the same observer checks as an ordinary customer save. Use the correct ID type and verify the result in both systems.
Sources: customer observer, customer export, customer mapper and matching, customer import, import mapper, address mapping, address setup, account messages.
Mage-OS Labs · Source · Reviewed commit fec65e2 · September 9, 2026 · Validation and limitations
Mage-OS NetSuite Connector
Setup
Data flows
Operations and development