I know that it is possible for shop owners to configure shipping and delivery settings to give their customers the option to select local pickup. However, I can't find any documentation regarding how an order object received through the api or webhook would be marked as a "local pickup". To test, I placed an order on a development shop, with local pickup selected as the shipping method, and then inspected the orders/created payload sent to me by shopify. But I don't see any flag or shipping data that would indicate that the order was marked for local pickup by the customer. Am I missing something? How can we determine that an order is meant for local pickup?
FWIW, after further inspection, it looks like a local pickup order has a couple of defining features:
1. No shipping_address object
2. The shipping_lines title and code attributes are set to the name of the location where local pickup was configured by the shop
While this is workable, its a bit problematic. For one, it seems like there are other scenarios that can result in no shipping address object being included on the order. Also, while highly unlikely, it is technically possible that the name of a location is set to the same thing as the name or code of a shipping method, thus creating a conflict as there's nothing inherently unique about the name of a location. For the programmer, there's also not a way to lookup a location to get its address based on the name, meaning we have to get all locations, then filter the return values based on the name. Not hard, but feels like a hack. Then, as if to throw salt in the wound, Shopify includes an object called origin_location that presumably references the location where the order was placed (though maybe this doesn't necessarily correspond with the local pickup location?), except that the ID attribute on origin_location is NOT an actual location ID, and there is no other location_id attribute on the object either.
All in all, it would be much more helpful if the order actually had a "local_pickup" flag or "local_pickup_location_id" value or something to explicitly mark the order as being set for local pickup. Of course, all of this is based on my own assumptions from a couple of test orders, so if anyone has additional light to shed on the matter, please chime in!
Unfortunately, there's been no reply from Shopify and I haven't found any additional information on managing local pickup orders. It seems like local pickup was a hacked in feature that has never fully been implemented throughout Shopify. For example, while a customer can select local pickup as an option during checkout, the Shopify admin doesn't have the option to select local pickup when creating a draft/manual order. Hopefully this feature gets some attention in the future.