Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Order details from Orders API doesn't have the location id listed in location API

Order details from Orders API doesn't have the location id listed in location API

vptcalalog_Admi
New Member
8 0 0

I'm using orders REST API "/admin/api/2020-01/orders.json" to get orders from Shopify. In the order data I'm getting "location_id" field is always null. And "origin_location" field have different location Id which is not listed in locations API. For example, I have only one location listed in my store. So locations API returns one location detail with ID as say "L1". So I expect in order data either "location_id" or "origin_location" will have "L1". But in my case I'm getting null in "location_id" and some other value in "origin_location".

Replies 14 (14)

SBD_
Shopify Staff
1831 273 423

Hey @vptcalalog_Admi,

 

There was a similar question asked here: https://community.shopify.com/c/Shopify-APIs-SDKs/Multi-Location-Shipping-and-origin-location/td-p/6...

Scott | Developer Advocate @ Shopify 

vptcalalog_Admi
New Member
8 0 0

Hi @SBD_ ,

 

If origin_location specifies the place where order is placed, What does location_id field indicates. Till few days before, origin_location Id, I got is matched with the values I got from locations API.

 

So based on your reply, to determine the fulfillment place for each order, I have to use Fulfillment Order API.

SBD_
Shopify Staff
1831 273 423

Hey @vptcalalog_Admi,

 

In regards to an order, location_id is the ID of the physical location where the order was processed. I believe this is null if you don't use POS.

 

So based on your reply, to determine the fulfillment place for each order, I have to use Fulfillment Order API.

That's right. Let me know if you get stuck!

Scott | Developer Advocate @ Shopify 

vptcalalog_Admi
New Member
8 0 0

Hi @SBD_,

 

I tried to use API call ==> "/admin/api/2020-01/orders/#{order_id}/fulfillment_orders.json" in the fulfillmentorder page, as you suggested in your reply. But all I'm getting is an empty array.

Please reply as soon as possible.
SBD_
Shopify Staff
1831 273 423

Hey @vptcalalog_Admi,

 

Can you share demo store + order ID details?

Scott | Developer Advocate @ Shopify 

vptcalalog_Admi
New Member
8 0 0

Hi @SBD_ ,

 

I shared the details below,

URL: https://valleypt.myshopify.com/admin/api/2020-01/orders/5082881732/fulfillment_orders.json

App ID: bbea9154baa778a8f1b7ae680ac8a907

Order ID: 5082881732

vptcalalog_Admi
New Member
8 0 0

Hi @SBD_,

 

Is there any update on the issue? This is kind of urgent issue that needs to be fixed as early as possible. Please reply soon.

SBD_
Shopify Staff
1831 273 423

Hi @vptcalalog_Admi,

 

It could be that those test orders are from 2017 - are you able to test this with a fresh order?

 

Also, you'll probably need additional permissions like read_third_party_fulfillment_orders.

 

Let me know how you go.

Scott | Developer Advocate @ Shopify 

vptcalalog_Admi
New Member
8 0 0

Hi @SBD_ ,

 

Please check for following store details,

 

URL:https://miari.myshopify.com/admin/api/2020-01/orders/1989418844221/fulfillment_orders.json

App ID: 14948992a2f1d208397ed7ba3699f278

Order ID: 1989418844221

vptcalalog_Admi
New Member
8 0 0

@SBD_ 

 

Are you able to check it? It is kind of an urgent issue. Please reply soon.

SBD_
Shopify Staff
1831 273 423

Hey @vptcalalog_Admi,

 

1989418844221 doesn't have any fulfillments yet.

Scott | Developer Advocate @ Shopify 

vptcalalog_Admi
New Member
8 0 0

Hi @SBD_,

 

The order 1988616781885 is from the same store and its items were partially shipped. Yet I am still getting an empty response for the API call "https://miari.myshopify.com/admin/api/2020-01/orders/1988616781885/fulfillment_orders.json". I need to find the order's fulfillment location before the order is shipped. So, if I can't get fulfillment details immediately then how am I supposed to find it.

 

Please reply soon. Thank you.

SBD_
Shopify Staff
1831 273 423

Hey @vptcalalog_Admi 

 

You'll need read_merchant_managed_fulfillment_orders scope, otherwise an empty array is returned.

Scott | Developer Advocate @ Shopify 

akky
Shopify Partner
26 2 2

EXCELLENT!!!