Hello!
I have a coffee shop and use Square as the POS.
I am able to access my transactions via the API but I want to also retrieve the Customer Name for each transaction. I have figured out that if a customer profile is selected during the transaction, then it will attribute their Custome ID to that transaction. However, even though a transaction might automatically get attributed to an existing customer due to their card number, it will not attribute their Customer ID to the transaction since their profile wasn’t specifically selected during the sale.
Is there a way to automatically have the Customer ID attributed to the transaction whenever the customer is identified? It seems odd to me that the transaction will automatically list Bob Smith as the customer but it can’t also assign the Customer ID for Bob Smith to the transaction.
If this is not possible, is there any other way that I can access the customer name with each transaction? Maybe a more manual method of scraping the Customer Name from the transaction details?
Curious if others have found a workaround for this. Since I am able to view transactions via the API, I feel like it should be simple to also view the Name on that transaction.
Any help is greatly appreciated!
Steve
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
Customers API
Integrate Customer Profiles with Other Services
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.
Hi Steve,
Square does have a feature called “instant profiles” where customer profiles are automatically created in a seller’s Customer Directory following a payment. Future purchases made with the same card update the profile history with new payment details and other activities for your business.
However, 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.
In some regions, the creation of instant profiles is prevented or sellers can disable this feature. If the customer_id isn’t set for a payment made using a non-payment-card payment method (such as gift card, ACH, or Cash App), Square doesn’t attempt to find or create a customer profile to populate the customer_id field.
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).
So, while Square does attempt to automatically link transactions to customer profiles, there are certain conditions and limitations that may prevent this from happening consistently.
As for a workaround, you could consider using the SearchCustomers endpoint to search for customer profiles by phone number, email address, or other supported attribute, and then manually link the customer to the transaction in your own system. However, this would likely require additional development work on your end.
This answer was reviewed by @Bryan-Square.
Hi Steve,
Square does have a feature called “instant profiles” where customer profiles are automatically created in a seller’s Customer Directory following a payment. Future purchases made with the same card update the profile history with new payment details and other activities for your business.
However, 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.
In some regions, the creation of instant profiles is prevented or sellers can disable this feature. If the customer_id isn’t set for a payment made using a non-payment-card payment method (such as gift card, ACH, or Cash App), Square doesn’t attempt to find or create a customer profile to populate the customer_id field.
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).
So, while Square does attempt to automatically link transactions to customer profiles, there are certain conditions and limitations that may prevent this from happening consistently.
As for a workaround, you could consider using the SearchCustomers endpoint to search for customer profiles by phone number, email address, or other supported attribute, and then manually link the customer to the transaction in your own system. However, this would likely require additional development work on your end.
This answer was reviewed by @Bryan-Square.
@Bryan-Square I’m not able to get anywhere with the suggested workaround. Do you have any other suggestions on how to retrieve the customer name along with transaction via API?
At this time the only way to get the name of a customer is to get the payment from the Payments API and take the customer_id
in the payment. Then you’ll need to call RetrieveCustomer to get the profile details.
Thaks for providing link. it help me o find the solution.