Split Payment removes customer_id from an Order

Hi,

I’m working on an integration with the Square API / Webhooks. While testing, I’m trying to extract the customer_id from an order.

The orders are being placed on an iPad POS.

If the order is placed and a customer is added via the POS by tapping on “Add Customer” and the payment is made by a single tender - then everything works fine.

  • order.created webhook is fired
  • payment.created webhook is fired
  • order via the API has a customer_id

However, if the order is placed and a customer is added via the POS by tapping on “Add Customer” and the payment is made using “Split” payments, here’s what I observe:

  • order.created is NOT fired at all (I can work around this)
  • payment.created is fired for both payments
  • order via the API is not available until the last payment is made (fair enough)
    - order via the API does NOT have a customer_id (this is my main concern)
    • however, I do notice that the receipt for the order in the Square dashboard is attached to a customer
  • some of the tenders do have a customer_id, but not all

So even though the customer was added the exact same way, the customer_id is not available in the second case and I can’t rely on the tenders since it only shows up for some.

Is this intended behaviour? How can I get the customer_id for an order that’s paid via split payments.

:wave: 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:

Additional Documentation

Invoices API
Orders API
Customers API Workflows

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.

Yes, this is the intended behavior. When an order is paid using split payments, the customer_id is not directly associated with the order. Instead, each individual payment (or “tender”) within the split payment can be associated with a customer_id. This is because each split payment could potentially be made by a different customer.

However, if all split payments are made by the same customer (as seems to be the case in your scenario), you can retrieve the customer_id from the tenders associated with the order. If a customer_id is not present for a particular tender, it means that the payment was not associated with a customer.

In your case, since you mentioned that some tenders do have a customer_id, you can use those to identify the customer associated with the order. If you find that the customer_id is not consistently appearing in all tenders, it might be due to the way the payments are being processed in the Point of Sale application.

This answer was reviewed by @Bryan-Square.