Location id = null

pankaj180
New Member
3 0 0

Hi,

We are integrating Orders from Shopify to ERP systems. In our store, three locations are enabled.
In the below screenshot, at the top right corner(highlighted with yellow color), for this order, the quantity of Item is committed from “NewYork” location. But when we retrieve the Order from the Shopify rest API, we get location id = null.

Order.jpg

Without location id in order, we can not correctly import this order in the ERP system. Can you please let us know how can we find the location id in order.

 

Thanks,
Pankaj Sharma

0 Likes
Josh
Shopify Staff
Shopify Staff
1130 82 191

Hello @pankaj180 ,

 

The location_id field on an order is only populated if an order is created using our Point of Sale app, and is used to note which Point of Sale location an order was placed at. This field actually pre-dates our multi-location feature though, and isn't related to it so shouldn't be used for that purpose. 

 

In order to find out the locations that items in an order are stocked at, you can follow the steps outlined here in the 'Create a fulfillment' section. Though you aren't creating fulfillments here, the same steps would apply. Specifically, step 3 is where the location attached to an order's line item would be surfaced. 

 

 

0 Likes
JoeyPienipuu
New Member
3 0 0

Hello,

 

This seems to be the same problem we are having. We manage ourselves one location, and have one company for fulfillment on a second location. But our fulfilment company — who runs an app in Shopify — does not get the data from the orders. The app/company is FulfilmentCrowd.

They are receiving ALL orders, despite coming from different locations/regions. 

Everything is properly configured as we see in each order, but somehow they don't get the following data: 

"location_id": null,

    "source_identifier": null,

    "source_url": null,

    "processed_at": "2020-04-29T17:27:01+01:00",

    "device_id": null,

 

We have just installed the plugin Location-Based Fulfilment. Do you have any idea if this could work for us?

Thanks a lot!

Joey

0 Likes
_JB
Shopify Staff
Shopify Staff
750 86 163

Hey @JoeyPienipuu,

 

If you're using an app to manage fulfillments at a particular location, the app might be registering a FulfillmentService on your store. If this is the case, you need to specify which products the fulfillmentService is responsible for shipping. If you haven't already, I recommend taking a look at the doc I linked above, and if you're still have trouble reach out to the support e-mail for that app to make sure it's configured correctly.

 

From the JSON you included in your post, it looks like you're referencing the order.location_id field, which is only populated when an order is processed through the POS. It's expected that this field is null for online orders.

 

If the app isn't using a fulfillment service or you still think something isn't working correctly after reaching out to their support, please post back here with an order_id example and explanation of how you expected each line_item to show up for the app, and I can take another look.

JB | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

JoeyPienipuu
New Member
3 0 0
{"order":{"id":XXXXXXXX,"email":"XXXX@XXXX.XXX","closed_at":"2020-05-12T22:36:47+03:00","created_at":"2020-05-11T19:15:17+03:00","updated_at":"2020-05-12T22:36:47+03:00","number":174,"note":null,"token":"XXXXXXXXXX","gateway":"paypal","test":false,"total_price":"28.20","subtotal_price":"23.70","total_weight":1440,"total_tax":"4.50","taxes_included":true,"currency":"EUR","financial_status":"paid","confirmed":true,"total_discounts":"0.00","total_line_items_price":"23.70","cart_token":"","buyer_accepts_marketing":false,"name":"#1174","referring_site":null,"landing_site":"\/api\/2020-01\/graphql","cancelled_at":null,"cancel_reason":null,"total_price_usd":"30.57","checkout_token":"XXXXXXXXXXXXX","reference":null,"user_id":null,"location_id":null,"source_identifier":null,"source_url":null,"processed_at":"2020-05-11T19:15:17+03:00","device_id":null,"phone":null,"customer_locale":"CH","app_id":XXXXX,"browser_ip":"XXXXXXX","landing_site_ref":null,"order_number":1174,"discount_applications":[],"discount_codes":[],"note_attributes":[],"payment_gateway_names":["shopify_payments","paypal"],"processing_method":"express","checkout_id":XXXXXXXXXXX,"source_name":"web","fulfillment_status":"fulfilled","tax_lines":[{"price":"4.50","rate":0.19,"title":"XXXX","price_set":{"shop_money":{"amount":"4.50","currency_code":"EUR"},"presentment_money":{"amount":"4.50","currency_code":"EUR"}}}],"tags":"","contact_email":"XXXX@XXXX.XXX","order_status_url":"https:\/\/xxxxxx.myshopify.com\/XXXXXXXX\/orders\/XXXXXX\/authenticate?key=XXXXXX","presentment_currency":"EUR","total_line_items_price_set":{"shop_money":{"amount":"23.70","currency_code":"EUR"},"presentment_money":{"amount":"23.70","currency_code":"EUR"}},"total_discounts_set":{"shop_money":{"amount":"0.00","currency_code":"EUR"},"presentment_money":{"amount":"0.00","currency_code":"EUR"}},"total_shipping_price_set":{"shop_money":{"amount":"4.50","currency_code":"EUR"},"presentment_money":{"amount":"4.50","currency_code":"EUR"}},"subtotal_price_set":{"shop_money":{"amount":"23.70","currency_code":"EUR"},"presentment_money":{"amount":"23.70","currency_code":"EUR"}},"total_price_set":{"shop_money":{"amount":"28.20","currency_code":"EUR"},"presentment_money":{"amount":"28.20","currency_code":"EUR"}},"total_tax_set":{"shop_money":{"amount":"4.50","currency_code":"EUR"},"presentment_money":{"amount":"4.50","currency_code":"EUR"}},"line_items":[{"id":XXXXXXXX,"variant_id":XXXXXXXX,"title":"xxxproduct","quantity":2,"sku":"PRODUCTCODE","variant_title":"","vendor":"Company Name","fulfillment_service":"manual","product_id":XXXXXXXX,"requires_shipping":true,"taxable":true,"gift_card":false,"name":"xxxproduct","variant_inventory_management":"shopify","properties":[],"product_exists":true,"fulfillable_quantity":0,"grams":370,"price":"6.90","total_discount":"0.00","fulfillment_status":"fulfilled","price_set":{"shop_money":{"amount":"6.90","currency_code":"EUR"},"presentment_money":{"amount":"6.90","currency_code":"EUR"}},"total_discount_set":{"shop_money":{"amount":"0.00","currency_code":"EUR"},"presentment_money":{"amount":"0.00","currency_code":"EUR"}},"discount_allocations":[],"tax_lines":[{"title":"MwSt","price":"2.20","rate":0.19,"price_set":{"shop_money":{"amount":"2.20","currency_code":"EUR"},"presentment_money":{"amount":"2.20","currency_code":"EUR"}}}],"origin_location":{"id":XXXXXX,"country_code":"FI","province_code":"","name":"Company Name","address1":"6 Paper Street","address2":"","city":"Company Name","zip":"61500"}},{"id":XXXXXX,"variant_id":XXXXX,"title":"Company Name World’s Best G\u0026T pack","quantity":1,"sku":"PRODUCTSKU","variant_title":"","vendor":"Company Name","fulfillment_service":"manual","product_id":XXXXXXXX,"requires_shipping":true,"taxable":true,"gift_card":false,"name":"Company Name World’s Best G\u0026T pack","variant_inventory_management":"shopify","properties":[],"product_exists":true,"fulfillable_quantity":0,"grams":700,"price":"9.90","total_discount":"0.00","fulfillment_status":"fulfilled","price_set":{"shop_money":{"amount":"9.90","currency_code":"EUR"},"presentment_money":{"amount":"9.90","currency_code":"EUR"}},"total_discount_set":{"shop_money":{"amount":"0.00","currency_code":"EUR"},"presentment_money":{"amount":"0.00","currency_code":"EUR"}},"discount_allocations":[],"tax_lines":[{"title":"MwSt","price":"1.58","rate":0.19,"price_set":{"shop_money":{"amount":"1.58","currency_code":"EUR"},"presentment_money":{"amount":"1.58","currency_code":"EUR"}}}],"origin_location":{"id":XXXXXXXX,"country_code":"FI","province_code":"","name":"Company Name","address1":"6 Xxxxxx","address2":"","city":"IsoCompany Name","zip":"Xxxxx"}}],"fulfillments":[{"id":XXXXX,"order_id":XXXXXX,"status":"success","created_at":"2020-05-12T22:36:47+03:00","service":"manual","updated_at":"2020-05-12T22:36:47+03:00","tracking_company":"General Logistics Systems","shipment_status":null,"location_id":XXXXX,"line_items":[{"id":XXXXXX,"variant_id":XXXXX,"title":"xxxproduct","quantity":2,"sku":"PRODUCTCODE","variant_title":"","vendor":"Company Name","fulfillment_service":"manual","product_id":XXXXX,"requires_shipping":true,"taxable":true,"gift_card":false,"name":"xxxproduct","variant_inventory_management":"shopify","properties":[],"product_exists":true,"fulfillable_quantity":0,"grams":370,"price":"6.90","total_discount":"0.00","fulfillment_status":"fulfilled","price_set":{"shop_money":{"amount":"6.90","currency_code":"EUR"},"presentment_money":{"amount":"6.90","currency_code":"EUR"}},"total_discount_set":{"shop_money":{"amount":"0.00","currency_code":"EUR"},"presentment_money":{"amount":"0.00","currency_code":"EUR"}},"discount_allocations":[],"tax_lines":[{"title":"MwSt","price":"2.20","rate":0.19,"price_set":{"shop_money":{"amount":"2.20","currency_code":"EUR"},"presentment_money":{"amount":"2.20","currency_code":"EUR"}}}],"origin_location":{"id":XXXXXXXX,"country_code":"FI","province_code":"","name":"Company Name","address1":"6 Paper Street","address2":"","city":"Company Name","zip":"XXXXXXXX"}},{"id":XXXXXXXX,"variant_id":XXXXXXXX,"title":"Company Name Product\u0026T pack","quantity":1,"sku":"PRODUCTSKU","variant_title":"","vendor":"Company Name","fulfillment_service":"manual","product_id":XXXXXXXX,"requires_shipping":true,"taxable":true,"gift_card":false,"name":"Company Name Best Product\u0026T pack","variant_inventory_management":"shopify","properties":[],"product_exists":true,"fulfillable_quantity":0,"grams":700,"price":"9.90","total_discount":"0.00","fulfillment_status":"fulfilled","price_set":{"shop_money":{"amount":"9.90","currency_code":"EUR"},"presentment_money":{"amount":"9.90","currency_code":"EUR"}},"total_discount_set":{"shop_money":{"amount":"0.00","currency_code":"EUR"},"presentment_money":{"amount":"0.00","currency_code":"EUR"}},"discount_allocations":[],"tax_lines":[{"title":"MwSt","price":"1.58","rate":0.19,"price_set":{"shop_money":{"amount":"1.58","currency_code":"EUR"},"presentment_money":{"amount":"1.58","currency_code":"EUR"}}}],"origin_location":{"id":XXXXXXXX,"country_code":"FI","province_code":"","name":"Company Name","address1":"6 Paper Street","address2":"","city":"Company Name","zip":"61500"}}],"tracking_number":"XXXXXXX","tracking_numbers":["XXXXXX","XXXXXX"],"tracking_url":"https:\/\/xxxx.eu\/EU\/en\/parcel-tracking?match=XXXXXX","tracking_urls":["https:\/\/gls-group.eu\/EU\/en\/parcel-tracking?match=XXXXX","https:\/\/gls-group.eu\/EU\/en\/parcel-tracking?match=XXXXXX"],"receipt":{},"name":"#1174.1"}],"refunds":[],"total_tip_received":"0.0","shipping_lines":[{"id":XXXXXXXXX,"title":"GLS","price":"4.50","code":"GLS","source":"shopify","phone":null,"requested_fulfillment_service_id":null,"delivery_category":null,"carrier_identifier":null,"discounted_price":"4.50","price_set":{"shop_money":{"amount":"4.50","currency_code":"EUR"},"presentment_money":{"amount":"4.50","currency_code":"EUR"}},"discounted_price_set":{"shop_money":{"amount":"4.50","currency_code":"EUR"},"presentment_money":{"amount":"4.50","currency_code":"EUR"}},"discount_allocations":[],"tax_lines":[{"title":"MwSt","price":"0.72","rate":0.19,"price_set":{"shop_money":{"amount":"0.72","currency_code":"EUR"},"presentment_money":{"amount":"0.72","currency_code":"EUR"}}}]}],"billing_address":{"first_name":"John","address1":"Paper Street 83","phone":"XXXXXXXX","city":"Bern","zip":"12059","province":null,"country":"Switzerland","last_name":"Doe","address2":"","company":null,"latitude":XXXXXXXX,"longitude":XXXXXXXX,"name":"John Doe","country_code":"DE","province_code":null},"shipping_address":{"first_name":"John","address1":"Paper Street 83","phone":"XXXXXXXX","city":"Bern","zip":"XXXXXXXX","province":null,"country":"Switzerland","last_name":"Doe","address2":"","company":null,"latitude":XXXXXXXX,"longitude":XXXXXXXX,"name":"John Doe","country_code":"DE","province_code":null},"client_details":{"browser_ip":"XXXXXXXX","accept_language":"de,en-US;q=0.7,en;q=0.3","user_agent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10.14; rv:75.0) Gecko\/XXXXXXXX Firefox\/75.0","session_hash":null,"browser_width":1440,"browser_height":780},"payment_details":{"credit_card_bin":"XXXX","avs_result_code":null,"cvv_result_code":null,"credit_card_number":"XXXXXXXX XXXX","credit_card_company":"Visa"},"customer":{"id":XXXXXX,"email":"XXXX@XXXX.XXX","accepts_marketing":false,"created_at":"2020-05-11T18:17:42+03:00","updated_at":"2020-05-11T19:15:18+03:00","first_name":"John","last_name":"Doe","orders_count":1,"state":"disabled","total_spent":"28.20","last_order_id":XXXXXXXX,"note":null,"verified_email":true,"multipass_identifier":null,"tax_exempt":false,"phone":null,"tags":"","last_order_name":"#1174","currency":"EUR","accepts_marketing_updated_at":"2020-05-11T18:17:42+03:00","marketing_opt_in_level":null,"default_address":{"id":XXXXXX,"customer_id":XXXXXXXX,"first_name":"John","last_name":"Doe","company":null,"address1":"Paper Street 83","address2":"","city":"Bern","province":null,"country":"Switzerland","zip":"00000","phone":"XXXXXXXX","name":"John Doe","province_code":null,"country_code":"DE","country_name":"Switzerland","default":true}}}}

Hi JB,

 

Thanks for the clarification. This certainly helps.

 

We have a few follow up questions until we talk to our fulfilment partner.

 

  • We are using Shopify Storefront, thus we are not using the Point-of-Sale feature. That seems to be the reason the location_id goes empty. Do you have any best practice to parse that data when using Shopify Storefront?
  • It seems that our orders do not hold the location_ID afterall. I am attaching one anonymized example. Can you help us out on why this is happening? Or how to fix it so that our fulfilment partner is able to read location_id from orders?

Thanks for the reply!

 

Joey

 

0 Likes