GraphQL error when trying Fetching the assigned location ID for a fulfillment order example

Highlighted
Tourist
12 0 3

I am trying to get the assigned locations for line items on an order.  This, I was told was part of the 2019-10 api version.

 

I am using sample GraphQL query provided here:

https://help.shopify.com/en/api/guides/managing-fulfillments-with-fulfillmentorders

under teh subhead:  

Fetching the assigned location ID for a fulfillment order

 

{
  order(id: "gid://shopify/Order/1205103689784") {
    fulfillmentOrders(first: 10) {
      edges {
        node {
          id
          status
          assignedLocation {
            name
            location {
              id
            }
          }
          lineItems(first: 10) {
            edges {
              node {
                id
                totalQuantity
                remainingQuantity
                lineItem {
                  sku
                  variant {
                    id
                    displayName
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

I change the order ID to one that exists in my dev store, retrieved from the json response for that same order via REST api.  ("admin_graphql_api_id": "gid://shopify/Order/1860968579129")

 

When I try this call using Shopify GraphiQL App, I get an error:

"message": "Field 'fulfillmentOrders' doesn't exist on type 'Order'"

 

Does anybody get Shopify assigned locations for line items on orders?  Is this the right method?   Is this NOT exposed via REST ?

 

Thanks

 

Roy.

 

 

 

 

 

0 Likes
Shopify Staff
Shopify Staff
223 28 28

Hi @rplum 

 

Can you confirm which version you are using. The document you linked has a note on the top that reads: 

Vix | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 


0 Likes
Tourist
12 0 3

Thanks for this,

 

I am using 2019-10.  I understood that the references I need to know which locations items on an order location are assigned to was available in this version, and that's also what Shopify told my clients.

 

I do not need to create fulfillments, but rather I need to know where Shopify has assigned items on the order initially to be fulfilled from.  The filfillmentOrder seems to be the way to do this.  Is there another method I should be using for this?  (using 2019-10)

 

The link you provided does not appear to provide this information.  Or am I missing something ?

 

Thanks

 

Roy.

 

 

 

 

0 Likes
Shopify Staff
Shopify Staff
223 28 28

Hey Roy, 

 

As stated above, the example you have provided is for the unstable version of the API only at this moment. The error you are receiving is due to FulfillmentOrder not being present on the schema for your version. If you flip your call to have unstable in the version, it will work. 

 

Alternatively, if you want to do this in a prior version, please check the doc: https://help.shopify.com/en/api/guides/managing-fulfillments

Vix | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 


0 Likes
Tourist
12 0 3

Vix,

 

I understand that, but my client was told by Shopify that the calls I need are already available in 2019-10.

 

So my question is NOT "why does this call not work", but what calls are in 2019-10 that will tell me what locations items on a newly placed order are assigned to?   -- BEFORE any fulfillments are created.

 

I am not seeing any information in the link you provided to me twice that provides this information.  If it is there and I am missing it, I apologize. Can you tell me the specific call that tells me this ?

 

If the information I am seeking is not available in 2019-10, then I need to tell my client that Shopify has misled them and the calls needed to know where Shopify assigned the location for items on orders is are not yet available for their store.

 

 

Thanks

 

Roy.

0 Likes
Shopify Staff
Shopify Staff
223 28 28

Roy, 

 

The link I have provided outlines the steps of accessing the line item location ID. You will need to follow steps 1-3, step 4 is where the order is fulfilled and you do not need to do this step. This is done through REST are you looking to only use GraphQL?

 

Step 1: Query the order to see its line items: this allows you to obtain the line items and IDs 

Step 2: Query the variant for its inventory item: this allows you to obtain the inventory item ID required to see the location

Step 3: Get the inventory levels: This displays the location ID 

 

This relation between the three steps is best outlined in the diagram featured here: https://help.shopify.com/en/api/reference/inventory/inventorylevel

 

Let me know if that makes more sense, 

 

Vix | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 


0 Likes
Tourist
12 0 3

Vix,

 

Step 3 will tell me all the locations where the item is stocked,  Not which Shopify has provisionally deducted  it from inventory.

 

I actually already know the inventory item IDs and the locations the items are available from.  I am setting these values.

 

What I need to know is , when the order is placed initially, Shopify provisionally deducts the item from inventory of a specific location.  How do I find out which location out of several possible locations the items may be stocked in, did Shopify deduct the item on the order.

 

I know that Shopify knows this because I can see the inventory assignment in admin when reviewing the order.

 

What I need to know is how to find out which location Shopify deducted the inventory from when the order was placed via either REST or GQL

 

Here's a step by step.

 

Item A is stocked in location 1, 2 and 3.

 

I set the qty in each location to 5,  so there is a total of 15 available.

 

A shopper purchase item A qty 1.

 

Shopify knows there are now only 14.  one of the locations now has only 4.  It has provisionally decided which location to deduct the item from.

This should be a property of the item on the order, right ?   How do I find out via API which location Shopify has deducted (or allocated) the item from?

 

Take care,

 

Roy.

0 Likes