Order Commit process

Hello
I have a question regarding the Order Commit process. I’m using the REST Order API to create orders, and when I post an order to Shopify, I want it to be committed to a specific location based on user preference.

Suppose I have three locations: A, B, and C. Location A is set as the default, and each location has sufficient inventory. However, I’ve noticed that every time an order is committed, it always gets assigned to the default location (A), regardless of the user’s selection.

I want the order to be committed to different locations depending on the user’s preference. Is it possible to achieve this? If so, how can I implement it?

Thank you.

Hi Diwakar,

Shopify does not allow you to directly specify the fulfillment location when creating an order instead, Shopify assigns the fulfillment order to the default location that has available inventory. However, you can change the assigned location after the order is created by moving the fulfillment order to the desired location using the GraphQL Admin API.

First you’d get the fulfillment order ID by querying the order, and once you have the fulfillment order ID and the desired location ID, use the fulfillmentOrderMove mutation:

mutation MoveFulfillmentOrderToLocation {
  fulfillmentOrderMove(
    id: "gid://shopify/FulfillmentOrder/FULFILLMENT_ORDER_ID",
    newLocationId: "gid://shopify/Location/NEW_LOCATION_ID"
  ) {
    movedFulfillmentOrder {
      id
      status
    }
    originalFulfillmentOrder {
      id
      status
    }
    userErrors {
      field
      message
    }
  }
}