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

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?

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

Checkout API Overview
Payment API: Process Online and In-Person Payments
In-App Payments SDK Quickstart

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.

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

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.