x

Connect V2, Get Customer from Web Hook

Use case - I have an application that retrieves customer information when payment is made from the default Square POS.

 

I have a webhook set up to monitor payment_updated, when that posts to my webhook endpoints, I can get the Payment object associated with the payment entity (via the transaction id - e.g. /v2/payments/T0ema5lZVyBHUJgpPf8vVuMF) posted in the webhook.

 

From there, I can fetch recent orders from the Orders API (/v2/orders/search), then filter for the Transaction ID to find the associated transaction.

 

Unfortunately, neither of these endpoints returns the associated customer_id.

 

As far as I can tell, the only endpoint that returns customer information is the transactions endpoint (e.g. /v2/locations/RD8H9SY1BSXSQ/transactions?begin_time=UTZ) but this endpoint is marked as deprecated.

 

What is the deprecation strategy for the transactions endpoint? Alternatively, if you deprecate functionality in the transactions API, is there any consideration for adding that functionality back in to the v2 API?

 

It's clear that the functionality is used internally, for instance some combination of the undocumented and unpublished v3 API and in the GetContactsForPayments functionality used in the Square dashboard (https://squareup.com/services/squareup.rolodex.RolodexService/GetContactsForPayments).

 

Thanks!

730 Views
Message 1 of 2
Report
1 REPLY 1
Admin

Hi @truqio! I am no expert on this, but I did check in with one of our API team members.

 

If you get the order with the Orders API, you will have the customer_id if a customer was added to the sale. It is returned to the SearchOrders response.

 

Does this make sense? If not, I can continue to relay your messages to our experts!

Bea_
Beta Community Manager, Square
Join the Beta Community
Evaluate | Influence | Engage
687 Views
Message 2 of 2
Report