Is there a way how to retrieve the fulfillment priority of the locations?
The location resource GET /admin/locations.json is not sorted by the fulfillment priority from shopify admin and there is no attribute like priority on the location.
@Jiri_Hacmac at this time the answer to that one is no, but it's something that's frequently asked for. Odds are we'll be implementing a solution to this kind of problem, I just can't speak to when or what it will look like when that times comes.
My app Location Based Fulfillment https://apps.shopify.com/location-based-fulfillment might be able to help. It allows you to create rules to route and fulfill orders based on the shipping address of the order.
Check it out and let me know if you have any questions
Great question, I'd like to add my vote on this too.
Currently I don't see a way to be able to determine the location of a line item via API if the product has stock in multiple locations.
For my scenario, that's a workaround because the Order object doesn't give location data in the line items.... Would be really awesome if you could add an attribute on the Order object that gives the location id.