Overview
Customer Category records from iPaaS.com can be synchronized into Magento using a manual sync method. This mapping supports the synchronization of Customer Category data from iPaaS into Magento via the Customer Group API.
Mapping Collection Status
Mapping Status: Enabled.
Trigger Events: The sync is triggered manually or when a Customer Category record is created or updated in iPaaS.
ID Format: When manually syncing, the correct iPaaS Customer CategoryID must be entered (e.g., Customer Category TestCategoryId with ID 10001 must be entered as 10001).
Conflicting Mappings: This mapping applies only to Customer Category records. Ensure no other mappings target the same Magento entity to prevent data from being overwritten.
System Caveats
iPaaS Caveats
In Magento, a Customer Category must have at least one valid Each customer category name in iPaaS must be unique to avoid overwriting existing Magento customer categories.
Ensure the category names correspond to valid Magento groups or segments to maintain consistent classification.
Magento Caveats
Magento requires each customer category (group) to have a unique Code and a valid TaxClassId.
If no matching TaxClassId is found for the provided name, the sync will fail.
The ExcludeWebsiteIds field must follow Magento’s accepted format for site exclusions (array of website IDs).
Setup Requirements
iPaaS Configuration
Name: Required field; serves as the display name for the customer category.
Category Records: Ensure each category entry includes a unique name before sync.
Magento Configuration
Code: Must correspond to the internal Magento code used for the customer group.
TaxClassId: Should match an existing tax class ID within Magento.
ExcludeWebsiteIds: Optional field; used to define which websites are excluded from this category.
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
Retrieve Data: Get Customer Category data from iPaaS.
Map Fields: Map Customer Category data to Magento 2 fields, applying any dynamic formulas.
Apply Dynamic Logic: Execute formulas for deriving TaxClassId and excluded website mappings.
Apply Overrides: Apply static or computed values as needed during mapping.
Customer Category
Mapping Type | Source Field (iPaaS) | Destination Field (Magento) | Description |
Field | EmailAddress |
| |
Field | FirstName | FirstName |
|
Dynamic Formula |
| GroupId | Retrieves the first category name from the Categories list. Calls GetCategoryIdByName(categoryName) to fetch the corresponding category ID. Converts the returned ID to integer using ConvertToInt(id) and returns it. |
Field | LastName | LastName |
|
Field | M2_Magento_Status (custom field) | Status | A custom field is used to map the status, and its value should be entered as 1. The data type is number, so it will not accept boolean values like true or false. |
Dynamic Formula |
| CompanyId | The code asynchronously calls the GetCompanyIdByName(Company) method to retrieve the company ID based on the provided name. It stores the result in the id variable. It then returns the company ID by converting it to an integer using the ConvertToInt(id) method. Company field is under Customer Category in iPaaS Customer Categories can only be added to companies through automation. Removals must be performed manually in Magento. |
Field | M2_Magento Job Title (custom field) | JobTitle | A custom field is used to map the job title, and its value should be entered as 'ADMIN' (static). |
Dynamic Formula |
| Telephone | This mapping helps to locate the first address of iPaaS in the Addresses collection where "IsPrimaryBilling" is true and return the "PhoneNumber" field from that matched address. |
Error Handling
Missing Name Fields
Description: The required “Name” field is missing.
Resolution: Provide a valid category name in iPaaS.
Invalid TaxClassId
Description: No TaxClassId found for provided Name.
Resolution: Ensure the Tax Class exists in Magento before syncing.
Invalid Website ID Format.
Description: ExcludeWebsiteIds not provided in array format.
Resolution: Validate formula output or fix mapping configuration.
Testing & Validation
Validation Checklist
Category name correctly maps to Magento Code.
Dynamic formula for TaxClassId retrieves correct ID.
ExcludeWebsiteIds properly excludes defined sites.
Test Scenarios
Sync New Category: Add a new category in iPaaS (e.g., “Wholesale”) and confirm it appears in Magento with the correct TaxClassId.
Update Existing Category: Modify the name or exclusion websites and ensure Magento updates accordingly.
Missing Field Validation: Attempt sync without Name or with an invalid TaxClassId, verify that proper error messages appear.
Additional Notes
Customer categories are foundational for customer segmentation in Magento.
