# Send an email upon successful payment to the buyer email

**URL:** <https://developer.squareup.com/forums/t/send-an-email-upon-successful-payment-to-the-buyer-email/22759>\
**Category:** Questions\
**Tags:** payments-api\
**Created:** [June 13, 2025, 7:55am UTC](https://developer.squareup.com/forums/t/send-an-email-upon-successful-payment-to-the-buyer-email/22759 "2025-06-13T07:55:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prabhu](https://avatars.discourse-cdn.com/v4/letter/p/db5fbb/32.png) [@Prabhu](https://developer.squareup.com/forums/u/Prabhu)\
**Post date:** [June 13, 2025, 7:55am UTC](https://developer.squareup.com/forums/t/send-an-email-upon-successful-payment-to-the-buyer-email/22759/1 "2025-06-13T07:55:12Z")

</div>

Requirement:  
Send an email upon successful payment to the buyer email.

We are using the Payment API of the Java SDK to make credit card payments. We are not creating any Order/Customer/Invoice. Instead, we are directly using the Payment API to make the payment. Code details as below -

Scenario -  
The frontend provides a token based on the card input and this token is used as source id for payment.

Backend Java code snippet for reference -

```
CreatePaymentRequest paymentRequest = CreatePaymentRequest.builder()
	.sourceId(request.getPaymentToken())
	.idempotencyKey(UUID.randomUUID().toString())
	.amountMoney(money)
	.autocomplete(true)
	.locationId(locationId)
	.buyerEmailAddress(<<valid email id>>)
	.build();

CreatePaymentResponse paymentResponse = squareClient.payments().create(paymentRequest);
Payment payment = paymentResponse.getPayment().get();

```

Based on the above code, the payment is successful but, no email is received in the buyerEmailAddress.

Does Square support sending email automatically on successful payments. We are currently using the Sandbox environment for testing purposes.

Is there any other possibility using Square to send emails automatically.

---

<div class="post-metadata">

**Author:** ![Square-Dev-AI](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/square-dev-ai/32/2513_2.png) [@Square-Dev-AI](https://developer.squareup.com/forums/u/Square-Dev-AI)\
**Post date:** [June 13, 2025, 7:55am UTC](https://developer.squareup.com/forums/t/send-an-email-upon-successful-payment-to-the-buyer-email/22759/2 "2025-06-13T07:55:39Z")

</div>

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

> **[Card Payments](https://developer.squareup.com/docs/payments-api/take-payments/card-payments)**
>
> Learn how to provide cards (credit, debit, and square gift card) as a payment source in a Payments API CreatePayment request.

> **[Create and Publish Invoices](https://developer.squareup.com/docs/invoices-api/walkthrough)**
>
> Learn how to use the Invoices API to send an invoice to a customer and to automatically charge a card on file.

> **Additional Documentation**
>
> [Take Payments](https://developer.squareup.com/docs/payments-api/overview)  
> [Take Payments](https://developer.squareup.com/docs/payments-api/take-payments)  
> [Download, Configure, and Run the Client Sample](https://developer.squareup.com/docs/in-app-payments-sdk/quick-start/generate-token)

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.

---

<div class="post-metadata">

**Author:** ![Square-Dev-AI](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/square-dev-ai/32/2513_2.png) [@Square-Dev-AI](https://developer.squareup.com/forums/u/Square-Dev-AI)\
**Post date:** [June 13, 2025, 4:22pm UTC](https://developer.squareup.com/forums/t/send-an-email-upon-successful-payment-to-the-buyer-email/22759/3 "2025-06-13T16:22:04Z")

</div>

Square’s Payments API does not automatically send emails to buyers upon successful payment. The `buyerEmailAddress` field in the `CreatePaymentRequest` is used for record-keeping purposes and does not trigger any email notifications.

To send an email upon successful payment, you would need to implement this functionality in your application. You can achieve this by setting up a notification system in your backend that listens for successful payment events and sends an email to the buyer using an email service provider like SendGrid, Mailgun, or similar.

Additionally, you can use Square’s webhooks to listen for payment events. By subscribing to the `payment.updated` webhook, your application can be notified when a payment status changes to `COMPLETED`, and you can then trigger an email to be sent to the buyer. This approach ensures that emails are sent only after the payment is confirmed as successful.

_This answer was reviewed by @Bryan-Square._
