Free tools Windows power users keep installed
One-click scans. No signup required.
Save a durable record of the payment operation and its stable idempotency key before calling the payment provider. If the provider charges the customer but your server crashes before saving the result, a retry with the same key can let a provider that supports idempotency return the original outcome rather than create another charge. A timeout is an unknown outcome—not proof that the payment failed.
Why saving the key after charging creates a duplicate-payment risk
A charge at a payment provider and a write to your own database are separate operations. A local database transaction cannot make both systems commit atomically. AWS describes this broader dual-write problem for database writes paired with external events; the same separation matters when your application writes a payment record and calls a processor. AWS’s transactional outbox guidance explains the general pattern.
- Your application receives a request to create a payment.
- It calls the provider before durably recording the logical payment operation and its stable idempotency key.
- The provider processes the charge.
- The process crashes, the connection drops, or the application fails before its local completion write.
- On recovery, the application lacks durable evidence of the first attempt. If it cannot recover the original key and sends a fresh request or new key, the provider may process another operation.
The uncertainty is fundamental: if a connection fails before a response arrives, the caller may not know whether the remote side effect happened. In Stripe’s 2017 engineering article, Brandur Leach describes failures before a call, during fulfillment, and after a successful operation whose response never reaches the client. Stripe’s explanation of idempotency and distributed state covers that failure model.
What to persist before the provider call
Create a local payment-intent or operation record before making the external request. Give it a stable identity and store the idempotency key that will identify this logical payment across retries. This ordering is an architectural recommendation for handling ambiguous failures; it is not a universal, provider-specific transaction recipe.
Recommended Free Tools
#1 Best Overall
- With Square Terminal, you can ring up sales, accept payments, and print receipts, all with one device. Use it at the counter or ring up customers anywhere in your store.
- Accept all major credit and debit cards and pay one low rate with no hidden fees and no long-term contracts.
- Process chip cards in just two seconds.
- Get your money as soon as the next business day.
- Use it cordlessly with the built-in battery, designed to last all day.
- One logical payment, one key: retries and replays for the same operation must use the original key, not generate a replacement.
- Keep the request consistent: Stripe compares parameters when a key is reused and returns an error if they differ. Preserve the original request data needed to retry accurately. Stripe’s current idempotency reference documents this behavior.
- Keep the operation recoverable: leave it pending or otherwise unresolved until your application can record or reconcile the provider’s outcome.
AWS’s Durable Execution guidance makes the replay issue explicit: generate the key once inside a durable step and pass that same key to every attempt. Generating a new key during replay defeats deduplication. AWS Durable Execution design best practices describe this stable-key principle.
What if the charge succeeds but the server crashes before saving the result?
Treat the payment as unresolved, not failed. The provider may have completed the charge even though your application never received or persisted the response. Retrying with the same key is safer than issuing a new logical operation, where the provider supports idempotency.
Rank #2
- Use the, easy-to-use, and customizable POS to get started.
- Accept contactless payments, chip cards, Apple Pay, and Google Pay from anywhere, with improved connectivity, extended battery life, and enhanced security. Pay one low rate for every tap or dip.
- No long-term commitments or contracts, no monthly fees- and with offline payments, keep taking payments for up to 24 hours.
- Safely and securely accepts payments anywhere. Plus, get data security, 24/7 fraud prevention, and payment-dispute management at no extra cost.
- Use the, easy-to-use, and customizable POS to get started.
For Stripe, subsequent requests using the same key return the original result, including a 500 response. Stripe also says it saves the first request’s resulting status code and body whether that request succeeds or fails. This behavior means an idempotent retry is not necessarily a fresh attempt that will eventually succeed; the original outcome may itself be an error. Check the operation’s state and use the provider’s documented retrieval or event mechanisms to resolve it. The appropriate lookup or reconciliation procedure depends on the integration and is not specified here.
Can you safely retry a payment after a timeout?
A timeout or lost connection does not establish whether the provider processed the request. If the endpoint supports idempotency, retry the same logical operation with the same key and the same parameters. Do not interpret a missing response as permission to start over with a new key.
Rank #3
- With Square Handheld, you can accept payments, take tableside orders, or scan barcodes anywhere. With a slim design and comfortable grip, the POS is easy to carry in your palm or pocket. Square Handheld is designed to withstand water splashes and dust. Add an optional protective case for accidental drops. A long-lasting battery and offline payments let you keep selling.
- Slim, pocketable, and lightweight so you can accept payments wherever your customers are.
- Take tableside orders, bust lines, or use the built-in barcode scanner, all with one sleek device.
- A battery that can power through your shift and offline payments let you keep selling, even if your internet is down.
- Accept all major credit and debit cards and pay one simple rate with no hidden fees and no long-term contracts required.
Stripe recommends exponential backoff with random jitter to avoid synchronized retries adding load. The retry schedule should be bounded and paired with a recovery path for operations that remain unresolved; retries alone do not replace durable local state. Stripe’s engineering article discusses backoff and jitter.
Do idempotency keys prevent duplicate charges forever?
No. Stripe says it may remove keys once they are at least 24 hours old. Reusing a key after it has been pruned creates a new request, so the original key cannot serve as permanent protection for delayed recovery. Keep durable local operation records and consult the current provider documentation when designing recovery beyond the provider’s retention period. Stripe’s current API reference describes key retention.
Rank #4
- The Clover Compact and Clover Mini /Station sync with each other through the Clover Dashboard and cloud-based network. This allows you to manage transactions, track sales, and access business data across both devices seamlessly. Plug in, not battery/mobile. Requires New Processing account through Powering POS. (US, PR, USVI). CANNOT be used with a different Processor. Rate match guarantee. Contact us for questions
What to check when designing payment retries
Stripe’s documented behavior should not be assumed to apply to another processor or every endpoint. Before relying on idempotency, check the documentation for the specific provider and operation:
Quick Recap
Best Value
- A complete countertop point of sale — Combine dual responsive touchscreens, built-in POS software, and durable hardware for a fast, reliable checkout experience.
- Serve customers faster — Run smoothly through busy shifts, complex menus, and big orders with high-speed processing, memory, and responsive touchscreen displays.
- Accept every way they pay — Take all major cards at one simple rate, with no hidden fees or long-term contracts. Receive funds as soon as the next business day.
- Handle real-world demands — Resist everyday spills, dust, and wear with a durable, IP54-rated design.
- Stay reliable through every rush — Maintain strong connectivity and consistent performance through your busiest hours.
- Does the charge or payment-creation endpoint support idempotency?
- What is the key’s scope, and how are concurrent requests with the same key handled?
- How long are keys retained, and when may they be pruned?
- Are requests with mismatched parameters rejected?
- Which outcomes are cached, including server errors?
- What documented retrieval, event, or reconciliation mechanisms can resolve an unknown outcome?
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

