I am looking for a way to differentiate between a payment made for an invoice sent to the customer and the payment made live through the payment terminals at POS.
Is there any field in the payment response that can be reliably used to distinguish these two types of payments?
I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:
If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.
To differentiate between a payment made for an invoice and a payment made through a payment terminal at the Point of Sale (POS), you can use the source_type field in the Payment object.
For payments made through a payment terminal, the source_type will typically be CARD, indicating that the payment was processed using a card reader or terminal. Additionally, the terminal_checkout_id field in the Payment object can be used to associate the payment with a specific Terminal checkout.
For payments made for an invoice, the source_type will also be CARD, but these payments are associated with an invoice. You can check the invoice_id field in the Payment object to determine if the payment was made for an invoice. If this field is populated, it indicates that the payment was made in response to an invoice.
By examining these fields, you can reliably distinguish between payments made for invoices and those made through POS terminals.