Get Location Id of the item on the order that shopify used, via the shopify order API

Highlighted
Tourist
3 0 1

Even I am having the same problem +1 for this feature.

0 Likes
Highlighted
Shopify Partner
112 3 20

+1 for this feature.

I couldn't find a way to get it with GraphQL either.
Using the draftFulfillments mentioned in other posts proved to be useless as it is always returning the default location.

 

Bogdan | WebShopAssist
User friendly apps with top-rated support
- SKUGen the SKU generator
- DPD Integration
0 Likes
Highlighted
New Member
4 0 0

Hi @JoesIdeas 

I used the Fulfillment Orders resource, which you can obtain via the Order endpoint.

This gives you a collection of lineItems and the location from which they should be fulfilled. 

0 Likes
Highlighted
Shopify Partner
534 38 109

This is definitely possible via the GraphQL API. Here is an example, where I pull the 10 most recent orders. Each order's first 10 line items are iterated, with each item's fulfillable location ID and name listed. 

I've found that some things that are either not doable via the REST API or else would require multiple steps are usually worth checking out in the GraphQL API. After you get used to the seemingly strange syntax it's not that bad!

{
  orders(first: 10, reverse: true) {
    edges {
      node {
        id
        name
        createdAt
        lineItems(first: 10) {
          edges {
            node
            {
              id
              originalUnitPriceSet {
                presentmentMoney {
                  amount
                  currencyCode
                }
              }
              discountedUnitPriceSet {
                presentmentMoney {
                  amount
                  currencyCode
                }
              }
              quantity
              product {
                id
                title                
              }
              fulfillmentService {
                location {
                  id
                  name
                }
              }
            }
          }
        }
      }
    }
  }
}

 

0 Likes
Highlighted
Excursionist
12 0 3