How Idempotency Works

How Idempotency Works

How to retry a payment safely without charging the customer twice

What you'll learn

  • Why retries are dangerous for payments
  • What makes an operation idempotent
  • Idempotency keys and saving the result
  • Handling duplicates that arrive at once, and Stripe's approach

In this video, we'll look at what happens when a payment succeeds but the response is lost and the app retries, and how idempotency stops the customer from being charged twice. We'll cover idempotency keys, how the server handles repeated requests, and how to deal with two copies of a request arriving at the same time.

We'll also look at how Stripe uses idempotency keys to make payment retries safe.

More videos

32 short explainers so far, with more on the way

View all videos

Join the Community

roadmap.sh is among the top 10 most starred projects on GitHub and is visited by hundreds of thousands of developers every month.

Top 10 out of 28M!

371K

GitHub Stars

Star us on GitHub
Help us reach #1

+90kevery month

+3.2M

Registered Users

Register yourself
Commit to your growth

+2kevery month

52K

Discord Members

Join on Discord
Join the community

RoadmapsGuidesFAQsYouTube

roadmap.shby@nilbuild

Community created roadmaps, best practices, projects, articles, resources and journeys to help you choose your path and grow in your career.

© roadmap.sh·Terms·Privacy·

ThewNewStack

The top DevOps resource for Kubernetes, cloud-native computing, and large-scale development and deployment.