
When a Stripe refund request times out, mark the outcome as unknown. Recover it with the original idempotency key and unchanged parameters for that specific refund. Reconcile against Stripe’s Refund object before telling the customer it succeeded or starting a new operation. A timeout can happen after Stripe has already created the refund. Stripe idempotent requests and Stripe low-level errors.
Give the approved refund its own operation record
Before sending the refund, store an operation ID, Stripe account, payment reference, amount in minor units, currency, idempotency key, time of first attempt, and the human approval reference if your workflow requires one. Keep the request parameters immutable once the request starts. Store the Stripe refund ID and status as soon as you know them. Record state transitions without copying customer messages or payment credentials into the log.
If the same conversation triggers a retry, look up the existing operation by its ID. If a separate legitimate partial refund is approved for the same payment, create a separate operation for that explicit approval. Using the payment ID alone as the idempotency key would tie those two legitimate requests together.
Decide what to do after each failure
| What the worker observed | Recovery step | Customer-facing update |
|---|---|---|
| Socket or response timeout, no reliable status | Retry with the same key and parameters within your bounded recovery window if the retry policy allows it. Record it as the same operation. | “We’re checking the status of your refund.” |
| Server returned HTTP 500 | Reconcile the operation with Stripe and keep it open. A new key can create another refund. | “Your refund is under review. We’ll update you after we verify its status.” |
| Stripe returned a refund ID and status is pending | Save the ID, keep the request pending, use a verified event or read the Refund again later. | “Your refund has been submitted and is pending.” |
| Refund succeeded and the details match | Close the operation as succeeded and send the confirmed update once. | Confirm the amount, currency and the next status the buyer should expect. |
| Key is past your retry window or the amount changed | Hand the case to billing to reconcile the original first. A new, distinct refund requires a new approval. | Give the customer a follow-up owner and time your team can meet. |
Stripe can remove idempotency keys after they are at least 24 hours old. A server error can be indeterminate even when Stripe caches its response. Use a bounded retry window inside your chosen record-retention and payment policy, then require reconciliation before resending. The Refund object exposes statuses including pending, succeeded and failed. Stripe idempotent requests, low-level errors, and Refund object status.
Reconcile your records with Stripe
If you know the refund ID, retrieve that Refund from the expected Stripe account and confirm the payment reference, amount, and currency. If the ID is unknown, link any later event to the stored operation using the account and your own operation reference where available. A payment can have several partial refunds of the same amount. Leave an ambiguous match open for billing review.
Verify Stripe’s webhook signature and deduplicate deliveries by event ID. Stripe events can arrive out of order. Retrieve the latest Refund object when an old or conflicting event arrives, then update your operation and send a customer message once per confirmed outcome. Stripe refund events and Stripe webhook delivery behavior.
Rehearse a lost response
Use a Stripe sandbox or a stub for this exercise. Approve a synthetic USD 14.00 refund from a USD 50.00 payment. Return a simulated timeout after the refund is created, then replay the original request with the same operation key and body. Confirm you end with one refund ID, one billing outcome and one customer notification. Repeat with duplicate event delivery, a pending status and a changed amount. The changed amount should go through a new approval after the first operation is resolved.
Turn the scenario into a gate with the AI support agent test checklist. Use the Stripe support workflow guide to choose billing cases and the AI support incident runbook if ambiguous changes reach a live queue.
Launch your AI agent in minutes
- Train on your docs, websites, Notion, Drive and YouTube
- Deploy to web, WhatsApp, Slack, Instagram and more
- No credit card required
Set up in minutes

