Stripe abandoned cart: How to recover via email

Should I recover…or should I go?

Losing a customer at the very last minute sucks. A lot.

A couple of weeks ago I got to test a cool feature by Stripe: It’s a new way for businesses (only for customers in the U.S.) to recover cart information. And it looks like this…

Nothing weird right? Exactly - that’s why it’s great!

The trick up the sleeve is in having the small checkbox created under the email input field, on the right side of the screenshot above.

It reads “Keep me updated with news and personalized offer” and it is checked by default.

Okay cool story bro so far, how’s that useful you might ask?

What is Stripe Recovery email?

When you’ve opted into this feature, as a developer, you’re able to retrieve through webhooks the email address of the customer….EVEN if they haven’t entered a valid credit card or payment method whatsoever, EVEN if they haven’t submitted the form and they purchased nada.

Raise your hand anyone who has NEVER panicked out of a checkout form.

Happens to me a lot. Usually I complete the first part of a checkout form and at the last moment (whether it’s because my wallet is too far away and I don’t have my card saved…or my subconscious kicks in for another YET useless purchase) you’ll end up closing the tab. Arrivederci, au-revoir!

How can I use Stripe Recovery email feature and why it matters?

Let’s focus on Purchase intent, not in the Stripe way but in the ecommerce sense.

It’s really a big factor in one customer’s purchasing journey. If someone takes time not only to select an item to purchase, but to also to get to the checkout page and starts entering information, that’s a BIG sign .

Consequentially, it’s a HUGE flag when the user has started the check-out flow but hasn’t finished it.

How can you use this feature? By adding a few lines to your code. Just a few lines in the checkout code.

1
2
3
4
5
6
7
8
9
...
consent_collection={
'promotions': 'auto',
},
after_expiration={
'recovery': {
'enabled': 'true'
}
...

By the way you can also customize the expiration for the cart, for example “if the purchase hasn’t been completed within the hour consider the cart as abandoned.”
You do that by setting expires_at as a UNIXTIMESTAMP.

What this does is enabling promos at checkout (super useful later on) and the ability to get the info.

When the cart expires Stripe will send you a webhook called checkout.session.expired with the relevant information about who attempted to purchase something but hasn’t completed the checkout flow.

This webhook can also contain a recovery URL:

1
2
3
4
5
6
7
8
9
10
{
"after_expiration":{
"recovery":{
...
"enabled":true,
...
"url":"https://buy.stripe.com/r/test_Y....0yGmBiqmU"
}
}
}

Stripe even gives you a URL to use to that exact cart that was abandoned to give you a chance to communicate with your potential customer that they can simply finish their purchase.

You can then gather stats on whether your recovery efforts are working…or not!

Final thoughts

Here I gathered a couple of parting thoughts on this feature.

Q. Should I give discount codes when recovering abandoned checkouts?
A. Most likely yes, when someone receives an email to inform them that their cart is just around the corner a little nudge in the form of a promotional discount can really push the envelop through the door!

Q. If someone opts out of my attempted recovery email what should I do?
A. You need to let Stripe know, there’s an API call you can do on the Customer object with the payload consent_settings={'promotions': 'opt_out'}!

Q. What happens if the same person keeps abandoning the cart over and over?
A. Catch it! Since Stripe doesn’t send emails on your behalf - YOUT have to think of a good strategy to send emails to such person. How many? How much is too much? Should you send more and more promotional codes?
Whichever is the reason why, it’s up to you as a developer to decide when to limit communication via email and escalate it, maybe send customer service their way!?

Q. This is silly why shouldn’t I grab my customer’s email address earlier on during the purchase flow?
A. That is a very good question, some folks ask for email address even before you’ve reviewed your “basket” or purchase. I think it’s up to you to understand where it makes most sense to grab your web visitors’ details and how to use them. I think this feature is aimed mostly at those high-signalling purchasers - who spend time on the site, but then give up at the very last step.