Setting up order routing
Order routing rules determine the locations to use to fulfill each item in a customer order. You can add, edit, remove, and rearrange order routing rules determine how locations are prioritized.
You can also review common order routing configurations, such as always ship from the closest location or prioritize your closest warehouse location.
On this page
Add an order routing rule
From your Shopify admin, go to Settings > Shipping and delivery.
In the Shipping section, click Order routing, and then click the
icon.
Click Add rule.
Click a rule that you want to add.
Click Save.
Edit an order routing rule
From your Shopify admin, go to Settings > Shipping and delivery.
In the Shipping section, click Order routing, and then click the
icon.
Click the pencil icon next to the order routing rule that you want to edit.
Make the edits to your order routing rule, and then click Done.
Click Save.
Rearrange the priority of your order routing rules
From your Shopify admin, go to Settings > Shipping and delivery.
In the Shipping section, click Order routing, and then click the
icon.
Click and drag the ⠿ icon next to an order routing rule, and then move the rule to adjust the priority.
Click Save.
Remove an order routing rule
From your Shopify admin, go to Settings > Shipping and delivery.
In the Shipping section, click Order routing, and then click the
icon.
Click the trash can icon next to the order routing rule that you want to remove.
Click Save.
Routing rule extensibility
Including the default rules, order routing rules are implemented as Shopify Functions. Third-party developers can implement and contribute their own custom location rules.
Every rule other than the default rules that are listed in the Routing rules section can be considered a custom rule. Custom rules can be identified in the following ways:
- In the Shopify admin, with the icon of the app that provides them for rules in a strategy.
- In the Shopify admin, with the icon and name of the app in the Add Rule modal.
- In GraphiQL, with the
shopifyDevelopedfield of the app associated with the rule.
Common order routing configurations
The following are suggested configurations for order routing rules. You can follow them to set up rules that meet your store's needs.
Always ship from the closest location
If you prefer shipments to always ship from the closest location, even if it means splitting up the order into multiple packages, then use the Ship from closest location rule on its own.
Steps:
From your Shopify admin, go to Settings > Shipping and delivery.
In the Shipping section, click Order routing, and then click the
icon.
Click Add rule.
Click Ship from closest location. If this rule is grayed out, then it means that it’s already active in your configuration.
Click the
xicon on any other rules in the configuration until only the Ship from closest location rule remains.Click Save.
Prioritize your closest warehouse location
If you have some locations that should ship orders first, such as a third-party logistics service or warehouse, then rank those locations above your non-warehouse locations.
Steps:
From your Shopify admin, go to Settings > Shipping and delivery.
In the Shipping section, click Order routing, and then click the
icon.
Click Add rule.
Click Use ranked locations.
Click ⠿ and drag to move the rule to the top of the list.
On the rule, click the ✎ pencil icon to open the configuration modal for the rule.
Drag warehouse locations to the topmost location group. Leave any locations that shouldn't be prioritized in the bottom location group.
Click Done.
If you have multiple warehouse locations, then add the Ship from closest location rule at the end to break any ties.
Click Save.
Troubleshooting order routing
If an order isn't assigned to the location that you expect, then review the following common issues and solutions. Most unexpected order routing results are the rules working as designed.
Troubleshoot an order assigned to an unexpected location
When an order is assigned to a location that you didn't expect, check the following causes in order:
- The location doesn't fulfill online orders. A location that doesn't have Fulfill online orders from this location turned on in Settings > Locations is excluded from order routing.
- The location's address isn't verified. The Ship from closest location rule can't measure the distance to a location with an unverified address, so that location is skipped. Verify the address to include the location in future orders.
- The location was out of stock when the order was placed. Inventory is one of the inputs that your rules prioritize, and what counts is the inventory at the time of the order rather than now, so a location that was out of stock then can be passed over.
- The location isn't in an active shipping zone for the destination. The location needs to belong to an active shipping zone that covers the destination country in the relevant shipping profile. The zone doesn't need to have rates.
- The customer's address couldn't be matched to coordinates, which is more common outside the United States. In that case the Ship from closest location rule is skipped and your oldest location is used instead. Change the location of the fulfillment to ship the order from somewhere else.
- Two locations ranked equally. When your rules leave two locations with the same priority, the older location is selected. To control which one is used, add the Use ranked locations rule.
Your settings might also have changed after the order was placed. Before you investigate further, confirm whether your locations, shipping profiles, or routing rules were changed after the order came in.
Troubleshoot an order assigned to a location without enough inventory
Order routing sometimes assigns an order to a location with no available inventory when another location has stock. This is expected: the order is allowed through so that you don't lose the sale, and you can move inventory or change the location of the fulfillment before you fulfill it.
Order routing doesn't prevent overselling. If orders are placed for items that you don't have, then review your settings for selling out of stock products.
Troubleshoot an order split across multiple locations
Order routing can split an order across locations when no single location can fulfill it, such as when no location has every item in stock, or when the order is too heavy for the shipping options available from one location. The Minimize split fulfillments rule reduces splits, but it can't prevent them when a single location can't complete the order.
Troubleshoot order routing rules that aren't applied
Order routing applies only when your store has two or more fulfillment locations. With a single location, every order is assigned to that location and your routing rules have no effect.