Skip to main content

Magento Customer To iPaaS

Synchronize Magento customer data to iPaaS customers

Updated over 2 weeks ago

Overview

This document outlines the configuration for automatically synchronizing customer records from the Magento Customer entity to the iPaaS Customer entity. The integration uses an API-based sync that triggers whenever a customer record is created or updated in Magento.

Mapping Collection Status

  • Mapping Status: Enabled.

  • Trigger Events: The sync is triggered by the creation or update of customers in Magento.

  • ID Format: When manually syncing, the Customer ID from iPaaS is used. This can be resolved via an external ID.

  • Conflicting Mappings: This mapping applies only to Customers. Ensure no other mappings target the same Magento entity to prevent data from being overwritten.

Supported Child Collections

The integration supports the synchronization of the parent customer and its related child collections:

  • Customer Address: Transfers customer address details.

System Caveats

Magento Caveats

  • Ensure that all required fields (FirstName, LastName, and Email) are populated before syncing.

  • Magento allows multiple addresses, but only one address can be set as default billing or shipping.

iPaaS Caveats

  • iPaaS requires a valid CustomerNumber as a unique identifier for each record.

  • Duplicate email addresses are not allowed.

  • If a Magento record lacks a primary address, iPaaS will still create the customer record, but the address child collection will remain empty until valid data is received.

Setup Requirements

Magento Configuration

  • Ensure each customer record contains valid first and last names.

  • Default billing and shipping addresses must be assigned to support child mapping.

iPaaS Configuration

  • Each customer in iPaaS must have a unique CustomerNumber.

Authentication & Security

  • Magento2 API UserName: Used to access iPaaS API for fetching Company and related data.

  • Magento2 API Key: Used to access iPaaS API for fetching Company and related data.

Integration Flow

  1. Retrieve Data: Fetch customer data from Magento.

  2. Map Fields: Map Magento customer fields to iPaaS destination fields.

  3. Map Addresses: Fetch associated customer addresses and map them through the child collection.

  4. Sync Data: Push customer and address information to iPaaS, maintaining ID relationships.

Mappings

Customer (Parent)

Mapping Type

Source Field (Magento)

Destination Field (iPaaS)

Field

Id

CustomerNumber

Field

FirstName

FirstName

Field

LastName

LastName

Field

Email

EmailAddress

Customer Address (Child Collection)

Mapping Type

Source Field (Magento)

Destination Field (iPaaS)

Field

FirstName

FirstName

Field

LastName

LastName

Dynamic Formula

(Street.Count > 0 ? Street[0] : Coalesce(Street, ""))

Address1

Dynamic Formula

(Street.Count > 1 ? Street[1] : "")

Address2

Dynamic Formula

(Street.Count > 2 ? Street[2] : "")

Address3

Field

City

City

Dynamic Formula

Region.Region

Region

Field

CountryId

Country

Field

PostCode

PostalCode

Field

DefaultBilling

IsPrimaryBilling

Field

DefaultShipping

IsPrimaryShipping

Error Handling

Missing Customer ID

Customer ID not found in Magento.

  • Description: The Magento record does not contain a valid ID.

  • Resolution: Verify that the record exists in Magento and has a valid Id field before syncing.

Missing Required Fields

One or more required fields (FirstName, LastName, Email) are empty.

  • Description: The record cannot be processed because mandatory data is missing.

  • Resolution: Populate all required fields in Magento before initiating sync.

Duplicate Email Address

Duplicate email address found.

  • Description: iPaaS does not allow multiple customers with the same EmailAddress.

  • Resolution: Update duplicate records in Magento to ensure each customer has a unique email.

Address Mapping Failure

Default billing or shipping address not defined.

  • Description: Magento record lacks a primary address, causing address mapping to fail.

  • Resolution: Assign at least one default billing or shipping address before syncing.

Validation Rules & Testing

Validation Rules

  • Each customer record successfully mapped to iPaaS.

  • Required fields (CustomerNumber, FirstName, LastName, EmailAddress) populated correctly.

  • Default billing and shipping addresses mapped accurately.

  • Region and postal code formulas return correct values.

Test Scenarios

  1. New Customer Sync: Add a new customer in Magento and trigger sync to iPaaS. Verify creation with correct CustomerNumber and addresses.

  2. Update Existing Customer: Modify customer details (e.g., name or email) in Magento and confirm iPaaS reflects the update.

  3. Address Validation: Add or update addresses in Magento, ensuring billing/shipping flags sync correctly.

  4. Error Simulation: Attempt sync with a missing email address and verify that error handling triggers correctly.

Additional Notes

  • The parent (Customer) collection must always sync before the child (Address) collection.

  • Region fields are derived dynamically to ensure compatibility with iPaaS region structure.

  • DefaultBilling and DefaultShipping must be set correctly in Magento to maintain address accuracy in iPaaS.

  • Email address uniqueness is mandatory to prevent integration conflicts.

Did this answer your question?