# Using createOrder and createPayment - how to ensure email is sent?

**URL:** <https://developer.squareup.com/forums/t/using-createorder-and-createpayment-how-to-ensure-email-is-sent/16929>\
**Category:** Questions\
**Created:** [May 28, 2024, 6:41am UTC](https://developer.squareup.com/forums/t/using-createorder-and-createpayment-how-to-ensure-email-is-sent/16929 "2024-05-28T06:41:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sharan](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@Sharan](https://developer.squareup.com/forums/u/Sharan)\
**Post date:** [May 28, 2024, 6:41am UTC](https://developer.squareup.com/forums/t/using-createorder-and-createpayment-how-to-ensure-email-is-sent/16929/1 "2024-05-28T06:41:26Z")

</div>

I have a Next.js app where I was previously using the Checkout API to create payment links. I believe on production an receipt email is sent to the buyer when the payment is complete. Now I am trying to switch it to an integrated checkout using the react-square-web-payments-sdk library. First I create a customer, then an order with createOrder() and then pass the orderId to createPayment(). These steps are all working correctly. I want to know, is an email sent in this case, or is there some way I can enable that through the settings?

If this is something I have to handle from my end, then is there an endpoint I can use to get receipt details?

---

<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:** [May 28, 2024, 6:41am UTC](https://developer.squareup.com/forums/t/using-createorder-and-createpayment-how-to-ensure-email-is-sent/16929/2 "2024-05-28T06:41:42Z")

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

> **[Online Payment Solutions](https://developer.squareup.com/docs/online-payment-options)**
>
> Learn about the Square APIs and SDKs that support eCommerce (online) payment processing.

> **[Checkout API Overview](https://developer.squareup.com/docs/checkout-api)**
>
> Learn how to use Square-hosted checkout pages for processing payments.

> **Additional Documentation**
>
> [Checkout API Overview](https://developer.squareup.com/docs/checkout-api-overview)  
> [Payment API: Process Online and In-Person Payments](https://developer.squareup.com/docs/payments)  
> [In-App Payments SDK Quickstart](https://developer.squareup.com/docs/in-app-payments-sdk/quick-start)

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:** ![Sharan](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@Sharan](https://developer.squareup.com/forums/u/Sharan)\
**Post date:** [May 28, 2024, 8:02am UTC](https://developer.squareup.com/forums/t/using-createorder-and-createpayment-how-to-ensure-email-is-sent/16929/3 "2024-05-28T08:02:31Z")

</div>

I’ve seen those docs already. Could someone from the team help me out with this? Thanks.

---

<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:** [May 28, 2024, 4:41pm UTC](https://developer.squareup.com/forums/t/using-createorder-and-createpayment-how-to-ensure-email-is-sent/16929/4 "2024-05-28T16:41:37Z")

</div>

When you use the Web Payments SDK in combination with the Orders API and Payments API, Square does not automatically send a receipt email to the customer. This differs from the Checkout API, which does send an automatic receipt.

If you want to send a receipt to the customer, you would need to handle this on your end. You can use the RetrievePayment endpoint to get the details of a completed payment, which includes information like the amount, currency, and status of the payment. You can then use this information to generate a receipt to send to the customer through your own email service.

There isn’t a specific endpoint to get receipt details because the receipt is typically generated based on the information from the completed payment.

_This answer was reviewed by @Bryan-Square._
