Shopify order routing picks the fulfillment location for each order, applying three default rules in sequence: minimize split fulfillments, stay within the destination market, then ship from the closest location, per Shopify’s documentation. Most merchants adjust it at Settings > Shipping and delivery > Order routing. Plus teams can go further with Shopify Functions, and we at Zcoder help with integration work.
TL;DR:
- When rules leave locations tied, Shopify chooses the location created first and may assign insufficient stock if no other candidate qualifies.
- Use location metafields for capacity or priority scores first; custom Shopify Functions require Shopify Plus and suit routing that needs live inputs.
- Treat each FulfillmentOrder as separate work, map its line items to order items rather than by position, and wait for the routing complete webhook.
- Before changing rules, verify online fulfillment, the customer address, inventory at order time, and active shipping zones; place a test order after saving.
Table of Contents
- How does Shopify order routing work by default?
- How do you add, reorder and save rules in Shopify Admin?
- How do location metafields help you prioritize warehouses?
- When do you need Shopify Functions for custom routing?
- What must integrators handle when orders split?
- Why did Shopify route an order to the wrong location?
- Metafields first, Functions second
- How we fix order routing and fulfillment problems
- FAQ
- Sources
How does Shopify order routing work by default?
Shopify evaluates your locations against each rule from top to bottom. Each rule narrows or ranks the candidates, and whatever survives the last rule is where the order goes.
- Minimize split fulfillments: if one location can ship everything in the cart, it beats locations that can only cover part of it.
- Stay within the destination market: a customer in Canada is matched to locations inside that market before any location outside it.
- Ship from the closest location: among the remaining candidates, the nearest one wins, measured as straight-line distance rather than driving or carrier distance.
When several locations tie after every rule, Shopify falls back to the older created location, which explains many “why did it pick that warehouse?” tickets.
Rules run in a fixed top-to-bottom sequence, and ties go to the older location. That means the order of your rules matters as much as which rules you enable. Source
Also keep in mind that routing can assign an order to a location with insufficient stock if no other candidate qualifies, which is how oversells happen.
How do you add, reorder and save rules in Shopify Admin?
Routing applies when your store has multiple active locations. The steps below follow Shopify’s setup guide.
- In Shopify Admin, go to Settings > Shipping and delivery.
- Open Order routing, then select Manage.
- Choose Add rule, then pick a rule type or Use ranked locations.
- Drag a rule by its handle (⠿) to change its priority, use the pencil icon to edit it, or the trash icon to remove it.
- Select Save.
Two configurations come up constantly. For a store that ships everything from the nearest point, keep the closest-location rule and drop the others. For a brand that wants warehouses to fulfill before retail stores, add a ranked locations rule with warehouses on top and stores below.
Pro Tip: Place an order from a test address after every rule change and check which location Shopify assigned before you tell the warehouse team anything changed.
How do location metafields help you prioritize warehouses?
Location metafields let you rank locations with your own data and no custom code. Shopify supports Integer, Decimal and True/False types, so a Boolean such as has_capacity or a numeric capacity field both work.

Create a metafield definition for locations, fill in a value for each location, then add a “Use location metafield” rule in Order routing and place it where it should rank.
Practical uses:
- Favor locations that currently have capacity by flipping
has_capacityoff when a warehouse is backed up. - Deprioritize a cold-storage site for general SKUs with a numeric priority score.
- Prefer fast-fulfillment locations by scoring them higher than slower partners.
Metafields only help if the stock data behind them is trustworthy. If counts drift, read our walkthrough on native inventory sync limits before building rules on top of them.
When do you need Shopify Functions for custom routing?
Reach for Functions when ranking depends on live inputs that a static metafield cannot hold. Apps can inject backend ranking logic at checkout through the Order Routing Location Rule API, scoring locations by things like inventory rotation or daily order capacity.
Shopify’s guide to order routing apps also covers fulfillment constraints and pickup option generators. Custom location rules are limited to Shopify Plus stores, as the location rules documentation states, so confirm your plan before scoping any build.
Typical patterns:
- A dynamic capacity score that drops a warehouse’s rank as its daily volume climbs.
- SKU-based blocking, so hazardous or oversized items never route to a location that cannot handle them.
- Per-country prioritization, so each market has its own preferred location order.
- Requiring certain products to ship together.
Pro Tip: Exhaust metafield rules first. If a nightly script updating a Boolean gets you the same result, you avoid maintaining a deployed Function.
For a tailored build, our Shopify Customization Services cover custom development.
What must integrators handle when orders split?
After checkout, Shopify creates one or more FulfillmentOrders, and integrations should treat each as its own unit of work. Shopify’s split carts documentation points to deliveryMethod.methodType to tell shipping from pickup, and to the fulfillment_orders/order_routing_complete webhook to learn when routing has finished.
Shopify splits items across locations automatically when no single location can cover the quantity. Any app calling fulfillment endpoints must handle a line item divided across several fulfillment orders. Source
What to build for:
- Query
fulfillmentOrdersrather than assuming one fulfillment per order, and paginate nested connections. - Map fulfillment order line items back to order line items, never by position.
- Use the
fulfillmentOrderSplitmutation when you need to move quantities into a new fulfillment order. - Listen for the routing webhook before pushing work to a warehouse.
Shopify’s partner guidance names treating an order as a single shipment as a common cause of sync errors. Our WMS integration guide shows how these objects map to warehouse workflows.
Why did Shopify route an order to the wrong location?
Run this checklist in order. These checks come from Shopify’s setup documentation.
- Confirm the location is enabled to fulfill online orders.
- Check that the customer’s address was verified.
- Review inventory at the moment the order was placed, not today’s count.
- Make sure the location sits in an active shipping zone; our piece on markets without shipping rates explains how gaps appear.
- Look for equal-ranked locations and reorder rules so the tie breaks your way.
If the order already exists, you can change its fulfillment location from the order page in Shopify Admin, and if a third-party warehouse has already received it, contact that partner first.
Pro Tip: Screenshot your rule order before editing. Reverting a misconfigured sequence takes seconds when you know the previous state.
Call a developer, or us, for repeated split-order sync failures, Function debugging, or ERP and WMS gaps.
Metafields first, Functions second
Most routing pain I see comes from teams skipping the boring checks. Turn on split minimization, verify locations and addresses, then test a checkout after every change. Reach for metafields before custom code, because they are cheaper to maintain. Build a Function only when routing needs real-time inputs or scoring a static field cannot express. If the problem lives in your ERP or warehouse system, bring in help early, because routing rules cannot fix bad data.
— Jason
How we fix order routing and fulfillment problems
If routing keeps landing orders in the wrong place, the root cause is usually inventory data, system sync or missing custom logic; for broader store optimization next steps, consider using Shopify SEO on Autopilot. Our Shopify WMS & Inventory Optimization service targets stock accuracy across locations, Shopify ERP Integration & Optimization targets reliable data flow between systems, and Shopify Customization Services covers tailored routing logic. Together they aim at fewer split shipments and routing that matches how you actually fulfill. Our engagements are fixed-fee. Browse everything on our ecommerce technology page or contact us to scope your setup.
FAQ
What is the default order routing sequence in Shopify?
Shopify applies three rules from top to bottom: minimize split fulfillments, stay within the destination market, then ship from the closest location. You can adjust the sequence under Settings > Shipping and delivery. Shopify documents the default order in its help center.
Can I use custom order routing logic without Shopify Plus?
Custom location rules built with Shopify Functions require Shopify Plus. Other stores can still use the built-in rules and location metafields to rank locations. Shopify’s location rules documentation states the Plus restriction.
How do I handle split orders in an integration?
Treat every FulfillmentOrder as a separate unit of work instead of assuming one shipment per order. Subscribe to the order routing complete webhook so you act only after routing finishes. Shopify’s split carts guide details the objects and webhook.
Why does Shopify pick the same location for equal-ranked options?
When locations tie after every rule, Shopify chooses the older created location. Reorder your rules or add a metafield rule to break the tie deliberately. The routing documentation describes this fallback.
