Locations for every order

Hi All,

So we have a working integration that exports sales orders to a system outside of shopify (for manufacturing). However, in the shopify admin UI, a location for the order is always shown, but on the api I can’t seem to get that reliably.

So as you see in this example, the Location in this unfulfilled order is Parkway 4500.

Is there some way to get that reliably without creating a fulfillment order?

the location_id often doesnt give it, and from my reading is not supposed to, but please, correct me how to do this?

Thanks

Jussi

To confirm, your requirement is to retrieve the location details associated with an order before it has been fulfilled, using the API.

Yes, exactly as it is listed in the admin UI, but I cannot seem to get from the API.

Could you please try using the below API to fetch the fulfillment details?

query MyQuery {
  order(id: "gid://shopify/Order/5559958503484") {
    fulfillmentOrders(first: 10) {
      edges {
        node {
          assignedLocation {
            location {
              id
              name
            }
          }
          lineItems(first:5) {
            edges{
              node{
                id
              }
            }
          }
        }
      }
    }
  }
}

{
“data”: {
“order”: null
},
“extensions”: {
“cost”: {
“requestedQueryCost”: 35,
“actualQueryCost”: 1,
“throttleStatus”: {
“maximumAvailable”: 2000,
“currentlyAvailable”: 1999,
“restoreRate”: 100
}
}
}
}

Did you pass your store order ID in the query?

order(id: "gid://shopify/Order/5559958503484") {

Yes, I did - I changed yours for an example order from our test store.

Sigh. I pasted the wrong bit. Wow. I apologise:

{
“data”: {
“order”: {
“fulfillmentOrders”: {
“edges”: [
{
“node”: {
“assignedLocation”: {
“location”: {
“id”: “gid://shopify/Location/66217279642”,
“name”: “Parkway 4500”
}
},
“lineItems”: {
“edges”: [
{
“node”: {
“id”: “gid://shopify/FulfillmentOrderLineItem/13566144970906”
}
}
]
}
}
}
]
}
}
},
“extensions”: {
“cost”: {
“requestedQueryCost”: 35,
“actualQueryCost”: 9,
“throttleStatus”: {
“maximumAvailable”: 2000,
“currentlyAvailable”: 1948,
“restoreRate”: 100
}
}
}
}

1 Like