{"id":16827,"date":"2018-10-09T16:44:55","date_gmt":"2018-10-09T14:44:55","guid":{"rendered":"https:\/\/belvg.com\/blog\/?p=16827"},"modified":"2025-02-11T09:38:42","modified_gmt":"2025-02-11T07:38:42","slug":"the-integration-of-magento-2-with-erp-systems","status":"publish","type":"post","link":"https:\/\/belvg.com\/blog\/the-integration-of-magento-2-with-erp-systems.html","title":{"rendered":"The Integration of Magento 2 with ERP Systems"},"content":{"rendered":"<p>In this article, we will take a look at developing the integration of Magento 2 with any external ERP system. Magento 2.2.4 compatible syntax will be used to show the examples of code. The protocol of the interaction with ERP will be REST \/ JSON API, a two-way data exchange.<\/p>\n<p><!--more--><\/p>\n<p>Before starting to work on the integration, it is necessary to determine the functionality and set requirements for the system.<\/p>\n<p>Let us define what we need:<\/p>\n<ul>\n<li>always up-to-date data from both the website and ERP;<\/li>\n<li>reliability of the exchange (data must be validated; in case of failure, the exchange must be repeated);<\/li>\n<li>monitoring system &#8212; logging and notification in case of errors.<\/li>\n<\/ul>\n<p>In the context of this article, we omit the explanations to the components that are not directly related to the topic at hand.<\/p>\n<p>Let&#8217;s start implementing the integration of Magento 2 with ERP. The first step is to create a new module. To do this, create the following directory structure:<\/p>\n<p><em>app\/code\/BelVG\/ERPIntegration\/<\/em><\/p>\n<p><em>app\/code\/BelVG\/ERPIntegration\/etc<\/em><\/p>\n<p><em>app\/code\/BelVG\/ERPIntegration\/Setup<\/em><\/p>\n<p><em>app\/code\/BelVG\/ERPIntegration\/Helper<\/em><\/p>\n<p><em>app\/code\/BelVG\/ERPIntegration\/Controller<\/em><\/p>\n<p><em>app\/code\/BelVG\/ERPIntegration\/Observer<\/em><\/p>\n<p>Create an <em>app\/code\/BelVG\/ERPIntegration\/registration.ph<\/em>p file:<\/p>\n<pre class=\"lang:php decode:true\">&lt;?php\r\n\\Magento\\Framework\\Component\\ComponentRegistrar::register(\r\n&#160;&#160;\\Magento\\Framework\\Component\\ComponentRegistrar::MODULE,\r\n&#160;&#160;'BelVG_ERPIntegration',\r\n&#160;&#160;__DIR__\r\n);<\/pre>\n<p>Create an <em>app\/code\/BelVG\/ERPIntegration\/etc\/module.xml<\/em> file:<\/p>\n<pre class=\"lang:xhtml decode:true\">&lt;?xml version=\"1.0\"?&gt;\r\n&lt;config xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:Module\/etc\/module.xsd\"&gt;\r\n&#160;&#160;&lt;module name=\"BelVG_ERPIntegration\" setup_version=\"1.0.0\" \/&gt;\r\n&lt;\/config&gt;<\/pre>\n<p>Implement the installer of the module. It must add new attributes to entities, such as category, product, customer, order, and others that are exchanged. This attribute must be unique, as it will play the role of a common identifier for the site and ERP. We make it a string type, so as not to depend on the implementation of ERP.<\/p>\n<p>Create an &#160;<em>app\/code\/BelVG\/ERPIntegration\/Setup\/InstallData.php<\/em> file (here is an example of creating an attribute for a product).<\/p>\n<pre class=\"lang:php decode:true\">&lt;?php\r\nnamespace BelVG\\ERPIntegration\\Setup;\r\nuse Magento\\Catalog\\Api\\Data\\ProductAttributeInterface;\r\nuse Magento\\Framework\\Setup\\InstallDataInterface;\r\nuse Magento\\Framework\\Setup\\ModuleContextInterface;\r\nuse Magento\\Framework\\Setup\\ModuleDataSetupInterface;\r\nuse Magento\\Eav\\Setup\\EavSetupFactory;\r\nclass InstallData implements InstallDataInterface\r\n{\r\n&#160;&#160;private $eavSetupFactory;\r\n&#160;&#160;public function __construct(EavSetupFactory $eavSetupFactory)\r\n&#160;&#160;{\r\n&#160;&#160;&#160;&#160;&#160;&#160;$this-&gt;eavSetupFactory = $eavSetupFactory;\r\n&#160;&#160;}\r\n&#160;&#160;public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)\r\n&#160;&#160;{\r\n&#160;&#160;&#160;&#160;&#160;&#160;$eavSetup = $this-&gt;eavSetupFactory-&gt;create(['setup' =&gt; $setup]); &#160;&#160;&#160;&#160;&#160;&#160;$eavSetup-&gt;removeAttribute(ProductAttributeInterface::ENTITY_TYPE_CODE,'product_erp_id');\r\n$eavSetup-&gt;addAttribute( ProductAttributeInterface::ENTITY_TYPE_CODE, 'product_erp_id', [\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;'type' =&gt; 'varchar',\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;'frontend' =&gt; '',\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;'label' =&gt; 'Product ERP ID',\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;'input' =&gt; 'multiselect',\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;'class' =&gt; '',\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;'global' =&gt; \\Magento\\Eav\\Model\\Entity\\Attribute\\ScopedAttributeInterface::SCOPE_GLOBAL,\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;'visible' =&gt; 1,\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;'required' =&gt; false,\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;'user_defined' =&gt; 1,\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;'default' =&gt; '',\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;'searchable' =&gt; true,\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;'filterable' =&gt; true,\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;'comparable' =&gt; false,\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;'visible_on_front' =&gt; false,\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;'used_in_product_listing' =&gt; false,\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;'unique' =&gt; true\r\n&#160;&#160;&#160;&#160;&#160;&#160;]);\r\n&#160;&#160;}\r\n}\r\n<\/pre>\n<p>We implement the component responsible for exchanging data with ERP. It should have a closed logic of sending requests to simplify working with the code. In the example below, we will use the CURL component for REST requests to the ERP API.<\/p>\n<p>To do this, create an <em>app\/code\/BelVG\/ERPIntegration\/Helper\/Requester.php<\/em> file:<\/p>\n<pre class=\"lang:php decode:true\">&lt;?php\r\nnamespace BelVG\\ERPIntegration\\Helper;\r\nuse \\Magento\\Framework\\App\\Helper\\AbstractHelper;\r\nuse \\Magento\\Framework\\App\\Helper\\Context;\r\nuse Magento\\Framework\\Exception\\LocalizedException;\r\nclass Requester extends AbstractHelper\r\n{\r\n&#160;&#160;protected $curl;\r\n&#160;&#160;const ERP_API_BASE_URL = 'https:\/\/127.0.0.1\/erp\/api\/';\r\n&#160;&#160;public function __construct(\r\n&#160;&#160;&#160;&#160;&#160;&#160;Context $context,\r\n&#160;&#160;&#160;&#160;&#160;&#160;\\Magento\\Framework\\HTTP\\Client\\Curl $curl\r\n&#160;&#160;) {\r\n&#160;&#160;&#160;&#160;&#160;&#160;$this-&gt;curl = $curl;\r\n&#160;&#160;&#160;&#160;&#160;&#160;parent::__construct($context);\r\n&#160;&#160;}\r\n&#160;&#160;public function createProduct(array $product)\r\n&#160;&#160;{\r\n&#160;&#160;&#160;&#160;&#160;&#160;$url = self::ERP_API_BASE_URL . 'product\/create';\r\n&#160;&#160;&#160;&#160;&#160;&#160;$this-&gt;curl-&gt;post($url, $product);\r\n&#160;&#160;&#160;&#160;&#160;&#160;if ($this-&gt;curl-&gt;getStatus() !== 200) {\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;throw new LocalizedException(__('ERP query fail!'));\r\n&#160;&#160;&#160;&#160;&#160;&#160;}\r\n&#160;&#160;&#160;&#160;&#160;&#160;$response = json_decode($this-&gt;curl-&gt;getBody(), true);\r\n&#160;&#160;&#160;&#160;&#160;&#160;if ($response['success']) {\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return $response['product_erp_id']; &#160;&#160;\r\n&#160;&#160;&#160;&#160;&#160;&#160;} else {\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;throw new LocalizedException(__($response['error_message']));\r\n&#160;&#160;&#160;&#160;&#160;&#160;}\r\n&#160;&#160;}\r\n&#160;&#160;public function updateProduct(array $product)\r\n&#160;&#160;{\r\n&#160;&#160;&#160;&#160;&#160;&#160;$url = self::ERP_API_BASE_URL . 'product\/create';\r\n&#160;&#160;&#160;&#160;&#160;&#160;if (!$product['product_erp_id']) {\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;throw new LocalizedException(__('Invalid product ERP ID!'));\r\n&#160;&#160;&#160;&#160;&#160;&#160;}\r\n&#160;&#160;&#160;&#160;&#160;&#160;$this-&gt;curl-&gt;post($url, $product);\r\n&#160;&#160;&#160;&#160;&#160;&#160;if ($this-&gt;curl-&gt;getStatus() !== 200) {\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;throw new LocalizedException(__('ERP query fail!'));\r\n&#160;&#160;&#160;&#160;&#160;&#160;}\r\n&#160;&#160;&#160;&#160;&#160;&#160;$response = json_decode($this-&gt;curl-&gt;getBody(), true);\r\n&#160;&#160;&#160;&#160;&#160;&#160;if ($response['success']) {\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return $response['product_erp_id'];\r\n&#160;&#160;&#160;&#160;&#160;&#160;} else {\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;throw new LocalizedException(__($response['error_message']));\r\n&#160;&#160;&#160;&#160;&#160;&#160;}\r\n&#160;&#160;}\r\n}<\/pre>\n<p>In order to send to ERP the data that has been created or changed on the site, you must set the capture of the save events on the entities that the <strong>Site &#10140; ERP<\/strong>&#160;exchange is carried out.<\/p>\n<p>To implement this functionality, create an observer for the <strong>product_save_after<\/strong> event.<\/p>\n<p>Create an <em>app\/code\/BelVG\/ERPIntegration\/Observers\/ProductSaveAfterObserver.php<\/em> file. It also has logging implemented in it.<\/p>\n<pre class=\"lang:php decode:true\">&lt;?php\r\nnamespace BelVG\\ERPIntegration\\Observer;\r\nuse Magento\\Catalog\\Model\\Product;\r\nuse Magento\\Framework\\Event\\ObserverInterface;\r\nuse Magento\\Framework\\Exception\\LocalizedException;\r\nuse Magento\\Catalog\\Model\\ProductRepository;\r\nclass ProductSaveAfterObserver implements ObserverInterface\r\n{\r\n&#160;&#160;protected $requester;\r\n&#160;&#160;protected $productRepository;\r\n&#160;&#160;protected $logger;\r\n&#160;&#160;public function __construct(\r\n&#160;&#160;&#160;&#160;&#160;&#160;\\BelVG\\ERPIntegration\\Helper\\Requester $requester,\r\n&#160;&#160;&#160;&#160;&#160;&#160;ProductRepository $productRepository,\r\n&#160;&#160;&#160;&#160;&#160;&#160;\\Psr\\Log\\LoggerInterface $logger\r\n&#160;&#160;) {\r\n&#160;&#160;&#160;&#160;&#160;&#160;$this-&gt;requester = $requester;\r\n&#160;&#160;&#160;&#160;&#160;&#160;$this-&gt;productRepository = $productRepository;\r\n&#160;&#160;&#160;&#160;&#160;&#160;$this-&gt;logger = $logger;\r\n&#160;&#160;}\r\n&#160;&#160;public function execute(\\Magento\\Framework\\Event\\Observer $observer)\r\n&#160;&#160;{\r\n&#160;&#160;&#160;&#160;&#160;&#160;$product = $observer['product'];\r\n&#160;&#160;&#160;&#160;&#160;&#160;if (!$this-&gt;isProductChanged($product) &amp;&amp; $product-&gt;getData('product_erp_id')) {\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return;\r\n&#160;&#160;&#160;&#160;&#160;&#160;}\r\n&#160;&#160;&#160;&#160;&#160;&#160;try {\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if ($product-&gt;getData('product_erp_id')) {\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$erpId = $this-&gt;requester-&gt;updateProduct([\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;'name' =&gt; $product-&gt;getName(),\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;'category_erp_id' =&gt; $product-&gt;getData('category_erp_id'),\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;]);\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;} else {\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$erpId = $this-&gt;requester-&gt;createProduct([\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;'name' =&gt; $product-&gt;getName(),\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;'category_erp_id' =&gt; $product-&gt;getData('category_erp_id'),\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;]);\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}\r\n&#160;&#160;&#160;&#160;&#160;&#160;} catch (LocalizedException $e) {\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$this-&gt;logger-&gt;alert($e-&gt;getMessage());\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return;\r\n&#160;&#160;&#160;&#160;&#160;&#160;}\r\n&#160;&#160;&#160;&#160;&#160;&#160;$product-&gt;setData('category_erp_id'. $erpId);\r\n&#160;&#160;&#160;&#160;&#160;&#160;$this-&gt;productRepository-&gt;save($product);\r\n&#160;&#160;&#160;&#160;&#160;&#160;$this-&gt;logger-&gt;info('Product ' . $erpId . ' has been synchronized');\r\n&#160;&#160;}\r\n&#160;&#160;private function isProductChanged(Product $product)\r\n&#160;&#160;{\r\n&#160;&#160;&#160;&#160;&#160;&#160;return $product-&gt;getOrigData('name') != $product-&gt;getName();\r\n&#160;&#160;}\r\n}<\/pre>\n<p>Also, create an <em>app\/code\/BelVG\/ERPIntegration\/etc\/events.xml<\/em> file, where we assign this observer to the desired event.<\/p>\n<pre class=\"lang:xhtml decode:true\">&lt;?xml version=\"1.0\"?&gt;\r\n&lt;config xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n&#160;&#160;xsi:noNamespaceSchemaLocation=\"urn:magento:framework:Event\/etc\/events.xsd\"&gt;\r\n&#160;&#160;&lt;event name=\"product_save_after\"&gt;\r\n&#160;&#160;&#160;&#160;&#160;&#160;&lt;observer name=\"setcustomerupdatedat\" instance=\"Belvg\\ERPIntegration\\Observer\\ProductSaveAfterObserver\"\/&gt;\r\n&#160;&#160;&lt;\/event&gt;\r\n&lt;\/config&gt;<\/pre>\n<p>To implement a relevance check and a scheduled data exchange, you can use CRON similarly to the method of event handling.<\/p>\n<p>You can also implement external API integrations for direct calls from ERP if the data has been changed on the ERP side and requires immediate synchronization. The API of both the ERP and the Magento 2 module should be closed by authorization, or in some other way (for example, by an IP filter).<br \/>\nIt remains to implement the error notifications. Let us enable email notifications. This component is an example, it can be used in a catch block along with logging:<\/p>\n<pre class=\"lang:php decode:true\">&lt;?php\r\nnamespace BelVG\\ERPIntegration\\Helper;\r\nuse \\Magento\\Framework\\App\\Helper\\AbstractHelper;\r\nuse Magento\\Framework\\Mail\\Template\\TransportBuilder;\r\nclass Notify extends AbstractHelper\r\n{\r\n&#160;&#160;\/** @var TransportBuilder $transportBuilder *\/\r\n&#160;&#160;private $transportBuilder;\r\n&#160;&#160;public function __construct(\r\n&#160;&#160;&#160;&#160;&#160;&#160;\\Magento\\Framework\\App\\Helper\\Context $context,\r\n&#160;&#160;&#160;&#160;&#160;&#160;TransportBuilder $transportBuilder\r\n&#160;&#160;)\r\n&#160;&#160;{\r\n&#160;&#160;&#160;&#160;&#160;&#160;$this-&gt;transportBuilder = $transportBuilder;\r\n&#160;&#160;&#160;&#160;&#160;&#160;parent::__construct($context);\r\n&#160;&#160;}\r\n&#160;&#160;public function reportingError($process, $message\r\n&#160;&#160;{\r\n&#160;&#160;&#160;&#160;&#160;&#160;try {\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$subject = 'ERP synchronize error';\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;$this-&gt;sendEmail($subject, $process, $message);\r\n&#160;&#160;&#160;&#160;&#160;&#160;} catch (\\Exception $e) {}\r\n&#160;&#160;}\r\n&#160;&#160;private function sendEmail($subject, $process, $message)\r\n&#160;&#160;{\r\n&#160;&#160;&#160;&#160;&#160;&#160;$transport = $this-&gt;transportBuilder\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;-&gt;setTemplateIdentifier('erp_integration_error_notify_template')\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;-&gt;setTemplateOptions(\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;['area' =&gt; 'frontend', 'store' =&gt; \\Magento\\Store\\Model\\Store::DEFAULT_STORE_ID]\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;)\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;-&gt;setTemplateVars([\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;'process' =&gt; $process,\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;'message' =&gt; $message,\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;])\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;-&gt;setFrom('general')\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;-&gt;addTo('erp-manager@example.com', 'Erp Manager')\r\n&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;-&gt;getTransport();\r\n&#160;&#160;&#160;&#160;&#160;&#160;$transport-&gt;sendMessage();\r\n&#160;&#160;}\r\n}<\/pre>\n<p>When completed, the module should be installed. To do this, execute the following commands in the Magento console (from the Magento root directory):<\/p>\n<p><em>php bin\/magento setup:upgrade<\/em><br \/>\n<em>php bin\/magento setup:di:compile<\/em><\/p>\n<p>That is how you integrate Magento with ERP systems. Thank you for reading, hope everything was clear. Leave your comments and questions below and I will answer them ASAP.<\/p>\n","protected":false},"excerpt":{"rendered":"How to integrate Magento 2 with external ERP systems","protected":false},"author":58,"featured_media":16828,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"image","meta":{"_acf_changed":false,"footnotes":""},"categories":[491,389,535,524],"tags":[],"class_list":["post-16827","post","type-post","status-publish","format-image","has-post-thumbnail","hentry","category-magento-2","category-magento2-development","category-magento-erp-integration","category-magento-speed-optimization","post_format-image"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.4 - aioseo.com -->\n\t<meta name=\"description\" content=\"The integration of Magento 2 with external ERP systems. Magento 2.2.4 compatible syntax will be used to show the examples of code.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Aleksander Kutseika\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/belvg.com\/blog\/the-integration-of-magento-2-with-erp-systems.html\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.4\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/the-integration-of-magento-2-with-erp-systems.html#article\",\"name\":\"Integrating Magento 2 with external ERP systems | BelVG Blog\",\"headline\":\"The Integration of Magento 2 with ERP Systems\",\"author\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/aleksander-kutseika#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/10\\\/The-Integration-of-Magento-2-with-ERP-Systems.jpg\",\"width\":1110,\"height\":590,\"caption\":\"The Integration of Magento 2 with ERP Systems\"},\"datePublished\":\"2018-10-09T16:44:55+02:00\",\"dateModified\":\"2025-02-11T09:38:42+02:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/the-integration-of-magento-2-with-erp-systems.html#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/the-integration-of-magento-2-with-erp-systems.html#webpage\"},\"articleSection\":\"Magento 2, Magento 2 Development, Magento ERP Integration, Magento Speed Optimization, Image\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/the-integration-of-magento-2-with-erp-systems.html#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento2-development#listItem\",\"name\":\"Magento 2 Development\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento2-development#listItem\",\"position\":2,\"name\":\"Magento 2 Development\",\"item\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento2-development\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/the-integration-of-magento-2-with-erp-systems.html#listItem\",\"name\":\"The Integration of Magento 2 with ERP Systems\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/the-integration-of-magento-2-with-erp-systems.html#listItem\",\"position\":3,\"name\":\"The Integration of Magento 2 with ERP Systems\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/magento2-development#listItem\",\"name\":\"Magento 2 Development\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\",\"name\":\"BelVG Blog\",\"description\":\"Magento and Prestashop articles\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/aleksander-kutseika#author\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/aleksander-kutseika\",\"name\":\"Aleksander Kutseika\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/the-integration-of-magento-2-with-erp-systems.html#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/20dcba617ca05952a14d36e3f30fc6a632094549decebf7a03ba790095042cd3?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Aleksander Kutseika\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/the-integration-of-magento-2-with-erp-systems.html#webpage\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/the-integration-of-magento-2-with-erp-systems.html\",\"name\":\"Integrating Magento 2 with external ERP systems | BelVG Blog\",\"description\":\"The integration of Magento 2 with external ERP systems. Magento 2.2.4 compatible syntax will be used to show the examples of code.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/the-integration-of-magento-2-with-erp-systems.html#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/aleksander-kutseika#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/aleksander-kutseika#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/10\\\/The-Integration-of-Magento-2-with-ERP-Systems.jpg\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/the-integration-of-magento-2-with-erp-systems.html\\\/#mainImage\",\"width\":1110,\"height\":590,\"caption\":\"The Integration of Magento 2 with ERP Systems\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/the-integration-of-magento-2-with-erp-systems.html#mainImage\"},\"datePublished\":\"2018-10-09T16:44:55+02:00\",\"dateModified\":\"2025-02-11T09:38:42+02:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\",\"name\":\"BelVG Blog\",\"description\":\"Magento and Prestashop articles\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Integrating Magento 2 with external ERP systems | BelVG Blog","description":"The integration of Magento 2 with external ERP systems. Magento 2.2.4 compatible syntax will be used to show the examples of code.","canonical_url":"https:\/\/belvg.com\/blog\/the-integration-of-magento-2-with-erp-systems.html","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/belvg.com\/blog\/the-integration-of-magento-2-with-erp-systems.html#article","name":"Integrating Magento 2 with external ERP systems | BelVG Blog","headline":"The Integration of Magento 2 with ERP Systems","author":{"@id":"https:\/\/belvg.com\/blog\/author\/aleksander-kutseika#author"},"publisher":{"@id":"https:\/\/belvg.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2018\/10\/The-Integration-of-Magento-2-with-ERP-Systems.jpg","width":1110,"height":590,"caption":"The Integration of Magento 2 with ERP Systems"},"datePublished":"2018-10-09T16:44:55+02:00","dateModified":"2025-02-11T09:38:42+02:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/belvg.com\/blog\/the-integration-of-magento-2-with-erp-systems.html#webpage"},"isPartOf":{"@id":"https:\/\/belvg.com\/blog\/the-integration-of-magento-2-with-erp-systems.html#webpage"},"articleSection":"Magento 2, Magento 2 Development, Magento ERP Integration, Magento Speed Optimization, Image"},{"@type":"BreadcrumbList","@id":"https:\/\/belvg.com\/blog\/the-integration-of-magento-2-with-erp-systems.html#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/#listItem","position":1,"name":"Home","item":"https:\/\/belvg.com\/blog\/","nextItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento2-development#listItem","name":"Magento 2 Development"}},{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento2-development#listItem","position":2,"name":"Magento 2 Development","item":"https:\/\/belvg.com\/blog\/category\/magento2-development","nextItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/the-integration-of-magento-2-with-erp-systems.html#listItem","name":"The Integration of Magento 2 with ERP Systems"},"previousItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/the-integration-of-magento-2-with-erp-systems.html#listItem","position":3,"name":"The Integration of Magento 2 with ERP Systems","previousItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/magento2-development#listItem","name":"Magento 2 Development"}}]},{"@type":"Organization","@id":"https:\/\/belvg.com\/blog\/#organization","name":"BelVG Blog","description":"Magento and Prestashop articles","url":"https:\/\/belvg.com\/blog\/"},{"@type":"Person","@id":"https:\/\/belvg.com\/blog\/author\/aleksander-kutseika#author","url":"https:\/\/belvg.com\/blog\/author\/aleksander-kutseika","name":"Aleksander Kutseika","image":{"@type":"ImageObject","@id":"https:\/\/belvg.com\/blog\/the-integration-of-magento-2-with-erp-systems.html#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/20dcba617ca05952a14d36e3f30fc6a632094549decebf7a03ba790095042cd3?s=96&d=mm&r=g","width":96,"height":96,"caption":"Aleksander Kutseika"}},{"@type":"WebPage","@id":"https:\/\/belvg.com\/blog\/the-integration-of-magento-2-with-erp-systems.html#webpage","url":"https:\/\/belvg.com\/blog\/the-integration-of-magento-2-with-erp-systems.html","name":"Integrating Magento 2 with external ERP systems | BelVG Blog","description":"The integration of Magento 2 with external ERP systems. Magento 2.2.4 compatible syntax will be used to show the examples of code.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/belvg.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/belvg.com\/blog\/the-integration-of-magento-2-with-erp-systems.html#breadcrumblist"},"author":{"@id":"https:\/\/belvg.com\/blog\/author\/aleksander-kutseika#author"},"creator":{"@id":"https:\/\/belvg.com\/blog\/author\/aleksander-kutseika#author"},"image":{"@type":"ImageObject","url":"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2018\/10\/The-Integration-of-Magento-2-with-ERP-Systems.jpg","@id":"https:\/\/belvg.com\/blog\/the-integration-of-magento-2-with-erp-systems.html\/#mainImage","width":1110,"height":590,"caption":"The Integration of Magento 2 with ERP Systems"},"primaryImageOfPage":{"@id":"https:\/\/belvg.com\/blog\/the-integration-of-magento-2-with-erp-systems.html#mainImage"},"datePublished":"2018-10-09T16:44:55+02:00","dateModified":"2025-02-11T09:38:42+02:00"},{"@type":"WebSite","@id":"https:\/\/belvg.com\/blog\/#website","url":"https:\/\/belvg.com\/blog\/","name":"BelVG Blog","description":"Magento and Prestashop articles","inLanguage":"en-US","publisher":{"@id":"https:\/\/belvg.com\/blog\/#organization"}}]}},"aioseo_meta_data":{"post_id":"16827","title":"Integrating Magento 2 with external ERP systems | #site_title","description":"The integration of Magento 2 with external ERP systems. Magento 2.2.4 compatible syntax will be used to show the examples of code.","keywords":null,"keyphrases":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_image_url":null,"twitter_title":null,"twitter_description":null,"schema_type":"default","schema_type_options":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null,"created":"2026-11-03 18:37:03","updated":"2026-11-03 18:37:03"},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/belvg.com\/blog\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/belvg.com\/blog\/category\/magento2-development\" title=\"Magento 2 Development\">Magento 2 Development<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tThe Integration of Magento 2 with ERP Systems\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/belvg.com\/blog\/"},{"label":"Magento 2 Development","link":"https:\/\/belvg.com\/blog\/category\/magento2-development"},{"label":"The Integration of Magento 2 with ERP Systems","link":"https:\/\/belvg.com\/blog\/the-integration-of-magento-2-with-erp-systems.html"}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/16827","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/users\/58"}],"replies":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/comments?post=16827"}],"version-history":[{"count":-1,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/16827\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/media\/16828"}],"wp:attachment":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/media?parent=16827"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/categories?post=16827"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/tags?post=16827"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}