Skip to main content
Megaventory and Magento 2.4

Megaventory Integration adaptations for Magento 2.4 which includes compatibility with Multiple Source Inventory

Dimitris Athanasiadis avatar
Written by Dimitris Athanasiadis
Updated over a week ago


This article explains how to set up the Megaventory module for Magento 2.4 and how it takes advantage of a relatively recent feature called "Multiple Source Inventory".

This is a step-by-step guide on how to use the integration as a Megaventory user, and the actions you can take on both sides.

Step 1: Use the following guide if you have existing data in Megaventory

The following guide will help you import Megaventory data to Magento 2: I am already using Megaventory and want to start using Magento

Step 2: Configure the plugin and initial synchronization

Now that the products are imported in Magento, we can proceed to setting up the plugin and to the initial synchronization of the integration. This process is again similar to the way it was set up in previous version, the change is at the end of the process the user is presented with a table to choose which megaventory inventory location will synchronize with each magento inventory source.

Configuration Step 1: follow the guide in the above Step 1 (and in particular steps 1 and 2 within that guide) to get your API key and enable the integration with Magento. If you are already a user of Megaventory, go to Profile Icon > My Profile and click on the key icon to generate your API key.

Don't forget to click Update to fully associate the generated API key with your user, otherwise the API key will be lost and the process must be done again.

Configuration Step 2: Go to Megaventory Settings on Magento 2 Administrator Area and enter the following details:


API Key: (your api key)

Finally, click the Update button.

You should get the following screen

Configuration Step 3: Shipping, Discount and Supplier Attribute Code, Configure the right column with custom options before running the inital setup

Now that we have established a connection and authenticated with the Megaventory API, we have certain options to customize the integration. Specifically, we can choose

  • the id of Magento (one Megaventory account can integrate with up to 10 installations of Magento)

  • the Magento Store View that will be used to populate the fields in Megaventory

  • a Supplier Attribute that will be taken into account by Megaventory. The default attribute provided by Magento for that is the "manufacturer" attribute, but can also be a custom attribute

  • the Purchase Price Attribute that will be taken into account by Megaventory

  • the Barcode Attribute that will be taken into account by Megaventory

  • the Shipping Product SKU (the shipping cost is represented in Megaventory as a Service product, so the shipping product SKU will be used create that Service),

  • the Discount Product SKU (similar to shipping)

Clicking Start will begin the process of the initialization of the Megaventory integration.

Configuration Step 4: Finalizing the setup of the integration and enabling order synchronization:

After the initialization process is finished you are going to be presented with the following screen:

You can choose the locations to export the Magento Stock to Megaventory or [Do Not Sync] to manage the stock manually or to synchronize only a subset of the sources with the locations.

Note: the relationship is one-to-one so only one location can be synchronized with one source and vice versa. This is reflected by restricting the choices when a location is already picked for another source.

You can either click on "Export Stock in Megaventory as Inventory Adjustment" to export each source to the desired Megaventory location automatically or "Cancel, I will import manually" to manage the initial stock manually.

After that, by clicking the Finish button you have completed the initial setup.

Now you can enable the Order Synchronization if you are sure that the stock and products are currently in sync (ie the stock levels are shown to be the same in the Megaventory account and the Magento eshop for every product). Clicking on the checkbox you get a prompt asking if you are sure. By clicking OK, all future orders will be automatically synchronized with Megaventory based on the initial setup options or defaults which can be modified at any time on this Settings page.

Note: Once synchronizing orders has been set to be done automatically, it is recommended to fulfill the orders using Megaventory and not from Magento.

Step 3: Choose the Source Selection Algorithm that suits you better

The Magento 2 multiple source inventory introduces complexity to the Megaventory integration with regards to the way Magento manages order placement and order fulfillment. For best results, you need to have the order synchronized and approved to a specific Megaventory location based on some criteria. The Source Selection Service that Magento 2 provides can be used to choose the preferred location based on order items and stock availability of each product that is present on the order.

Magento 2 out-of-the-box provides two algorithms:

Source Priority Based: Based on the position a source is in a product relative to others (this position can be easily customized by the Administrator). The only drawback is that this is a static parameter and does not take into account anything other than the product being in stock in that location.

Source Distance Based: Based on the distance of the recipient and each individual location. The drawback here is that this needs a complicated configuration and access to Google Maps API for this to work properly.

Those are the known algorithms and can be selected to synchronize the orders. Additional customized algorithms may exist but they might require the Megaventory integration to be customized to work.

In the Megaventory Inventory Locations tab, you can pick the preferred location that the algorithm will use. Select your option from the dropdown list and click Save.

Managing Magento Inventory Source/Megaventory Inventory Location Associations

Assigning a Magento Inventory Source to a Megaventory Location or Removing a currently assigned Magento Inventory Source from a Megaventory Location

Below is the section of all the Megaventory Inventory Locations

On the Magento Inventory Source Column, you can find the currently associated Magento inventory source to that location.

By clicking the Edit from the Action tab, you'll be able to either Assign/Enable a Source or Remove/Disable a Source.

Clicking Assign Source will provide a dropdown menu to choose the source you want to assign to that location (only the unassigned sources will be available). The screen will look like so:

By clicking Save, the changes will be committed and a confirmation message will be displayed on the page. If anything prevents the action to be taken, an error message will appear.

By clicking the Remove Source, you will be prompted to confirm the action (as shown below):

By clicking Confirm, the source will be removed and the page will be reloaded. A confirmation message will appear. Otherwise, you will see an error message, if there was something wrong that prevented the completion of the action.

Main Features

This is the overview of the features that are present on the newest version of the Megaventory plugin and the steps to configure it properly, to take advantage of the Multiple inventory feature of Magento.

Order synchronization handling

This new version will be handling the orders automatically based on the assigned sources and based on which source is preferred by the source selection algorithm. The new version will synchronize the order to the location that was assigned based on the inventory source that the algorithm recommended.


You have three inventory locations in Megaventory and three inventory sources on Magento and you have assigned them like this:

Megaventory Locations:

Main Supply Warehouse

Main Wholesale Store
Main Retail Store

Magento Inventory Sources:
Wholesale store
Retail store

Main Supply Warehouse maps to Warehouse
Main Wholesale Store maps to Wholesale Store

Main Retail Store maps to Retail Store

Now let's say an order that has 3 products is placed on Magento and on the Retail store you have 2 out of 3 products recommended to be dispatched from there. With these associations the Retail store is associated with the Main Retail Store, so the order will be synchronized to the Main Retail Store in Megaventory.

In order to avoid delays, the user can disable the real-time synchronization, using the option below. This will determine the orders to be synched every 5 minutes.

Stock synchronization, stock import, and stock export

These procedures are modified to utilize the Multiple inventory source system that Magento provides in the 2.4 version onwards. This means that each stock respectively will be synchronized to and from the associated Megaventory location but also the alert quantity can be changed based on the options provided on Magento or vice-versa. This provides a flexible way of working with multiple locations which can automate the inventory management processes.

Mapping payment methods

The Megaventory Sales Order contains a field for Payment Methods, which does not have a correspondent in Magento. So the user can set up a payment method that will be associated with the Sales Orders passed from Magento to Megaventory.

Or login to your account.

Did this answer your question?