How to Import JSON Files to Magento 2
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. You need to convert your JSON files to the supported file type 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 extension. This module supports the Magento 2 JSON import so that you can move all the necessary information to your e-commerce store without turning it into 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, you will find a step-by-step guide that describes how to import JSON data to Magento 2. If you are unfamiliar with the JSON format, its brief description is below.
Table of contents
- 1 JSON file requirements
- 2 Supported entities
- 3 How to import JSON files to Magento 2
- 4 JSON files defined
- 5 Magento 2 JSON import & export FAQ
- 5.1 How to import and export JSON files to Magento 2 automatically?
- 5.2 How to import JSON files with third-party attributes to Magento 2?
- 5.3 How to import and export JSON files to Magento 2 via API?
- 5.4 How to import and export data to Magento 2 via ODS files?
- 5.5 How to import and export data to Magento 2 via XLSX files?
- 5.6 How to import and export data to Magento 2 via JSON files?
- 5.7 How to import data to Magento 2 via compressed files?
- 5.8 How to import data to Magento 2 from Google Sheets?
- 5.9 How to import and export JSON files to Magento 2 from Dropbox?
- 5.10 How to import and export JSON files to Magento 2 from Google Drive?
- 6 Final Words
JSON file requirements
Of course, there are requirements to the Json files supported by the extension. Currently, there are two of them to follow:
- separator: comma
- array name required
More information about the Json file type
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 the Magento 2 Improved Import and Export extension.
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. 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 supports 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 file 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.
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 an 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, 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:
Get 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 – but 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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
{ "products": [ { "id": 632910392, "title": "IPod Nano - 8GB", "body_html": "<p>It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.</p>", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2018-04-27T15:15:25-04:00", "handle": "ipod-nano", "updated_at": "2018-04-27T15:15:25-04:00", "published_at": "2007-12-31T19:00:00-05:00", "template_suffix": null, "published_scope": "web", "tags": "Emotive, Flash Memory, MP3, Music", "variants": [ { "id": 808950810, "product_id": 632910392, "title": "Pink", "price": "199.00", "sku": "IPOD2008PINK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Pink", "option2": null, "option3": null, "created_at": "2018-04-27T15:15:25-04:00", "updated_at": "2018-04-27T15:15:25-04:00", "taxable": true, "barcode": "1234_pink", "grams": 567, "image_id": 562641783, "inventory_quantity": 10, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 808950810, "old_inventory_quantity": 10, "requires_shipping": true }, { "id": 49148385, "product_id": 632910392, "title": "Red", "price": "199.00", "sku": "IPOD2008RED", "position": 2, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Red", "option2": null, "option3": null, "created_at": "2018-04-27T15:15:25-04:00", "updated_at": "2018-04-27T15:15:25-04:00", "taxable": true, "barcode": "1234_red", "grams": 567, "image_id": null, "inventory_quantity": 20, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 49148385, "old_inventory_quantity": 20, "requires_shipping": true }, { "id": 39072856, "product_id": 632910392, "title": "Green", "price": "199.00", "sku": "IPOD2008GREEN", "position": 3, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Green", "option2": null, "option3": null, "created_at": "2018-04-27T15:15:25-04:00", "updated_at": "2018-04-27T15:15:25-04:00", "taxable": true, "barcode": "1234_green", "grams": 567, "image_id": null, "inventory_quantity": 30, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 39072856, "old_inventory_quantity": 30, "requires_shipping": true }, { "id": 457924702, "product_id": 632910392, "title": "Black", "price": "199.00", "sku": "IPOD2008BLACK", "position": 4, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2018-04-27T15:15:25-04:00", "updated_at": "2018-04-27T15:15:25-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "inventory_quantity": 40, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 457924702, "old_inventory_quantity": 40, "requires_shipping": true } ], "options": [ { "id": 594680422, "product_id": 632910392, "name": "Color", "position": 1, "values": [ "Pink", "Red", "Green", "Black" ] } ], "images": [ { "id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2018-04-27T15:15:25-04:00", "updated_at": "2018-04-27T15:15:25-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0006/9093/3842/products/ipod-nano.png?v=1524856525", "variant_ids": [] }, { "id": 562641783, "product_id": 632910392, "position": 2, "created_at": "2018-04-27T15:15:25-04:00", "updated_at": "2018-04-27T15:15:25-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0006/9093/3842/products/ipod-nano-2.png?v=1524856525", "variant_ids": [ 808950810 ] } ], "image": { "id": 850703190, "product_id": 632910392, "position": 1, "created_at": "2018-04-27T15:15:25-04:00", "updated_at": "2018-04-27T15:15:25-04:00", "alt": null, "width": 123, "height": 456, "src": "https://cdn.shopify.com/s/files/1/0006/9093/3842/products/ipod-nano.png?v=1524856525", "variant_ids": [] } }, { "id": 921728736, "title": "IPod Touch 8GB", "body_html": "<p>The iPod Touch has the iPhone's multi-touch interface, with a physical home button off the touch screen. The home screen has a list of buttons for the available applications.</p>", "vendor": "Apple", "product_type": "Cult Products", "created_at": "2018-04-27T15:15:25-04:00", "handle": "ipod-touch", "updated_at": "2018-04-27T15:15:25-04:00", "published_at": "2008-09-25T20:00:00-04:00", "template_suffix": null, "published_scope": "web", "tags": "", "variants": [ { "id": 447654529, "product_id": 921728736, "title": "Black", "price": "199.00", "sku": "IPOD2009BLACK", "position": 1, "inventory_policy": "continue", "compare_at_price": null, "fulfillment_service": "manual", "inventory_management": "shopify", "option1": "Black", "option2": null, "option3": null, "created_at": "2018-04-27T15:15:25-04:00", "updated_at": "2018-04-27T15:15:25-04:00", "taxable": true, "barcode": "1234_black", "grams": 567, "image_id": null, "inventory_quantity": 13, "weight": 1.25, "weight_unit": "lb", "inventory_item_id": 447654529, "old_inventory_quantity": 13, "requires_shipping": true } ], "options": [ { "id": 891236591, "product_id": 921728736, "name": "Title", "position": 1, "values": [ "Black" ] } ], "images": [], "image": null } ] } |
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 where 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.
Final Words
Although the Magento 2 JSON import and export processes are not available by default, you can easily enable them with the Improved Import & Export module. The extension provides the ability to transfer JSON files to Magento 2 or Adobe Commerce websites from multiple remote locations. Furthermore, it lets you automate both import and export processes or modify the imported data right in your admin panel. Follow this link and contact our support to find more information about the Magento 2 JSON import:
Get Improved Import & Export Magento 2 Extension