Smart order routing: product based decision making

Hello Community,

I am in the process of reworking our custom fulfillment processes and I am trying to achieve the following:
On order placement, I want to choose a fulfillment channel for most or all of the products based on a ranking of the product with the respective fulfillment channel, but the products are available in both channels and both channels are available for the order (same market, same products in both, no general ranking between the locations possible)

  1. order is placed
  2. with the MIP (most important product from line_items) choose fulfillment channel based on product priority for the MIP/channel
  3. create fulfillment orders based on this information

I have a custom logic to do that, but it means I have to completely ignore the fulfillment order splits done by shopify and I would like to have shopify reflect the actual state of affairs.

From what I tried and read in the docs, this is not possible with the default routing services.
Can I somehow inject some custom logic into the smart order routing to create such functions?

Thank you so much in advance

Theo

Hi Theo,

It sounds like you’re trying to implement custom fulfillment logic that Shopify’s default routing doesn’t fully support. One approach could be to use Shopify Flow or a custom app/webhook to evaluate your Most Important Product (MIP) and assign fulfillment channels before the fulfillment orders are created.

You could:

  1. Capture the order creation event via a webhook.

  2. Run your custom logic to determine the fulfillment channel based on the MIP.

  3. Use the Fulfillment API to create fulfillment orders that reflect your logic, rather than relying on Shopify’s default split.

This way, Shopify will reflect the actual state without ignoring the system entirely.

Other Shopify partners have successfully used private apps or Flow + custom scripts to handle advanced routing like this.

Would love to hear if anyone else has implemented something similar!

Hello Theo,

You are correctm you can’t inject custom logic directly into Shopify’s Smart Order Routing. It’s a closed process.

However, you can achieve your goal. The solution is to build an app that corrects the routing immediately after the order is placed.

Here is the short workflow:

  1. Trigger: Use the orders/create webhook to start your process the moment an order is created.
  2. Decide: Your app runs its “Most Important Product” (MIP) logic to determine the correct fulfillment location for the order.
  3. Correct: Use the fulfillmentOrderMove GraphQL mutation to move all necessary line items from Shopify’s default split to the single fulfillment order associated with your chosen location.

Pro-Tip: To prevent your fulfillment services from acting on the wrong order split, use the fulfillmentOrderHold mutation at the start of your process and fulfillmentOrderReleaseHold after your logic is complete.

This approach gives you full control over routing while keeping Shopify’s data accurate.

Hi Theo,

You’re correct — Shopify’s default routing and smart order routing don’t currently allow you to inject custom logic like ranking fulfillment channels based on your own product priorities. Shopify’s system will always try to split fulfillment orders according to its standard logic (location availability, stock levels, etc.), and there isn’t a built-in way to override that with a custom ranking.

If you want Shopify to reflect your logic (instead of just handling it outside), you generally have two options:

Custom App or Fulfillment Service API

You can build (or use) a custom app that listens for the orders/create webhook.

On order creation, your app applies your logic (MIP → fulfillment channel ranking).

Then the app can call the FulfillmentOrder API to reassign or move fulfillment orders to the location you decide.

This essentially bypasses Shopify’s smart routing and enforces your own.

Manual Workaround with Locations/Priorities

If the logic is consistent enough, you can sometimes simulate it using multiple locations with priority settings.

But since you mentioned both channels are always valid and priorities are product-dependent, this probably won’t fit well.

Unfortunately, you can’t “inject” your code directly into smart order routing — it’s a black box. The supported way is to use the APIs/webhooks to restructure fulfillment orders after Shopify creates them.

So in short:

Default smart routing can’t do this.

Custom app + FulfillmentOrder API is the way to make it happen if you want Shopify to reflect your actual fulfillment logic.

Thanks