Skip to main content
Magento 2 Connection and Settings

Integrate iPaaS.com with Magento 2 to enable seamless data transfer for customers, transactions, and products, ensuring accurate inventory and order management.

Updated over 3 weeks ago

How to Connect

Prerequisites

Before initiating the connection, confirm the following Magento-specific prerequisites:


Magento Version Support:

  • The template mappings utilize Magento 2 Multi-Source Inventory (MSI), introduced in Magento version 2.3.3+. Other versions of Magento 2 have not been officially tested or supported.

  • Ensure your Magento version is 2.3.3 or higher before proceeding.

Multi-Source Inventory (MSI) Configuration:

  • If using custom inventory sources, MSI must be configured within Magento 2. The default configuration may not suffice for integrations involving multiple locations.

Custom Attribute Sets:

  • Create and configure custom attribute sets in Magento 2 if needed, prior to transferring products. Attribute sets cannot be changed once assigned to a product in Magento 2.

  • If modifications are necessary, perform the following:

    • Create the new attribute set manually in Magento 2.

    • Assign the first product to the new attribute set.

    • Perform a reindex and cache flush in Magento 2 to avoid invalidating configurable products and their associated variants.
      Failure to perform these steps can leave products in an unusable state. More information is available in this Azure bug report.

Webhooks Setup:

  • Magento 2 does not natively support webhooks and requires a third-party extension.
    For example:

Stock Reservation Handling:

Magento 2 API Requirements:

  • Ensure the Magento 2 API functions normally as described in the official Magento 2 API Documentation.

  • APIs must be fully operational to support integration with iPaaS.com.

  • OAuth and input limits are increased as described below


Allow OAuth Tokens as Bearer Tokens

  • In your Magento Admin Dashboard, navigate to:
    Stores > Configuration > Services > OAuth > Consumer Settings .

  • Change the setting Allow OAuth Access Tokens to be used as standalone Bearer tokens to "Yes" and save.

  • Optionally, the CLI may be used:

bin/magento config:set oauth/consumer/enable_integration_as_bearer 1

Increase API input limits

  • If input limits are enabled, you may need to increase the API input limits as described in https://developer.adobe.com/commerce/webapi/get-started/api-security/

  • To confirm if input limits are enabled, in your Magento Admin Dashboard, navigate to:
    Stores > Configuration > Services > Magento Web Api > Web Api Input Limits .

  • If enabled, increase the input list limit to a large value such as 9999. This is required for iPaaS.com to add a large number of product attributes, such as colors for clothing products for example.


Generate Magento API Credentials

  • In your Magento Admin Dashboard, navigate to:
    System > Extensions > Integrations.

  • Create a new integration and ensure the following credentials are generated:

    • Consumer Key

    • Consumer Secret

    • Access Token

    • Access Token Secret

  • Make sure the token permissions are set to "full access."

  • After saving the integration, click "Activate" from the table view of integrations.

Input Credentials into iPaaS

  • In iPaaS, go to the Subscription Settings for Magento.

  • Fill in the following fields with the values from Magento:

    • Magento API URL

    • Magento API Integration Key (Enter the Access Token here).

  • Once the credentials are filled in, save the configuration and test the connection to ensure successful authentication.

Supported Transfer Types

The following transfer types are supported for the Magento 2 integration and have been incorporated into the template mappings:

  • Magento 2 Customer to iPaaS: Add and update customers and addresses.

  • iPaaS Product Category to Magento 2: Add and update categories, as well as product category assignments

  • iPaaS Product to Magento 2: Add and update products and inventory, including support for gridded/variant type products and alternate units

  • Magento 2 Transaction to iPaaS: Add or update Orders and add deposit tickets

Ensure that the appropriate mappings are configured for each transfer type in iPaaS.

Translation Collections

Magento 2 integrations in iPaaS use template mappings that include the following predefined translations. These mappings must be modified for each implementation to ensure proper functionality:

Payment Method Mapping

  • M2 Transaction Payment Method To iPaaS:
    Maps common Magento 2 payment methods to iPaaS payment methods.
    Example: Magento 2 payment methods are mapped to CASH by default and will need to be modified for your implementation.

Inventory Source Code Mapping

  • M2 Product Inventory Source Code From iPaaS

  • M2 Variant Inventory Source Code From iPaaS

Important Notes:

  • These source code translations must be updated to map Counterpoint location names to Magento 2 inventory sources.

  • Example formula: LocationId=LocationIdFromName("MAIN").Value
    This maps the Counterpoint location "MAIN" to the Magento 2 inventory source main.

  • Default Value: A default value is provided as a catch-all. However, Magento 2 requires a 1:1 mapping between iPaaS inventory locations and Magento 2 inventory sources. If you need a many-to-one mapping, configure the inventory mapping collections to filter and combine quantities using available formulas. Failure to do so will result in missing external IDs, causing future inventory updates to fail.

Custom Attribute Sets

For product transfers, you must configure a translation mapping to select the appropriate product attribute set based on custom fields or other product information.

Steps to Configure Custom Attribute Sets:

  1. Add a custom translation for attribute sets in Magento 2.

  2. Modify the following template mappings to reflect the new attribute set configuration:

    • M2 Simple Product Add Only From iPaaS

    • M2 Simple Product Update Only From iPaaS

    • M2 Configurable Product Add Only From iPaaS

    • M2 Configurable Product Update Only From iPaaS

    • M2 Simple Associated Product Variant Add Only From iPaaS

    • M2 Simple Associated Product Variant Update Only From iPaaS

  3. Update the mapping for AttributeSetId to align with the custom translation.

Customer Mapping Collections

Magento 2 integration includes basic customer transfer functionality to iPaaS. The template mappings provided ensure proper handling of customer data and address scenarios like missing company names and additional shipping addresses.

Customer to iPaaS Mapping Collection:

  • Mapping Name: M2 Customer To iPaaS

  • Handles the transfer of basic customer information from Magento 2 to iPaaS.

Customer Address Mapping Collection:

  • Mapping Name: M2 Customer Address To iPaaS

  • A child mapping of the customer transfer that manages shipping address details.

Transaction Mapping Collections

The original transaction template mappings provided have been slightly modified from static values to demonstrate where corresponding values are located in the Magento API response.

Order Header Mapping

  • M2 Order Header Add Only To iPaaS: Transfers key order header details, including transaction numbers, totals, and order statuses.

Order Line Mapping

  • M2 Order Line Add Only To iPaaS (Child of Order Header): Handles individual order line details and prevents duplicate lines for configurable products using the filter IsEmpty(ParentItemId).

Order Payment Mapping

  • M2 Order Payment Add Only To iPaaS (Child of Order Header): Manages payment details, utilizing translation collections for pay code mappings. The "Authorized" status is required for compatibility with Counterpoint mappings.

Billing Address Mapping

  • M2 Order Bill Address Add Only To iPaaS (Child of Order Header): Maps billing address details, including country-specific information. Filter used: AddressType = "billing".

Shipping Address Mapping

  • M2 Order Ship Address Add Only To iPaaS: Handles shipping address details for transactions, with two main configurations:

    • Flat Rate - Fixed: Maps shipping addresses for transactions that use the "Flat Rate - Fixed" shipping method.

    • Unmapped: Handles cases where the shipping method is not predefined, resulting in an "unmapped" error to flag unsupported methods.

    • Example filters include:

      • AddressType = "shipping" And Parent.ShippingDescription="Flat Rate - Fixed"

      • Flags unsupported methods with: AddressType = "shipping" And Not(Parent.ShippingDescription="Flat Rate - Fixed").

Tax Mapping

  • M2 Order Tax Add Only To iPaaS (Child of Order Header): Maps tax details based on the first tax authority in Magento 2’s API response. Only one tax record is supported per order due to current design.


Simple/Normal Product Mappings

  • M2 Simple Product Add Only From iPaaS: Adds simple product details. The filter TrackingMethod="Product" ensures correct tracking. Attribute set, StockItemQty, and StockItemIsInStock may need updates to sum specific locations instead of all.

  • M2 Simple Product Inventory Add Only From iPaaS (Child of Simple Product Add): Updates inventory for simple products. Uses a translation collection for Magento 2 inventory source codes. Modify quantity and status formulas when mapping a single iPaaS inventory location to Magento.

  • M2 Simple Product Update Only From iPaaS: Updates details of existing simple products. Handles attribute set changes and stock adjustments.

  • M2 Simple Product Inventory Update Only From iPaaS (Child of Simple Product Update): Updates inventory values for existing products, similar to the add profile.

  • M2 Product Realtime Inventory Updates From iPaaS: Handles inventory-only updates. Note: Parent item quantities aren't updated during inventory-only updates, potentially misaligning stock status. Full product updates reestablish accurate amounts.


Configurable/Gridded/Variant Product Mappings

  • M2 Configurable Product Add Only From iPaaS: Adds configurable product details. Uses the filter TrackingMethod="Variant". Attribute set, StockItemQty, and StockItemIsInStock may require adjustments for location-specific summation.

  • M2 Configurable Product Inventory Add Only From iPaaS (Child of Configurable Product Add): Updates inventory for configurable products using a translation collection for Magento 2 inventory source codes. Adjust quantity and status formulas for single inventory sources.

  • M2 Configurable Product Options Add Only From iPaaS (Child of Configurable Product Add): Adds product options as attributes. Options not in the template mappings are created as new attributes. Support for any other option types not included in the template mappings have not been communicated and will be added at the discretion of the developers.

  • M2 Configurable Product Option Values Add Only From iPaaS (Child of Configurable Product Options Add): Adds option values as attributes if not already present (case-sensitive).

  • M2 Simple Associated Product Variant Add Only From iPaaS (Child of Configurable Product Add): Adds associated product variants. Includes default attribute set updates and adjusts StockItemQty and StockItemIsInStock. Variants inherit the parent price if their own price is undefined using the formula:
    If(IsEmpty(DefaultPrice), Parent.DefaultPrice, DefaultPrice).

  • M2 Simple Associated Product Variant Option Add Only From iPaaS: Adds options for associated product variants.

  • M2 Simple Associated Product Variant Inventory Add Only From iPaaS: Updates inventory for associated product variants.

  • M2 Product Variant Realtime Inventory Updates From iPaaS: Handles inventory-only updates for variants. Note: Parent item quantities are not updated during inventory-only updates, which may cause misaligned stock status. A full product update resolves this.

  • Update Profiles: Include mappings for updates to configurable products and their associated options, variants, and inventory:

    • M2 Configurable Product Update Only From iPaaS

    • M2 Configurable Product Inventory Update Only From iPaaS

    • M2 Configurable Product Options Update Only From iPaaS

    • M2 Configurable Product Option Values Update Only From iPaaS

    • M2 Simple Associated Product Variant Update Only From iPaaS

    • M2 Simple Associated Product Variant Option Update Only From iPaaS

    • M2 Simple Associated Product Variant Inventory Update Only From iPaaS

Category Support

The Magento 2 integration supports dynamic category assignment and management through dedicated mapping collections, improving upon previous limitations. Here’s how category support is implemented in iPaaS:


Automatic Category Assignment Processing:

  • To handle delays between product updates and category assignments, the integration processes category assignment webhooks. This ensures assignments are updated in a timely manner before the next full product update.

Supported Webhooks for Category Management:

  • Product/category/created:
    A dedicated "Add Only" mapping collection is used to process category assignments.

  • Mappings:

    • Sku: Retrieves the external ID for the product using:

      javascriptCopyEditreturn await GetExternalIdAsync(ProductId, "Product", SpaceportSystemId);
    • CategoryId: Retrieves the external ID for the product category using:

      javascriptCopyEditreturn await GetExternalIdAsync(CategoryId, "Product Category", SpaceportSystemId);

  • Product/category/updated:
    Subscribing to this webhook is not recommended as it may trigger unnecessary transfers. Assignments only need to be created or deleted.

  • Product/category/deleted:
    Category assignments can be removed by creating a "Delete Only" mapping collection.


    Note: If the last category assignment is deleted, it will not automatically remove the category in Magento. A new category must be assigned before the next product update can successfully remove the abandoned category.

Manual Interventions for Edge Cases:

  • If no categories are assigned to a product after deletion, manual reassignment of categories is required in Magento. The next product update will ensure any abandoned categories are removed.

  • Delete webhooks are not supported for product categories, and any categories must be manually deleted in Magento.

Mapping Collection: M2 Product Category From iPaaS
Adds support for assigning categories to products in Magento 2. Categories can be added but not removed using these mappings.

  • Fields Added:

    • Name -> Name

    • IsActive: Static value "true" ensures the category is active.

    • ParentId: Derived using the formula: ParentId

Configuration Steps To Implement Assignments:

  • Create a Custom Field in iPaaS
    Add a custom field to the "M2 Product" table for your Magento 2 system, named category_ids. Alternatively, use the following payload in manual API requests:

{ "name": "category_ids", "table_name": "M2 Product", "system_name": "M2", "description": "category_ids" }
  • Add Dynamic Formula Source Mappings
    Update the following mapping collections with a formula to map products to categories:

    • M2 Simple Product Add

    • M2 Simple Product Update

    • M2 Configurable Product Add

    • M2 Configurable Product Update

    • Formula: ConvertCategoriesToMagentoIds(categories)

Once configured, products can be dynamically added or removed from categories.

This mapping is typically included in templates for new subscriptions.

Hardcoded Delete Handling

The current Magento 2 integration does not include source inventory database deletion which is not possible in the Magento API. This means:

Inventory location removal requires manual un-stocking of products in Magento.

Location Mappings

M2 Location From iPaaS
Introduces starter mappings for Magento 2 inventory sources. These mappings require customization for location-specific fields.

  • Fields Added:

    • SourceCode: Name -> SourceCode

    • Name: Name -> Name

    • Description: Description -> Description

    • Enabled: Static value "true" ensures the source is active.

    • Address Fields (Static):

      • Street

      • City

      • Region

      • Postcode

      • CountryId

Important Notes:

  • Enabled Field: Without this field, new inventory sources will be created as disabled by default in Magento 2.

  • Manual Assignment: Inventory sources must be assigned to the website manually via the Magento admin.

  • Case Sensitivity: Ensure translation mappings align with the uploaded Counterpoint name format (e.g., "MAIN" in uppercase). Any mismatch can cause the Magento indexer to fail and prevent products from displaying.

Subscription Settings

The following settings must be configured in iPaaS for the Magento 2 integration:

Field

Description

Required

Example

Name

A unique name for identifying the subscription.

Yes

Magento Integration v2

Version

Specifies the integration version.

Yes

v2

Magento2 API URL

The base URL for accessing the Magento API.

Yes

https://yourstore.com/rest

Magento2 API Username

Admin username for Magento (if using username/password authentication).

No

admin@example.com

Magento2 API Key

Admin password or API token, depending on the authentication method used.

Yes

yourAPIToken123

Magento Store

Defines the Magento store scope. "all" is the only supported configuration.

Yes

all

Version

Specifies the integration version for the subscription.

Yes

V1

Auto-Ship Days

Specifies the default time in days for auto-shipping orders (if configured).

No

3

Magento2 API Integration Key

The Magento Access Token required for integration. Enter the token with full permissions here.

Yes

yourAccessToken123

Inventory Batch Max Size

The maximum number of inventory records that can be processed in a single batch.

No

100

  • Ensure the Access Token is entered in the "Magento API Integration Key" field.

  • API Tokens require full permissions for the integration to function properly.

Webhooks Support

The Magento 2 integration supports the following webhooks to trigger actions from iPaaS to Magento 2:

  • category/product/created

  • category/product/updated

  • location/created

  • location/updated

  • product/created

  • product/updated

  • product/deleted

  • product/category/created

  • product/category/updated

  • product/inventory/created

  • product/inventory/updated

  • product/variant/created

  • product/variant/updated

  • product/variant/deleted

  • product/variant/inventory/created

  • product/variant/inventory/updated

Note: Any other webhook types are not supported and may result in unexpected outcomes. It is recommended to disable unsupported webhook types to prevent unnecessary overhead. And, External webhooks are not supported for Magento 2 systems.

Initialization Support

Currently, initialization is not supported for Magento in iPaaS.com. All data synchronization and mappings must be configured manually during the integration process.

Throttling

Throttling ensures that Magento's API isn’t overwhelmed by excessive API calls, preserving system performance during heavy data transfers.


While the throttling fields are required, the values are pre-populated by the integration settings. For more details, refer to Subscription Configuration – Edit.

Did this answer your question?