Understanding order routing
Order routing works by applying a series of rules to an order and then prioritizing locations based on the results. The locations with the highest priority ranking are selected to fulfill the order.
By default, rules are configured to optimize for fulfillment from the closest location within the destination market that has all of the items in the order in stock. There’s no need to modify your order routing settings if the default settings work for your business.
On this page you can learn more about the different order routing rules and review an example of order routing configuration.
On this page
Order routing rules
You can use different order routing rules to customize your order routing strategy. The default order routing strategy includes the following rules in this order:
- Minimize split fulfillments
- Stay within the destination market
- Ship from the closest location
Ranked locations and location metafields rules can be added more than one time to a strategy.
Review the following table to learn more about order routing rules and how to configure your order routing settings.
Rule | Description |
---|---|
Minimize split fulfillments |
Optimize for fulfilling the order in the fewest number of packages. Locations that have all items in stock are prioritized over those that don’t. When none of your locations have all of the items in stock, this rule will prioritize the locations that result in the fewest number of packages. |
Stay within the destination market | Locations within the same market as the shipping address are prioritized. Learn more about International |
Ship from closest location |
The location closest to the shipping address (measured in a straight line using the Haversine formula) will be prioritized. The Ship from closest location rule functions as a tiebreaker and will always select the location closest to the destination address. For best results, this rule should always be the last rule applied. If there are two locations that share the same address, then the older of the two (based on the date they were added to Shopify) will be prioritized. |
Use ranked locations |
Prioritizes locations using a group-based ranking that you define for your business. For example, if you want your warehouses to be prioritized over your storefront locations, then create a location group for all of your warehouses and another location group for all of your storefronts. Locations in the first group will be prioritized over locations in the second group. Locations in the same location group share the same rank. For example, all of the locations in the topmost location group share a ranking of 1, whereas all of the locations in the second location group share a ranking of 2. |
Use location metafields |
Prioritizes locations based on the values of your different location metafields. You can use a boolean or single numeric type location metafield. For example, if you define a boolean location metafield named |
Example order routing
Rules run from top to bottom, and each rule is applied to the results of the previous rule. The final result determines which locations fulfill the order. The following is an example of how order routing rules are applied:
First, a customer places an order with a New Jersey shipping address. The store has 4 locations that can potentially fulfill the order: New York, Vancouver, Miami, and Texas.
The order routing rules are configured to be applied accordingly:
- The Minimize split fulfillments rule is applied. New York, Vancouver, and Miami have all of the items in stock, so they continue to the next rule. Texas does not.
- The Stay within the destination market rule is applied. The order is being shipped to an address in the United States, so New York and Miami continue to the next rule. Vancouver does not.
- The Choose closest location rule is applied. New York is closer to New Jersey than Miami, so New York is prioritized and Miami isn't.
- The order is assigned to the New York location.