The following article sheds light on how to import orders to Magento 2. Merchants usually do that when they migrate to Magento 2 or synchronize their business with external marketplaces. However, you cannot do that within the admin’s default tools. Therefore, a third-party extension is necessary to maintain this process.
Besides, the blog post explains how to export orders from Magento 2. This procedure comes in handy in similar cases: when the migration from Magento 2 is required or orders are processed in external systems. Unlike the Magento 2 order import, the corresponding export process is available in the administration right on the order page. Although you can transfer orders from your website with the help of the default tools, we describe a more fully featured but at the same time natural way of doing that.
In the article below, you will discover how the order import works. We explore the Magento 2 order file structure and generate invoices and shipments while importing tracking numbers. You will also see how to export orders from Magento 2. The last chapter of the article reveals other features of the tool that we use to run data transfers.
Table of contents
Third-party order import capabilities
The Magento 2 ecosystem offers multiple order import extensions that simplified the way you move orders to your store, but the most fully-featured solution is the Improved Import & Export Magento 2 module.
First of all, it provides the ability to import orders to Magento 2 using multiple file formats. Of course, it is possible to transfer data files via standard CSV. For instance, you can import orders to Magento 2 via CSV from your old Magento 1 website or other platforms that create the corresponding output.
The second supported file format is XML. It is flexible and extremely popular among multiple e-commerce systems and tools. Feel free to use the Improved Import & Export Magento 2 extension to import orders to Magento 2 via XML.
Besides, there is support for TXT files. If an external system generates order data in this format, the Improved Import & Export Magento 2 extension will quickly move all orders to your store.
Another essential feature of the module is the ability to work with JSON files. With the full support for this format, you can easily import orders to Magento 2 via JSON. It allows simplifying the migration from Shopify to Magento 2.
Besides, native Excel files are supported. Thus, you can run Magento 2 order import from XLS and XLSX sheets without any negative consequences.
Furthermore, the Improved Import & Export Magento 2 extension is integrated with Google Sheets. Thus, you can avoid using data files to move information to your e-commerce store. Feel free to leverage the extension’s functionality to run orders import to Magento 2 right from Google Sheets.
How the order import works
Order import would be incomplete without Magento 2 order export functionality. Try the order export procedure to get the sample file and see how the orders with their attributes can look in either CSV or XML.
We use the standard CSV format for our sample files. Let’s have a look at the order CSV table and to learn how it is composed and how different order attributes behave. Knowing the principle of the attributes’ work will help you understand the peculiarities of the import procedure.
Visit Master Google Sheets Table for a sample file
Explore Magento 2 order file structure
The list of order attributes is relatively extensive, however, to perform a successful import you can go with just the required ones. Both options you can find in our Master Google Sheets Table, compare them, and follow the improved import logic.
Get a sample CSV file with full order attributes
Get a sample CSV with only required order attributes
As per the sample above, we can see that the orders are exported from the database preserving all attributes and values as they are stored in the DB.
When importing orders one needs to remember the following peculiarities:
- Orders are imported using both entity_id and increment_id attributes.
entity_id – is an internal order identifier used by Magento 2 to get the place for the order in the database. Magento 2 assigns entity_id automatically depending on the IDs already in the database. If the imported order has the same ID as the order already at the store – Magento 2 will assign a new ID to it automatically.
The order is not represented in the order details screen. The only way to see it from the Magento 2 admin panel is to look at the order details screen URL.
increment_id – is an actual order number, a unique order number that can be found in the order grid and in the invoice. The value is unique, two orders with the same increment ID cannot be processed by Magento 2.
- The products are assigned to orders using their SKUs. If the store doesn’t have a product with an SKU it is tied to, the imported order will still have a product reference. However, ‘reorder’ functionality will not be available.
- The customers are assigned to orders using their email addresses. If the store doesn’t have a customer with an email it is tied to, the imported order will still have customer details. However, such customers will be listed as guests.
- Both Magento 2 Community (Open Source) and Enterprise (Commerce) edition order tables can be imported into each other. Magento 2 Commerce has gift card and reward point attributes, however, Magento 2 Open Source ignores them, so you can import Commerce orders into Magento Open Source without any issues.
Improved Import and Export extension allows both export orders from Magento 2 and import orders. If you want to transfer the order history from one Magento 2 instance to another read the Improved Import and Export extension manual.
Generate invoice and shipment on import of tracking number
Magento 2 Improved Import and Export also allows filling any gaps in order shipment and invoicing data by importing shipment tracking numbers. The functionality introduces automatic shipment and invoice generation upon transferring tracking numbers to the store database. By enabling the corresponding options during import, you can significantly reduce the number of steps involved in the manual shipment and invoice management.
- The logic behind the Magento 2 tracking code import is strictly connected to product SKUs and item quantity.
- The shipment_track:track_number, shipment_track:title, and shipment_track:carrier_code attributes are crucial shipping data that must be specified.
- As far as order info is concerned, you’ll need only the increment_id attribute for the functionality to retrieve the necessary data.
- You can send email notifications to your customer every time a new tracking number is implemented into the database. Enable the ‘Send email from new tracks‘ to inform your customers about shipped orders.
To get to know the tracking code import explore the procedure details by visiting the Guide on how to import tracking numbers to Magento 2.
Get the sample tracking info import file at the Master Google Sheets Table.
The order export specifics revolve around a large number of entities that are included in any order. During export, you must decide what entities you need in your export file and keep in mind that some of them not be compatible with each other. The ‘Order Entities‘ is an extra filtering functionality unique for orders export.
The list of supported order entities for export you can find below:
- Items of Order;
- Products of Order;
- Payment Transactions;
- Item of Shipment;
- Comment of Shipment;
- Tracks of Shipment;
- Item of Invoice;
- Comment of Invoice;
- Credit Memos;
- Items of Credit Memo;
- Comment of Credit Memos;
- Status History;
- Tax Items.
Let’s see the order export process with the ‘Product of Order Entity‘.
First and foremost, you need to select ‘Orders‘ as an entity for export. Then you can configure other settings related to manual or automatic export, consecutive export, etc. See more details on improved export in the Improved Import and Export manual.
If you need to export product data related to your orders, you export them with selecting the ‘Products of Order‘ entity.
If the entity box is checked during the export you get the file with all the order product attributes existing in your store. A list of such attributes you can find in the attributes.txt file. Keep in mind that you can not import such attributes back to your database.
All in all, such an export strategy is similar to the ‘Items of Order‘ export (which is normally the standard product info export), except for the change in the attribute names (‘item‘ prefix transforms into ‘product‘) and the wider range of the attribute data you can get in your export file.
Then you proceed with selecting the export data source and file format, mapping, and additional filtering.
Other import extension features
If the aforementioned features are not enough for importing orders to Magento 2 in your particular case, we have a trump card. The Improved Import & Export extension supports orders import to Magento 2 via REST API. It connects to the REST API of the specified platform, gets all the necessary information, and moves it to the appropriate backend section of your store. Everything works seamlessly and with the minimum external interaction.
You cannot find a tool that supports a more extensive range of file formats. Therefore, the Improved Import & Export Magento 2 extension provides the highest possible connectivity in the whole ecosystem allowing you to import orders from every external system without any headaches. But what about issues caused by different standards applied to data files?
The Improved Import & Export Magento 2 extension allows you to prevent them due to the extensive mapping interface. Since every system has its attribute standards, you cannot import the external order file to Magento 2 without matching the third-party order attributes to the corresponding internal attributes of your e-commerce store.
Luckily, the Improved Import & Export Magento 2 module allows creating a mapping scheme right in the backend so that you don’t need to edit data files manually. It is especially useful in case of the Magento 2 marketplace synchronization that provides order data files on a regular basis. Instead of matching attributes of the external platform to default order attributes of Magento 2 before every import, you create a mapping scheme only once. Next, the module applies it automatically when you import orders to Magento 2.
Another vital aspect of orders import to Magento 2 with the Improved Import & Export extension is the ability to automate data updates. In case you are synchronizing Magento 2 with an external marketplace, this feature will help you save a plethora of time. Create any custom schedule for Magento 2 orders import using the standard cron syntax. Alternatively, you can select a predefined interval. Note that the selected range can be customized according to your business needs.
Thus, the Improved Import & Export extension enables you to create a new import profile that transfers orders to Magento 2 automatically matching external order attributes to native requirements without external help. In the case of one-time data migration, you can create a profile that can be launched only manually and still use the extensive mapping interface.
Also, note that the Improved Import & Export Magento 2 extension provides the ability to apply mapping presets. Being predefined mapping schemes, they essentially simplify the order import process since you can match all external order attributes to internal Magento 2 rules in just a few clicks. Our team is working hard to create as many presets as possible, but we recommend you contact support regarding the mapping schemes you need.
As you can see, the Improved Import & Export extension provides a broad variety of file formats suitable for data transfers, supports REST API connections, and allows automating every order import to Magento 2. It is the most user-friendly and fully-featured tool to import orders to your e-commerce store. Check the following video to discover other features of the extension:
To find more information about the Improved Import & Export Magento 2 extension, follow the link below. Contact our support team regarding any inquiries related to the order import functionality of the module and other extension features.
Get Improved Import & Export Magento 2 Extension
Order import/export FAQ
How to export orders from Magento 2?
If you want to export a list of sales orders from Magento, you can use its default functionality. Go to Sales -> Orders of your administration and hit the Export button. Alternatively, you can export orders from Magento 2 using the procedure described in this article.
How to add quantity ordered to export in Magento 2?
You need the Improved Import & Export extension to transfer all the order data from Magento 2. Use the procedure described above.
How to import orders to Magento 2?
As we’ve already mentioned above, you cannot import orders to Magento 2 with the help of the platform’s default tool. Therefore, you need a third-party extension to transfer order data to your e-commerce storefront. Use the Improved Import & Export Magento 2 extension described above.
How to import orders from Magento into Shopify?
You can easily import orders from Magento 2 to Shopify or any external platform following this algorithm:
- Export orders from Magento 2
- Edit the exported file following the requirements of Shopify or the system you want to move it to. You may need to change a file format as well as set new column names.
- Import orders to Shopify or the system you want to move it to.
That’s it! However, it is possible to simplify order transfer between Magento 2 and external platforms with the help of third-party extensions. For instance, you can use the Improved Import & Export Magento 2 module to export orders from the first system and rely on the Improved Import & Export for Shopify to move them to the second one.
It is possible to apply a similar approach when importing purchase orders from Magento into Quickbooks or other accounting services, CRM systems, or ERP platforms.
How to import and export orders in Magento 2 automatically?
You need to use the Improved Import & Export extension to transfer orders to/from Magento 2 automatically. The module lets you create cron jobs that import and export order data at a specified point in time.
How to use API to import and export orders in Magento 2?
The Improved Import & Export Magento 2 extension also lets you use API transfers to move orders to/from the system. You can create a seamless connection between your e-commerce website and an external platform transferring information between them without any additional exchange points.
How to import orders to Magento 2 from Google Sheets?
Improved Import & Export also comes in handy when you need to import orders from Google Sheets. We’ve described this procedure above.
How to import and export orders in Magento 2 via XLSX?
You need the Improved Import & Export extension to import orders in XLSX and XLS formats. The extension lets you export orders using both standards. Note that our module also works with CSV, XML, ODS, and JSON.
How to import orders to Magento 2 in file archives?
Since Improved Import & Export works with ZIP & TAR formats, you can import compressed data files with the help of the extension. The module will unpack them automatically.
How to retrieve targeted data from your database or import files while transferring orders?
With the Improved Import & Export module, you get the ability to run full or partial Magento 2 order import and export. It means that you can retrieve targeted data from your database or import files or transfer all orders in one go.
How to generate shipments upon order tracking code import and export?
The Improved Import & Export module lets you generate shipments automatically when you import or export Magento 2 order tracking codes. Furthermore, you will stay informed on each track created in the store due to email notifications. Now, you can import and export Magento 2 tracks of shipments and generate shipment and invoices upon a job run.
How to schedule Magento 2 order import and export?
As we’ve already mentioned above, you can leverage cron jobs to run automatic import and export. Furthermore, it is possible to get the most out of order export with Magento 2 events: Improved Import & Export can launch data transfers when specific conditions are met.
What are the Magento 2 order import and export sources supported?
The Improved Import & Export extension lets you leverage the following data sources for Magento 2 order transfers: REST and SOAP API, FTP/SFTP, Dropbox, Google Drive, Google Sheets, URL, file upload, etc. As for the default Magento’s capabilities, they are fairly limited.
How to deal with external data standards while importing orders?
With the Improved Import & Export extension, you get the ability to leverage a powerful mapping interface. The module’s Magento 2 order attribute mapping lets you control your import and export job runs with powerful mapping functionality. It enables you to manage both massive data updates and single modifications of attributes and attribute values.