How to Create a Flexible Order Routing System on Shopify
![](https://cdn.prod.website-files.com/61b51cc08207921f523c5704/665418d3203506dcff10ad18_order-routingv.png)
Optimizing the fulfillment process is one of the best ways to make sure you’re delivering an excellent experience to the customers on your Shopify store. While there are plenty of ways you can enhance your fulfillment strategy, from working with 3PL vendors like ShipBob, to leveraging apps for warehousing, freight, and shipping optimization, order routing is a great first step.
If you’re shipping products to various customers around the world, your order routing strategy is crucial to ensuring you can automatically ship orders from the best fulfillment location for your customer, whether that’s a warehouse, retail store, or third-party logistics provider.
In 2023, Shopify announced the arrival of its “Smart Order Routing” system, a new solution that gives merchants more flexibility when deciding how to route orders to various locations. The solution adds flexibility to the ecommerce platforms’ previous one-size-fits-all routing strategy, opening the door to more effective multi-location fulfillment strategies.
Here’s how you can create a flexible order routing system, with Shopify Smart Order Routing.
What is Smart Order Routing?
Order routing is the process of controlling how orders are processed for your fulfillment journey. When a customer places an order with a Shopify store, one of the first things retailers need to decide is which location the order will ship from. This is a simple task for merchants fulfilling orders from a single location.
However, if you’re selling products to customers all over the world, the process becomes a lot more complex. That’s why Shopify developed its smart order routing system. This allows companies to automatically prioritize the best location for fulfilling an order, based on a set of rules. You can choose from four prioritization rules out of the box, including:
- Ship from the closest location
- Stay within the destination market
- Minimize split fulfillment
- Ranked locations
Once these rules are chosen for your store, you can rank them in order of priority using a drag-and-drop system. When an order comes through to your store, the system checks which fulfillment locations have the right inventory available, then applies your routing logic for fulfillment.
The Benefits of Smart Order Routing with Shopify
Before Shopify offered smart order routing, the only option merchants had was to set a prioritized list of locations to route orders to. The Shopify algorithm would automatically try to prioritize shipping all of the items within a single order from one location by default.
While this strategy works for some companies, Shopify wanted to make the routing experience more flexible for merchants, based on their specific goals. With flexible and smart order routing, companies can maintain control over their fulfillment operations, and adapt their shipping strategy to their business needs, whether that means reducing split fulfillments (to save costs on shipping), or prioritizing warehouses closest to your customer’s location.
Smart order routing makes it easier to scale your fulfillment strategy across multiple locations through automation, and it can also:
- Reduce shipping costs: Setting order routing rules to ship orders from a location closest to a customer, and reduce split orders, you can save on shipping costs.
- Increase delivery speeds: Delivering products from the location nearest to your customers is a good way to reduce transit times, resulting in faster delivery and increased satisfaction.
- Improve customer loyalty: Faster delivery times and lower shipping costs can lead to higher customer loyalty and satisfaction, boosting your potential for profits.
How to Create a Flexible Order Routing System with Shopify
To give merchants as much control as possible over their order routing strategy, Shopify uses two things: routing rules, and Shopify Functions. Routing rules are the functions that determine how possible fulfillment locations are prioritized by Shopify.
You can choose to:
- Ship from the closest location: With this rule, Shopify will automatically calculate the distance between a warehouse location and the address of the customer, and choose the location with the shortest distance. This can increase shipping speeds and reduce costs.
- Stay within the destination market: This rule allows you to ensure you’re not paying extra duty and taxes for international shipping. If you operate in multiple geographies, this strategy can also reduce the risk of packages being lost.
- Minimize split fulfillments: If you have multiple warehouses, you may also have inventory split among different locations. Minimizing split fulfillments helps to reduce the risk of having to ship multiple items from a single order from different locations.
- Use ranked locations: With this rule, you rank your preferred fulfillment locations. For instance, you might prioritize routing products from your warehouses instead of your retail stores, so your retail stores aren’t left without inventory.
While all of these options are excellent for setting up flexible routing rules, Shopify wanted to ensure they could take the experience a step further. They wanted to give retailers a way to further customize how to route their orders using their own routing rules. That’s where “Shopify Functions” comes in.
Shopify Functions and Flexible Routing Rules
Shopify Functions are resources that run inline on Shopify’s global infrastructure, and allow companies to customize the backend logic of their ecommerce platform. Functions can help companies do everything from implementing checkout validation rules, to displaying product bundles in the Shopify checkout page.
Previously, Functions were only available to merchants on Shopify Plus. However, now all companies can access various Functions, regardless of which plan they’re using.
This means with the help of a developer, you can use Shopify Functions to create your own routing logic, compiled into a WebAssembly module that can be plugged into the Shopify server. The order routing API allows users to create the routing logic that best aligns with their business, creating new rules depending on the complexity of your fulfillment strategy.
Using Shopify Functions for Routing Rules
To explain how developers can use Shopify Functions to create flexible routing rules, Shopify shared insights into its own experiment, building three default routing rules powered by functions written in Rust. The rules were for shipping from the closest location, staying within the destination market, and using ranked locations.
According to Shopify, when the system runs the logic created by the new “Functions”, it ranks the various locations available based on the criteria available. The location that best meets the criteria for the routing rules is ranked at “0”, followed by the next-best option ranked at “1”.
When merchants select the routing rules they want to use for their store, each rule runs independent of the others, and produces a ranking of locations individually. In the event that two or more locations are both ranked as the “best option”, developers can implement a “tie breaker” rule or “reducer”.
This “reducer” processes the results of all the selected rules to determine the best possible location to route the order to. Notably, when Shopify built its own routing rules with Shopify Functions, it also used the “pipeline” pattern, so the entire process is broken down into steps. This helps to ensure a clean separation between all of the concerns of the steps involved, and better debugging.
It’s probably a good idea to take the same approach when you’re creating your own Shopify Functions. However, a developer should be able to help you implement the right strategy.
Other Options for Improved Order Routing on Shopify
Aside from experimenting with Shopify’s smart routing rule sets, or creating flexible routing rules with Shopify Functions, there are other ways you can optimize your routing and fulfillment strategy. The best option is to leverage Shopify apps, created by other Shopify developers.
There are various apps available on the Shopify app marketplace that can help with things like multi-source order routing, and multi-channel product listing, as well as dropshipping automation, if you’re leveraging third-party suppliers for your store. A few popular choices include:
- Duoplane: This app automates order routing and management tasks, as well as providing access to shipping information, inventory syncing tools, vendor invoicing, returns management, and accounting integrations.
- Flexpoint: Flexpoint is a distributed order management, inventory management, and dropship vendor management system. It gives you the tools you need to connect your store to various suppliers, vendors, and fulfillment sources for automated order routing.
- Order Fulfillment Guru: This app allows you to route multi-warehouse and vendor orders according to various rules. You can also split and send orders to different parties, and sync orders, inventory, and products between Shopify stores.
- Onport: Onport is an ecommerce marketplace and dropshipping platforms that includes tools for order routing, syncing, and splitting, shipping workflow management, payments automation, returns management, and inventory syncing.
Notably, while some of these apps are free to install, others will charge you a monthly fee for access.
Upgrade your Order Routing Strategy
Smart and flexible order routing with Shopify is an excellent way to improve customer experiences, increase conversions, and boost your chances of business success. With the right tools, and automated rules, you can even save time and effort running your business, and cut down on the costs of shipping.
If you need help building a comprehensive, but flexible routing strategy for your business, reach out to Storetasker today to be matched with an expert Shopify developer.