x

API Automatically Email Receipt After Online Purchase

Hello,

 

I have an Square form embedded on my website. Currently the transactions are processing correctly, but I am looking to generate a square receipt that is automatically sent to the customer after purchase. I am using PHP to perform the transaction and my transaction request looks like this:

 

$transaction_api = new \SquareConnect\Api\TransactionApi();
$request_body = array (
"card_nonce" => $nonce,

"buyer_email_address" => "$email",
'note' => "$name, Tickets: $tickets, ID $id",
"amount_money" => array (
"amount" => $amount,
"currency" => "USD",
),
"idempotency_key" => uniqid()
);

 

Is there an action I can add that would be able to automatically email a receipt to the customer after purchase? Thanks in advance for your help.

Tags (1)
3,896 Views
Message 1 of 10
Report
9 REPLIES 9
Admin

Hi @mbeargie, welcome to the seller community!

 

Thanks for bringing this up. I don't have specifics on this right now, but I'll dig deeper and circle back with anything that can be done as soon as possible. Thanks for your patience in the meantime.

 

FYI — in the future feel free to check out Square Connect's Stack Overflow page. It's been a great resource for our developer community, and there's already a ton of questions that have been answered there. 🙂

️ Tom | he/him
Seller Community Manager | Square, Inc.
Find step-by-step help in our Support Center
3,893 Views
Message 2 of 10
Report
Square

@mbeargie - Thanks for your patience while we got more details from our Developer Team. It looks like we are still working on adding receipts functionality to our API. While there isn’t an automated way to sent receipts after a purchase, you could manually send them through the Square Dashboard. I'll be sure to update this thread if/when this changes in the future! 


Sean
he/him/his
Product Manager | Square, Inc.
3,883 Views
Message 3 of 10
Report

Has there been any movement on this?

It would be very useful to be able to provide a receipt to a customer using the buyer_email_address field.

3,284 Views
Message 4 of 10
Report

Really? Nothing Square? How is it possible that sending an automatic receipt after a purchase is made through the API is not possible considering you can setup receipts in the in the account administration. Is there no option for this?

3,177 Views
Message 5 of 10
Report
Square Community Moderator

Sorry for the frustration around this @RestorInternati

 

There's nothing new to report on this as of right now, but if anything changes I'll post an update for everyone. 

3,171 Views
Message 6 of 10
Report

Has this been prioritized yet?  It's not a scalable solution to use the dashboard to issue a receipt for every purchase.  It's also a poor user experience for our customers to not receive a receipt as soon as the transaction is executed.  Is this a compliance issue where the user has to opt in to text recipts? We collect all the information required when creating the customer so I'm having trouble understanding what's preventing this.

2,889 Views
Message 7 of 10
Report

I figured out a workaround for this if anyone else is blocked by this.  The receipts are hosted at https://squareup.com/receipt/preview/{{tenderId}}.  To get the tenderId, after the charge request you'll receive a transaction response containing a transaction object with a tenders array.  Using the first tenders element you'll find the tender id.  Use the tender id to create the receipt link.  Then pass the link through a shortener like IsGood to conserve some characters. To send the SMS we're using Trumpia (API is unruly and inconsistent, but they do answer your phone calls and will set you up with a short code the same day).  Seems to work just fine as long as the receipt preview path doesn't change, which I wouldn't suspect it would.  Hope this can help some of you. 

2,882 Views
Message 8 of 10
Report

Has anything been done by the developers to allow sending automatic receipts from the api on my website?

899 Views
Message 9 of 10
Report
Square Community Moderator

Hello there @mgetman

 

I recommend reaching out to our Developer Forums so our API team is able to point you in the right direction here.

JJ
Community Moderator, Square
Sign in and click Mark as Best Answer if my reply answers your question.
852 Views
Message 10 of 10
Report