Shopify order routing from internal first then external

Topic summary

Goal: Prioritize internal inventory for each item, then fall back to a product’s assigned external provider when internal stock is insufficient, allowing split fulfillment within one order.

What’s happening: Shopify’s order routing evaluates eligibility at the order level. If any line can’t be fully covered by the internal location, the entire order is deemed ineligible there and routed to the next location with full availability (external). Ranked locations don’t enforce per-item partial allocation.

Constraints: Native Shopify routing doesn’t support “internal-first per line item with partial quantities.” This is expected behavior per support.

Workarounds proposed:

  • Build a custom app/middleware to inspect new orders, check per-item stock, and split fulfillment across internal and external locations as needed, preserving tags for external-provider usage.
  • Use a third-party routing tool that supports per-item partial allocation.

Next steps/updates: The poster plans to seek/build an app and is exploring Shopify’s GraphQL FulfillmentOrder object (represents fulfillment work for locations). It’s unclear from the discussion whether FulfillmentOrders must be created manually or modified after Shopify generates them.

Status: Open; solution requires custom or third-party routing. Key question on FulfillmentOrder creation remains unanswered.

Summarized with AI on December 11. AI used: gpt-5.

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.

1 Like

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).