Shopify order routing from internal first then external

Hi, we’re building an integration for one of our clients, and we’re running into issues with how order routing assigns locations.

For context, we have two inventory locations:

  • An internal location, where the client keeps their own stock

  • An external location, where an external provider has stock available if the internal location runs out

We have multiple external providers, but each product can only belong to one external provider. So, for each product, there will be a maximum of two stock sources: internal and external.

What we want is simple:
Always fulfill from the internal location first, and only when that stock runs out, move to the external provider (even if that means splitting fulfillment across both locations).

Example:
Product A → 10 internal stock, 100 external stock
If a customer orders 25 units of Product A, we want Shopify to use the 10 internal units first, and then take the remaining 15 from the external provider.

This is important because we have a webhook that automatically tags new orders when they require an external provider (internal stock runs out, and external stock is used).

We tried using an order routing rule with ranked locations, giving the internal location the highest priority and the external one the second priority. But this hasn’t worked consistently.

For example:

  • Product A → 10 internal, 100 external

  • Product B → 10 internal, 100 external

If someone orders more than 10 units of each product, Shopify should ideally assign 10 from internal and the rest from external for each product.
But instead, Shopify assigns the entire order to the external location.

We reached out to support, and they told us this is expected behavior because the rule is applied at the order level, not the line-item level. So Shopify logic seems to be:

  1. Try assigning the entire order to the internal location → fails

  2. Try assigning the entire order to the external location → succeeds

  3. Route everything to external

Is there any way to configure Shopify to follow the logic we want?
Or does anyone know of an app that can handle this type of partial, split-by-availability routing?

Thanks in advance to anyone that sees this

Right now, Shopify’s native order routing can only evaluate inventory at the order level, not per line item. So when a single product in the order exceeds the internal location’s stock, Shopify marks the entire location as “not eligible” and routes the full order to the next location with complete availability. That’s why you’re seeing everything shift to the external provider, even when partial internal stock exists.

Unfortunately, Shopify doesn’t support the “use internal stock first, then fall back to external on a per-item basis” logic out of the box.

The good news is that we can achieve the exact workflow you want in one of two ways:

  1. Implement a lightweight custom app or middleware that intercepts new orders, checks available inventory per item, and automatically splits fulfillment between internal and external locations.

  2. Use a third-party routing tool that supports per-item partial allocation rather than Shopify’s all-or-nothing approach.

Either option will give you the precise behavior you described… internal first, external only when needed, and accurate tagging for external-provider fulfillment.

Thank you for the response, Vincent. It looks like we’ll need to look for an app or possibly build one ourselves. We’ve taken a quick look at the GraphQL documentation, and it seems we’ll need to work with the FulfillmentOrder object.

We’re still unsure whether we need to create these objects manually or if Shopify generates them automatically and we only need to modify them afterward.
Leaving this here in case someone else runs into the same issue (at least this should give you a starting point so you don’t lose as much time figuring out where to look).

What usually breaks here is treating routing as one decision instead of two. First you need the system to reserve what the internal location can truly cover at line level, then you need a clean fallback for the remainder without losing visibility on which units went external. If Shopify is evaluating the whole order as one eligibility test, you end up with the all-or-nothing behavior you are seeing, and the expensive part becomes cleanup around tags, customer promises, and exception handling.