Find records created with a card swipe?

Totally by chance, while exploring on the API, I discovered a CUSTOMER with a “[creation_source] => INSTANT_PROFILE”.
I had not noticed this before.
The record did not show the event that created this customer record.
I took the “created_at” timestamp from this CUSTOMER record.
I then created a ‘begin’ and ‘end’ timestamp 1 minute earlier and one minute later.
Exploring records with these ‘begin’ and ‘end’ timestamps I could find

  1. The card swipe payment that apparently caused the ‘Instant_Profile’ creation
  2. An order that was apparently paid with the card swipe.

These were ‘lucky’ searches – as there didn’t happen to be any other records created inside my 3 minute search parameters. There might have been, but I as lucky this time.

What I hoped to find was some sort identifier that told me that an instant profile had been created by a payment or order.

I also hoped I wouild find some identifiers relating the customer, payment, and order. (If this exists, I haven’t found it by looking at the returned records, but I’m famous for missing the obvious.)

Wait, there’s more.

I’ve got webhooks listening for payment.created, order.created, and customer.created.

: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

Customers API Workflows
Integrate Customer Profiles with Other Services
Customers API

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.

I submitted this question while it was still in draft form and incomplete.

I can’t delete it, but apparently and admin can.

Please delete.

Instant profiles are customer profiles that are automatically created in a seller’s Customer Directory following a payment. If a customer isn’t assigned to a payment, Square attempts to infer the associated customer. If Square cannot find a matching customer profile and cannot create an instant profile, the customer_id field of the payment remains unset.

Customer objects that represent instant profiles have the creation_source field set to INSTANT_PROFILE. While instant profiles can be merged with other customer profiles in the Seller Dashboard, merging doesn’t retroactively link completed transactions to the newly created profile (that is, the customer_id field remains unchanged). To track merged customer profiles, you can subscribe to the customer.created webhook event.

In terms of linking the customer, payment, and order, you can use the customer_id field. This field is present in both the Payment and Order objects and represents the ID of the customer associated with that payment or order.

For webhook events, when a new customer profile is created, a customer.created event is triggered. Similarly, when a payment is completed, a payment.updated event is triggered. You can use these webhook events to track when new customer profiles are created and when payments are updated.

This answer was reviewed by @Bryan-Square.