Do orders created by a Sales Channel app follow order routing logic?

garrett_s
Shopify Partner
5 0 1

We develop a Sales Channel app that can create orders on a user's Shopify admin. These orders do not seem to follow the user's order routing logic that they have set up. This causes a lot of problems and manual work for the user. Is there any way to create orders that follow the user's order routing logic?

Replies 2 (2)

Liam
Shopify Staff
2731 301 779

Hi Garrett_s,

 

If you create orders using a Sales Channel app, it's important to consider how those orders are going to be fulfilled. Shopify provides an Order API that allows you to create orders, but it doesn't automatically assign them to a specific location for fulfillment based on the merchant's order routing logic.

 

To ensure that your orders follow the user's order routing logic, you can use the FulfillmentOrder resource. This resource represents the strategy for how an order will be fulfilled and it can help you to automate the fulfillment workflow. We also have some documentation on order routing apps here  but here are the basic steps you can follow:

  1. Create an order using the Order API.
  2. Retrieve the order's FulfillmentOrders.
  3. Assign the FulmentOrders to a based on the user's order routing logic.
  4. Request fulfillment for the FulfillmentOrders.

Remember to handle any exceptions that might occur during this process, such as a location not having enough inventory to fulfill an order. Hope this helps!

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

garrett_s
Shopify Partner
5 0 1

Thanks for the reply, 

 

Step 3 of your suggestion involves us handling the order routing logic. We are wondering if there is a way to create an order via API and have Shopify create the fulfillment order for this order based on the order routing rules set up by the user. We have found that once we create an order via API, Shopify automatically creates a fulfillment order. This fulfillment order is already assigned to a location that seems to be chosen arbitrarily and does not follow the user's order routing logic. Our only avenue is to "move" the fulfillment order to the correct location. This requires knowing what the correct location is, i.e. knowing inventory at each location and accounting for the complex order routing logic. Is there any way to create an order via API and have Shopify create the fulfillment order for the order based on the user's order routing rules?