Shopify API Get Orders doesn't split order into multiple locations

Highlighted
New Member
2 0 0

Let's assume SKU A is stocked only at Location A, and SKU B is stocked only at Location B. If we place an order containing both SKUs, the front-end correctly shows the two line items being assigned to two different locations:

Screenshot from 2020-06-04 17-49-03.png 

 

The GET /orders.json API call, however, shows the following JSON:

{
"id": 2410327146567,
"location_id": 36622991431, // entire order is assigned to a single location, instead of 2
...
"line_items": [
{
"id": 5333097054279,
"variant_id": 31625148956743,
"title": "Blue jeans #1",
"quantity": 1,
"sku": "blue-jeans-1",
"variant_title": "12",
"fulfillment_service": "manual",
"product_id": 4425556754503,
"requires_shipping": true,
"name": "Blue jeans #1 - 12",
"variant_inventory_management": "shopify",
"product_exists": true,
"fulfillable_quantity": 1,
"fulfillment_status": null,
...
},
{
"id": 5333097087047,
"variant_id": 31603128008775,
"title": "Blue jeans #2",
"quantity": 1,
"sku": "blue-jeans-2",
"fulfillment_service": "manual",
"requires_shipping": true,
"name": "Blue jeans #2",
"variant_inventory_management": "shopify",
"fulfillable_quantity": 1,
"grams": 0,
"price": "0.00",
"total_discount": "0.00",
"fulfillment_status": null,
...
}
],
"fulfillments": [],
...
}

I'm trying to pick up orders only assigned to a single location. This example order is split between two locations, but shows up as being assigned to only 1 location(the default location) in the back-end. Is this a bug? When can we expect a resolution?

0 Likes
Shopify Staff
Shopify Staff
619 76 139

Hey @umairnadeem,

 

The location_id field on the order object corresponds to the location where the order was processed, not where it's to be fulfilled from. Orders processed on the online store usually have a null value in this field, otherwise this field will correspond to the POS location_id if processed on POS, or the store's shipping origin location_id if it was processed as a draft order.

 

If you'd like to see the assigned fulfillment location_id for each item, you can use the fulfillmentOrders endpoint. A "fulfillmentOrder" represents a group of items which can all be fulfilled from the same location. For the example in your screenshot, that order should return 2 separate fulfillmentOrders (1 for each location).

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

0 Likes
Highlighted
New Member
2 0 0

Hi JB,

 

Thank you for the helpful response - that's very useful information! Using the endpoint you provided, however, I am only able to see locations that my app manages, and not physical locations. Is there a way to see the physical locations an order is assigned to (as we see in the UI) ?

0 Likes