Skip to main content

Magento Simple Product from iPaaS

Transfer simple products from iPaaS to Magento

Updated over 2 weeks ago

Overview

Magento Simple Product can be transferred from iPaaS.com using an Add/Update sync method. This mapping supports the automated synchronization of Simple Product records from iPaaS into Magento via the Simple Product API.

Mapping Collection Status

  • Mapping Status: Enabled.

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

  • ID Format: When manually syncing, the Simple Product ID from iPaaS is used.

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

Custom Field Support

Description
Custom fields from the source system can be mapped or retrieved in iPaaS.com flows if additional information (such as external identifiers or attributes) is required during the sync.

To transfer custom field data to iPaaS.com, use the following formula:
return GetValueFromCustomField(AdditionalProperties, "[CustomFieldId]");

This function retrieves the value of a custom field using its ID in the From iPaaS.com flow.

Supported Child Collections

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

  • Simple Product Inventory: Maps inventory updates.

  • Simple Product Units: Maps unit details.

System Caveats

Magento Caveatst

  • Simple Products require a valid SKU and Name; otherwise, creation will fail.

  • AttributeSetId must reference a valid attribute set (default: 4).

  • Price, TaxClassId, and Visibility must be valid Magento values.

  • Stock management fields (Qty and IsInStock) must align with Magento’s stock model.

iPaaS.com Caveats

  • Automatically prevents syncing of products with excluded SKUs, such as “GC-TEST-100”.

  • Supports conditional logic for stock and pricing calculations using custom fields.

  • Handles date and numeric conversions using iPaaS dynamic formulas.

Setup Requirements

Magento Configuration

  • Sku: Unique identifier for the product.

  • AttributeSetId: Numeric reference to the attribute set (e.g., 4 = Default).

  • Price / SpecialPrice: Product pricing data; must be numeric.

  • Visibility: Defines product visibility scope (4 = Catalog & Search).

  • TypeId: “simple” for Simple Product creation.

  • TaxClassId: References Magento’s defined tax classes.

iPaaS.com Configuration

  • TrackingMethod: Must equal “Product” for inclusion.

  • Sku: Unique product code.

  • Custom Fields: May include Cost, URLKeyMethodOverride, and AlwaysInStockOverride.

  • SalePrice / DefaultPrice: Used to calculate SpecialPrice dynamically.

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: iPaaS collects product records matching the defined filter criteria.

  2. Filter Products: Records with TrackingMethod == "Product" and Sku != "GC-TEST-100" are included.

  3. Map Fields: Core product fields such as SKU, Name, Price, and Stock are mapped to Magento.

  4. Assign Defaults: AttributeSetId, Visibility, and TypeId are statically assigned.

  5. Sync to Magento: Validated data is sent via Magento Product API for creation.

Mappings

Parent Collection: Magento Simple Product From iPaaS

Mapping Filter

TrackingMethod =="Product" && !(Sku == "GC-TEST-100")

Mapping Type

Source (iPaaS.com)

Destination (Magento)

Field

Magento PriceTier_FormattedData (custom field)

Pricing_6 (custom field)

Field

Sku

Sku

Field

Name

Name

Static

4

AttributeSetId

Dynamic Formula

CoalesceToDecimal(DefaultPrice,SalePrice)

Price

Lookup Translation

Status

Static

4

Visibility

Static

simple

TypeId

Dynamic Formula

CurrentDateTime()

CreatedAt

Dynamic Formula

Coalesce(Weight, "1")

Weight

Dynamic Formula

if ( GetCustomFieldValue(CustomFields, "Kit Item") == "True" ) { return await SumKitParentQuantityAsync("available",Id); } else { var result = await SumInventoryForProductAsync(Id); return Floor(result); }

StockItemQty

Dynamic Formula

if ( GetCustomFieldValue(CustomFields, "Kit Item") == "True" ) { var result = await SumKitParentQuantityAsync("available",Id); var result2 = Floor(result); (result2 <= 0 ? return false; : return true;) } else { var result = await SumInventoryForProductAsync(Id); var result2 = Floor(result); (result2 <= 0 ? return false; : return true;) }

StockItemIsInStock

Field

Parent Always In Stock (custom field)

AlwaysInStockOverride

Field

Parent URL Key Method (custom field)

UrlKeyMethodOverride

Lookup Translation

TaxClassId

Dynamic Formula

GetCustomFieldValue(CustomFields, "Parent Last Cost")

Cost

Dynamic Formula

(SalePrice < DefaultPrice && SalePrice > 0) ? SalePrice : null

SpecialPrice

Dynamic Formula

var keepExisting = new List<int> { -1 }; var exCategories = await ConvertCategoriesToMagentoIdsAsync(Categories); (GetCustomFieldValue(CustomFields, "Parent Item") == "True" ? return keepExisting; : return exCategories;)

CategoryIds

Mapping Notes

PriceTier Formatted Data Note

For each Magento customer group, create a Subscription Custom Field in iPaaS with the format:

  • Pricing_{Magento-Customer-Group-ID}:

Example: If the Magento customer group ID is 3, the field name should be Pricing_3.

To find this ID in Magento:

  1. Login to Magento.

  2. Go to Customers > Customer Groups.

  3. Find and note the Customer Group ID for the group you want to target.

The value for the Pricing_{Customer-Group-ID} field must be in this format:

[price],[Sales Type],[Sales Code],[Item no],[Item Description],[Unit of Measure],[Minimum Quantity],[Starting Date],[Ending Date]

NOTE:

  • The first index (price) is required.

  • The seventh index (Minimum Quantity) is required.

Example Value: 100.00,Online,Retail,SKU123,Product A,Each,10,2025-01-01,2025-12-31|90.00,Online,Retail,SKU123,Product A,Each,20,2025-01-01,2025-12-31

This example defines two pricing tiers:

  • Tier 1: $100.00 for quantity 10

  • Tier 2: $90.00 for quantity 20

M2 Simple Product Inventory From iPaaS (Child Collection)

Mapping Type

Source (iPaaS.com)

Destination (Magento)

Lookup Translation

SourceCode

Dynamic Formula

if ( GetCustomFieldValue(Parent.CustomFields, "Kit Item") == "True" ) { return await SumKitParentQuantityForSingleLocationAsync("available", Parent.Id, LocationId); } else { return Floor(QtyAvailable.Value); }

Quantity

Dynamic Formula

decimal result = 0M; if ( GetCustomFieldValue(Parent.CustomFields, "Kit Item") == "True" ) { result = await SumKitParentQuantityForSingleLocationAsync("available", Parent.Id, LocationId); } else { result = QtyAvailable.Value; } (Floor(result) <= 0 ? return 0; : return 1;)

Status

M2 Simple Product Units From iPaaS (Child Collection)

Mapping Type

Source (iPaaS.com)

Destination (Magento)

Field

Name

UnitName

Field

Conversion

UnitConversion

Field

DefaultPrice

UnitPrice

Dynamic Formula

var customOverride = GetCustomFieldValue(CustomFields, "Parent Alternate Unit Barcode"); if (customOverride != null && customOverride != "" && Parent.TrackingMethod != "Variant") { return ChildBarcodeOverrideField("upc_code",customOverride); } else { return null; }

UnitBarcodeParentOverride

Lookup Translation

M2 Simple Product Status From iPaaS

Source (iPaaS.com)

Destination (Magento)

Preorder

1

Active

1

Disabled

2

M2 Simple Product Tax Class From iPaaS

Source (iPaaS.com)

Destination (Magento)

None

0

Taxable Goods

2

true

2

M2 Simple Product Inventory Source Code From iPaaS

Source (iPaaS.com)

Destination (Magento)

LocationId==LocationIdFromName("MAIN").Value

MAIN

LocationId==LocationIdFromName("EAST").Value

EAST

LocationId==LocationIdFromName("STORAGE").Value

STORAGE

Error Handling

Collection: Product (Parent)

Missing SKU

  • Description: SKU is required for product creation.

  • Resolution: Ensure each iPaaS record includes a valid SKU.

Invalid AttributeSetId

Description: The provided AttributeSetId does not exist in Magento.

Resolution: Verify that the AttributeSetId (e.g., 4) exists.

Stock Formula Failure

  • Description: The stock calculation returned null or invalid data.

  • Resolution: Check AlwaysInStockOverride custom field logic.

Category Assignment Failure

  • Description: The CategoryIds value is invalid or not found.

  • Resolution: Ensure that referenced categories exist in Magento.

Validation Rules & Testing

Validation Checklist

  • Product SKU and Name exist and are unique.

  • AlwaysInStockOverride field applied correctly.

  • Category and Tax Class mappings resolve successfully.

  • Weight and pricing values are numeric and non-null.

Test Scenarios

  1. Create a simple product with valid SKU: Product should be created successfully.

  2. Create a product with Sku == "GC-TEST-100": Product should be excluded by filter.

  3. Provide AlwaysInStockOverride = true: Product should appear in stock regardless of quantity.

  4. Provide invalid TaxClassId: Expect “Tax Class Resolution Failure.”

Additional Notes

  • Ensure all Lookup Translations (e.g., Status, Tax Class) are correctly configured in iPaaS.

Did this answer your question?