Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access customer information using Square Connect API

Is it possible to access any information about a merchant's customers using the Square Connect API? The most ideal piece of information would be the email address customers enter for their receipt, but but some type of unique customer id would be nice to determine repeat customers.

Looking through the Square Connect API Documents there are no endpoints for customers and Payment objects do not include any of this information. Is there another Square API with this capability?

like image 732
MD3 Avatar asked Dec 19 '22 16:12

MD3


1 Answers

This is now possible as of V2 and the transaction.tenders.customer_id attribute.

In my use case I am attempting to get the customer from a webhook notification. As I see it, there are few steps required for this scenario:

  1. Issue the v1 request for the Payment using the webhook entity_id
    • /v1/{location_id}/payments/{payment_id}
  2. Issue the v2 request for the Transaction using the id returned on the Payment object. The only place the v2 transaction id is located is on the last part of the path in the payment_url attribute.
    • /v2/locations/{location_id}/transactions/{transactionId}
  3. Issue the v2 request for the Customer identified on the Payment tender(s). If there are multiple tenders the customerId should be the same for each.
    • /v2/customers/{transaction.tenders[0].customer_id}

If you have the customer_id in hand oviously you can skip straight to step 3.

like image 103
Nate Good Avatar answered Mar 04 '23 07:03

Nate Good