How to Import JSON Files to Magento 2

- E-Commerce, Magento 2, Our extensions

Magento 2 JSON Import

The default Magento 2 data import capabilities are enough for satisfying only basic data transfer demands, but what if a more complex task must be solved? For instance, you need to import JSON files to Magento 2, while the system supports only the CSV standard. Therefore, you need to convert your JSON files to the supported file type in order to move them to your e-commerce website. Luckily, there is a more user-friendly solution for importing JSON to Magento 2.

Meet the Improved Import & Export Magento 2 extension. This module supports JSON data import so that you can move all the necessary information to your e-commerce store without comforting it to CSV. You can effortlessly move data in this format in both directions: to and from your Magento 2 website.

In this article, we discuss JSON file requirements for importing data to Magento 2 and provide a list of supported entities (you can transfer all core entities now). Besides, there is a step-by-step guide to importing JSON data to Magento 2. And if you are not familiar with the JSON format, you will find its brief description below.

Json file requirements

Of course, there are requirements to the Json files supported by the extension. Currently, there are two of them to follow:

  1. separator:comma
  2. array name required

More information about the Json file type can be found here.

As for the workflow, it is the same as with other file types. If you require detailed instructions on how to run the import – read through the Improved Import and Export manual.

You can always refer to the FireBear Studio GuiHub to find the latest sample files for Magento 2 Improved Import and Export extension.

Get sample Magento 2 Json import files

Supported entities

It is also necessary to mention supported entities. Of course, you can run product import to Magento 2 via JSON with the help of the Improved Import & Export Magento 2 extension. The module enables the seamless transfer of product data between your e-commerce store and any third-party platform in a JSON format. And all standard features of the Improved Import & Export Magento 2 plugin are supported, but let’s return to entities.

The second supported entity is Customers. Now, you can use the accessible format to transfer all information about your registered clients from the old website or any third-party system to your e-commerce store. The Improved Import & Export Magento 2 extension provides extended support for JSON customer’s data import and export and you can fully leverage it.

The third supported entity is Orders. With the Improved Import & Export Magento 2 extension you can freely import orders to Magento 2 via JSON. Besides, it is possible to run JSON order export. Note that the module freely transfers not only orders but also the related data. Thus, the Improved Import & Export extension allows you to run:

  • Credit memo JSON import,
  • Invoice JSON import,
  • Shipping JSON import,
  • Tracking data JSON import.

The fourth supported entity is Categories. Our module lets you freely move categories to and from Magento 2 via JSON. Now, you don’t need to convert data files to CSV to run category import.

CMS pages are also freely supported in Magento 2 JSON import/export. The same is about coupon codes and attributes. These are all entities, so let’s describe other essential features.

The Magento 2 JSON import and export fully support such features of the Improved Import & Export module as schedules and mapping. It means that you can freely automate the import/export processes eliminating manual data updates and JSON data files modification.

The Improved Import & Export Magento 2 extension fully supports cron so that you can create any custom schedule of updates. Furthermore, it is possible to make two different update plans for JSON import and export processes related to the same integration.

As for mapping, the Improved Import & Export Magento 2 extension allows you to match the default Magento 2 attributes to any custom ones when you run JSON import or export. Thus, there is no need to edit data files on every update modifying the output according to the required standards. The mapping interface is extremely flexible and at the same time admin-friendly. A complicated procedure of attribute matching is now turned into a rapid task that takes not more than a few minutes.

Attribute mapping

How to import JSON files to Magento 2

To import JSON data to Magento 2, you need to:

  • Install the Improved Import & Export Magento 2 Extension.
  • Configure a new import profile:
    • Choose entity to import;
    • Select JSON as a data format;
    • Create a schedule of updates;
    • Create and apply a mapping scheme, etc.
  • Launch the profile.

But let’s take a look at a few more details:

JSON files should have a specific path in the structure.

You can find the necessary fields in the import job when choosing JSON as your Import File Type. Enable the ‘Set path to the entity structure in the file’ feature and the ‘Path to the import entity structure’ field appears:

For instance, your JSON file has the following structure:

In the ‘Path to the import entity structure’ field, it should look as follows:

To export JSON from Magento 2, you need to implement similar steps, creating the corresponding export profile.

Watch the following video to discover more features of the Improved Import & Export Magento 2 extension:

For further information about the module, follow this link:

Download/Buy Improved Import & Export Magento 2 Extension

JSON files defined

If you are not familiar with the JSON format, here is a brief description. JavaScript Object Notation is an open-standard file format that has several advantages over other formats. First of all, it uses human-readable text to transmit data. It means that not only Magento 2 can read it – you can also understand what’s written in a JSON product file.  All data objects consist of attribute-value pairs and array data types. Alternatively, other serializable values can be used.

While the format is often utilized for asynchronous browser-server communication, it also introduces a great way to transfer various data between e-commerce platforms and external systems. JSON represents an excellent replacement for XML in some systems. For instance, below you can see a product.json file generated by Shopify:

And you can freely import such JSON files to Magento 2 with the help of the Improved Import & Export Magento 2 extension. By default, the Magento 2 platform doesn’t provide any tools to do that since JSON is not supported.

Why does Shopify use JSON instead of XML? Because it is a more lightweight format so that data transfers require fewer resources. Thus, the best way to run the migration of Shopify to Magento 2 is offered by the Improved Import & Export Magento 2 extension. For any further information about JSON, follow the links below:

Magento 2 JSON import & export FAQ

Let’s take a look at other nuances of importing and exporting JSON files in Magento 2 with the help of the Improved Import & Export Magento 2 extension.

How to import and export JSON files to Magento 2 automatically?

If you need to import or export JSON files between Magento 2 and third-parties or other Magento 2 websites on a regular basis, it is necessary to install an additional tool. We recommend you use the Improved Import & Export extension since it uses a cron scheduler for automating data transfers. Thus, you get the ability to import and export JSON files between Magento 2 and external destinations automatically. You create a schedule of updates. Next, the module does everything for you importing and exporting data at a specified time.

How to import JSON files with third-party attributes to Magento 2?

While the default import mechanism blocks the import of third-party data that doesn’t follow the requirements of Magento 2, the Improved Import & Export extension can easily do that. It lets you create a mapping scheme where you match third-party attributes and their values to ones used within the system. As a result, any external data is easily adapted to the native standards of your e-commerce website. Note that you can also apply mapping to export processes to generate the output your partners require, freely transferring JSON files that contain unsupported data.

How to import and export JSON files to Magento 2 via API?

The Improved Import & Export Magento 2 extension provides the ability to create API connections based on JSON files. Thus, you can freely transfer information between Magento 2 and any external system. The module’s import/export jobs provide an interface where you can specify the parameters necessary to sync the two systems. Note that it is possible to create a bi-directional API connection with our module. As for transferring unsupported attributes, the plugin lets you leverage its mapping functionality for API connections.

How to import and export data to Magento 2 via ODS files?

In addition to JSON, Improved Import & Export lets you move data via ODS files. You no longer need to convert them to CSV to fit the Magento 2 requirements. You can also export data using this file format.

How to import and export data to Magento 2 via XLSX files?

In addition to JSON, Improved Import & Export lets you move data via XLSX files. You no longer need to convert them to CSV to fit the Magento 2 requirements. You can also export data using this file format.

How to import and export data to Magento 2 via JSON files?

If data is stored in a JSON file and you don’t want to create an API connection, you no longer need to convert it to a CSV file to fit the Magento 2 requirements. With the Improved Import & Export Magento 2 extension, it is possible to import JSON files to your ecommerce website without any necessity to run the conversion. You can also export data using this file format.

How to import data to Magento 2 via compressed files?

If your JSON files are compressed, you can also transfer them to Magento 2 with the help of the Improved Import & Export extension. However, there is a requirement to follow: your file archive should be in a ZIP or TAR format. In addition to JSON, our module also supports compressed CSV, XML, ODS, and XLSX files.

How to import data to Magento 2 from Google Sheets?

If data is stored in Google Sheets, it is no longer a problem. There is no need to export it from the service and then transfer the output to Magento 2. The Improved Import & Export lets you move the corresponding information straight from Google Sheets to your e-commerce website. It is only necessary to specify the address of the corresponding data table.

How to import and export JSON files to Magento 2 from Dropbox?

In addition to Google Sheets, the Improved Import & Export module lets you transfer data to Magento 2 from Dropbox. This time, you can store JSON files there. Besides, it is possible to work with CSV, XML, ODS, or XLSX. If it is a compressed file, it should be in a ZIP or TAR format. You can use this file storage as your export destination.

How to import and export JSON files to Magento 2 from Google Drive?

In addition to Google Sheets and Dropbox, the Improved Import & Export module lets you leverage Google Drive to transfer JSON files to Magento 2. Besides, you can use this file storage for CSV, XML, ODS, and XLSX files that can be compressed in a ZIP or TAR format. You can use this file storage as your export destination.