How to Import JSON Files to Magento 2
By default, Magento 2 provides limited capabilities when it comes to data import. They are enough for satisfying basic demands, but what if a more complex tas must be solved? For instance, you need to import JSON files to Magento 2. Unfortunately, this opportunity is available neither in Magento 2 out-of-the-box nor most third-party extensions. But below, we shed light on how to import JSON to Magento 2.

Perhaps, there is a very complicated solution described on StackExchange that requires multiple third-party services to be used turning the JSON format into CSV, but we know a better way.
Meet the Improved Import & Export Magento 2 extension. This module supports JSON data import allowing you to move all the necessary information to your e-commerce store in the desired format without any headaches.
Improved Import & Export Magento 2 extension fully supports JSON import and export. It means that you can effortlessly move data in this format in both directions: to and from your Magento 2 store
Json file requirements
Of course there are requirements to the Json files supported by the extension. Currently there are two:
- 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 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. 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 the extended support for JSON customers 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.
Conclusion
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.
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
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 the 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 } ] } |
And you can freely import such JSON file 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 Shopify to Magento 2 is offered by the Improved Import & Export Magento 2 extension. For any further information about JSON, follow the links below:
