Unlike importing customers orders has only one way to import i.e. via API Request. The very first thing we require is to export orders from Magento. Then we will write script to read the exported csv file and make API request to create order in shopify.

Exporting orders from Magento

There isn’t a specific way to export order but from my research i found this module to be very effective in exporting orders in detail. Module : Bulk Import+Export Orders to CSV. The sample this module provides is here. This module exports order in detail we require in shopify.

Importing orders in shopify

Script to retrieve information from the exported csv is below. It can be in any format as i am using the exported CSV from the module mentioned above. The logic is reading CSV file and accumulating all the required information in formatted array.

The above code fetches all the required information we require to import in shopify. The printr of above gives the data in below order.

i.e. we read order from the csv for multiple products and other essential values for shopify import. For eg. billing information, shipping information, multiple products customer has ordered, respective quantity, price and so on.

Now next big thing is to match order status & payment staus from Magento to shopify fulfillment status & financial status.

Convention in Order and payment status (For me it worked you can have different convention as required)

  • If order status from magento is complete, shipped, manufacturing, dispached or processing i mapped them to fulfilled as fulfillment status. else unfulfillment.
  • If base total paid from maento exists then i have mapped them to financial status as paid, else pending.
  • and in case of order status from magento is cancelled, i mapped them to voided as fulfillment status.
  • The discount amount, discount code and inclusive tax of product is planned to have in order notes in shopify.

This mapping is in general, you can have your own kind of mapping.

Below is the code to make api request in shopify. For this i have used shopify app skeleton. The request format can be in any format.

And this above request should create order in shopify. The screenshot below shows the order created in Shopify.



Ordered date can be very confusing because Shopify processes according to the timezone set on store configuration. If the customer is already imported and account is activated then the customer will be linked, but in my case above the customer is new so there is ‘no account’ level mentioned.

Suman K.C

eCommerce Developer, writes about stuff related to eCommerce development. Currently based in Kathamandu, loves reading about startups & new technology, introvert nature, fond of traveling & playing volleyball.

More Posts - Website

Follow Me:
LinkedInGoogle Plus