Shopify Order Routing: 3 Rules Before Custom Functions

Skip to content

Sign up to get $100 off your next service

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:


Zcoder

Route Shopify Orders With Confidence

Zcoder helps DTC brands optimize Shopify technology and inventory management, supporting more efficient operations as their fulfillment needs grow.

Explore Shopify support

Table of Contents

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.

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.

  1. In Shopify Admin, go to Settings > Shipping and delivery.
  2. Open Order routing, then select Manage.
  3. Choose Add rule, then pick a rule type or Use ranked locations.
  4. Drag a rule by its handle (⠿) to change its priority, use the pencil icon to edit it, or the trash icon to remove it.
  5. 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:

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:

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:

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.

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.

Sources