Recover abandoned carts
Learn how to recover abandoned Checkout pages and boost revenue.
In e-commerce, cart abandonment is when customers leave the checkout flow before completing their purchase. To help bring customers back to Checkout, create a recovery flow where you follow up with customers over email to complete their purchases.
Cart abandonment emails fall into the broader category of promotional emails, which includes emails that inform customers of new products and that share coupons and discounts. Customers must agree to receive promotional emails before you can contact them. Checkout helps you:
- Collect consent from customers to send them promotional emails.
- Get notified when customers abandon Checkout so you can send cart abandonment emails.
Collect promotional consent
Configure Checkout to collect consent for promotional content. If you collect the customer’s email address and request consent for promotional content before redirecting to Checkout, you can skip using consent_
.
Configure recovery
A Checkout Session becomes abandoned when it reaches its expires_at timestamp and the customer hasn’t completed checking out. When this occurs, the session is no longer accessible and Stripe fires the checkout.
webhook, which you can listen to and try to bring the customer back to a new Checkout Session to complete their purchase. To use this feature, enable after_
when you create the session.
Get notified of abandonment
Listen to the checkout.
webhook to be notified when customers abandon Checkout and sessions expire. When the session expires with recovery enabled, the webhook payload contains after_expiration, which includes a URL denoted by after_
that you can embed in cart abandonment emails. When the customer opens this URL, it creates a new Checkout Session that’s a copy of the original expired session. The customer uses this copied session to complete the purchase on a Stripe-hosted payment page.
Note
For security purposes, the recovery URL for a session is usable for 30 days, denoted by the after_
timestamp.
{ "id": "evt_123456789", "object": "event", "type": "checkout.session.expired", // ...other webhook attributes "data": { "object": { "id": "cs_12356789", "object": "checkout.session", // ...other Checkout Session attributes "consent_collection": { "promotions": "auto", }, "consent": { "promotions": "opt_in" }, "after_expiration": { "recovery": { "enabled": true, "url": "https://buy.stripe.com/r/live_asAb1724", "allow_promotion_code": true, "expires_at": 1622908282, } } } } }
Send recovery emails
To send recovery emails, create a webhook handler for expired sessions and send an email that embeds the session’s recovery URL. A customer might abandon multiple Checkout Sessions, each triggering its own checkout.
webhook so make sure to record when you send recovery emails to customers and avoid spamming them.