To determine if an order was made through the Square Point of Sale (POS) application, you can look at the Order.source field. However, as you’ve noted, this field might not always be set. In such cases, you can use the Payment.application_details.square_product field associated with the order’s payment. If this field is set to SQUARE_POS, it indicates that the order was created through the Square POS application.
Additionally, you can check the Order.fulfillments field. Orders created through Square POS might have fulfillment details that are specific to in-person transactions, such as pickup or delivery options that are typically associated with POS orders.
If these fields are not sufficient, you might need to rely on other contextual information or business logic specific to your application to infer the source of the order.
This answer was reviewed by @Bryan-Square.