# Stripe remembers your request when the response disappears

Published: 2026-10-11

A timeout can leave a checkout uncertain after the server has completed the operation. This Under the Hood explainer uses Stripe API v1's documented idempotency contract to show stable operation keys, saved-response replay, parameter and concurrency limits, the retention horizon and outcome reconciliation.

Canonical: https://thedailydiff.dev/video/idempotency-retries/

## What this video covers

- Idempotency concerns the intended effect of repeating an operation. Stripe API v1 adds a documented saved-response replay contract.
- A retry of the same logical action uses the same key and parameters. Persist the operation key across separate SDK calls or application restarts; a genuinely new action needs its own key.
- After endpoint execution begins, Stripe API v1 saves the first request's status and body, including 500 errors, and returns that saved response on retries.
- Changed parameters with the same key produce a mismatch. Validation failures and concurrent execution conflicts save no idempotent result for that attempt and can be retried.
- Stripe retains API v1 keys for at least 24 hours and can prune them afterward. Limit unresolved network retries to the first 24 hours, then stop and reconcile before repeating the operation.
- A cached 500 can keep replaying after connectivity recovers. The original operation may have side effects; use the relevant object, Dashboard request and webhooks to establish its outcome.
- API v2 uses different replay semantics. A key does not establish universal exactly-once delivery for email, inventory and every local database operation.

## Questions and answers

### Can a request that timed out still have succeeded on the server?

Yes. A server can finish the work while the response is lost on the way back, which leaves the client unsure of the outcome. An unprotected create request that is retried can repeat the side effect, such as charging a customer twice. Attaching an idempotency key before the first attempt, and reusing it on retries, protects the operation.

### How does an idempotency key make retrying a payment request safe?

An idempotency key labels one logical action. In Stripe's API v1, once endpoint execution begins, the first request's status and body are saved, and a retry with the same key and parameters returns that saved response. Persist the key across application restarts, and use a new key only for a genuinely new action.

### What happens if I reuse the same idempotency key with different parameters?

Stripe produces a mismatch. If parameters fail validation, or another request with that key is still executing, Stripe saves no idempotent result for that attempt, and those requests can be retried. A request that races an executing one receives a conflict. These are API v1 rules, and API v2 uses different replay semantics.

### How long should an application keep retrying with the same idempotency key?

Keep unresolved network retries inside the first 24 hours. Stripe retains API v1 keys for at least 24 hours and can prune them afterward, and a pruned key can execute a new request. After that window, stop and reconcile the original outcome. Exponential backoff and jitter give the server breathing room between retries.

### Is it safe to build a retry button on Stripe's idempotency contract?

The Daily Diff's verdict was SHIP IT. The episode would ship stable keys with bounded retries and reconciliation. A cached 500 error can keep replaying after connectivity recovers while the original operation may have had side effects, so check the relevant object, the Dashboard and webhooks. A key does not guarantee exactly-once delivery for email or inventory.

## Chapters

- 0:00 Did a timeout cancel your payment?
- 0:21 What does an idempotency key identify?
- 0:43 How does the same key make a retry safe?
- 1:07 What exactly does Stripe save?
- 1:28 What happens when the request changes?
- 1:56 How long is the remembered result safe to retry?
- 2:19 Why can a remembered error keep coming back?
- 2:39 Would I ship a retry button with this contract?

## Transcript

### Did a timeout cancel your payment?

0:00 You think a timeout means your payment failed. The server can finish while the reply disappears, leaving your checkout confidently displaying absolutely nothing. Why can a retry charge again? How does Stripe remember an attempt? When should you stop retrying? And keep one nasty detail in mind. A remembered error can outlive the network problem.

0:17 We'll come back to that. This is The Daily Diff, under the hood.

### What does an idempotency key identify?

0:21 Idempotency means repeating an operation has the same intended effect as doing it once. An idempotency key labels one logical action. Stripe's API version one recognizes that label on retries and replays a saved response. Picture buying a coffee. Stripe completes your payment request, and the response gets lost returning home. The customer sees a spinner. Their bank may have a more exciting interpretation. An unprotected create request can repeat the side effect.

### How does the same key make a retry safe?

0:45 Attach a unique key before the first attempt and keep it for retries. If your application restarts, preserve that key with the operation in your records. For Stripe's version one API, once endpoint execution begins, the first request's status and body are saved. Send the same key and parameters again, and Stripe returns the saved response. The coffee stays put while its receipt travels again.

### What exactly does Stripe save?

1:07 Here is Stripe's actual wording. Retries with the same key return the saved response, including five hundred errors. The documentation does more work than your optimistically named retry helper. The customer taps again. Your app decides whether that resumes the pending purchase or starts another one. A genuinely new coffee gets a new key. A fresh key for every network retry defeats the protection.

1:27 Different parameters with the same key trigger a mismatch.

### What happens when the request changes?

1:30 If parameters fail validation, or another request with that key is still executing, Stripe saves no idempotent result for that attempt. Those requests can be retried. A racing request gets a conflict. These are version one rules. Version two behaves differently. A header cannot promise exactly once delivery across your system. Email, inventory and your database each need failure handling.

1:52 The key protects the operation within its documented scope. Stripe retains version one keys for at least twenty four hours and can prune

### How long is the remembered result safe to retry?

1:59 them afterward. A pruned key can execute a new request. Keep unresolved retries inside the first day. Beyond that, stop and reconcile the original outcome. Use exponential backoff and jitter to give the server breathing room. Otherwise retries form a queue outside a burning coffee shop. Stripe's libraries handle retries, but check your library's defaults. That sticky error is the catch.

### Why can a remembered error keep coming back?

2:20 A cached five hundred response keeps replaying after connectivity recovers. The original operation may have produced side effects. Resolve its outcome using objects, the Dashboard and webhooks. A new key can repeat the action. If you'd rather read this than hear me say it, the diff lands in your inbox every morning, free at the daily diff dot dev, link below.

### Would I ship a retry button with this contract?

2:39 Verdict, under the hood. Ship it. I'd ship stable keys with bounded retries and reconciliation, so customers get coffee without funding your distributed systems education. And that's the diff for today. I'm Niko from Axrisi. Merge responsibly.

## Sources

- [Idempotent requests](https://docs.stripe.com/api/idempotent_requests) — Stripe Docs
- [Designing robust and predictable APIs with idempotency](https://stripe.com/blog/idempotency) — Stripe Engineering — Brandur Leach
- [Advanced error handling](https://docs.stripe.com/error-low-level) — Stripe Docs
- [HTTP Semantics — RFC 9110 §9.2.2 Idempotent Methods](https://www.rfc-editor.org/rfc/rfc9110.html) — IETF / RFC Editor
