An AI agent is finishing a checkout. It asks Stripe to create a payment and charge the card. Stripe charges the card and sends back a reply with the new payment's ID. Somewhere in between, the connection drops. The agent's code waits as long as it was told to, then raises an error.
Plenty of checkout code recognizes only two outcomes, paid and declined, so the error lands in declined and the order is marked failed. If the agent treats failure as a reason to try again, it may buy the item a second time. Either way, the customer now has a charge that the merchant's records say never happened.
A timeout tells you only that you didn't get an answer. Stripe knows what happened, and its list of payment statuses has no "unknown" in it. The ignorance exists only on your side, so your records need an "unknown" status of their own, along with a way to leave it.
There are three ways to leave it. Each is slower than the one before, and each depends on something you did before the request went out.
Ask again, with the same key. Stripe lets you attach an idempotency key to a request. The key is a unique label for one specific attempt, and Stripe stores its response under that label, keeping keys for at least 24 hours. Resend the identical request with the same key and you get the stored response back, lost payment ID included, without a second charge.
This only works if things happen in the right order. The key has to be generated and saved somewhere that survives a crash before the request goes out. If an agent creates the key inside a step that reruns after a crash, the retry carries a fresh key, Stripe sees a new payment, and the attempt to recover charges the customer twice.
Look it up. Looking up a payment takes its ID, and the ID was in the reply you lost. So attach your own order number to the payment as metadata, a set of custom notes that travel with Stripe's record. When the payment succeeds, Stripe sends your server a webhook, an unprompted notification, carrying that number, and you learn which order was paid. Stripe's search can also find payments by order number, but during outages it can lag by up to an hour, so an empty result does not close the case.
Reconcile. Stripe's payout reconciliation report matches each bank deposit to the payments it contains, and it can include the metadata you attached. Days later, the report shows the stray charge under an order number your records never marked as paid. Bank holidays stretch the wait: this week's Veterans Day pushed payouts scheduled for Wednesday to Thursday.
All three mechanisms tell you what happened, but none of them makes it anyone's job to act on the answer. India's rules for UPI, its instant bank-transfer system, do assign that job. When a customer's account is debited and the merchant gets no confirmation, the Reserve Bank of India requires the money to be returned automatically within five days. After that deadline the customer receives ₹100 (a little over a dollar) for each day of delay, without having to file a complaint. Leaving the question open becomes expensive, and the cost falls on the institutions able to answer it.
A checkout built on an API has no such rule unless the merchant writes one. Without it, the incentives favor "failed": the agent's run ends cleanly and the error dashboard stays quiet, while the open question passes to the customer, who eventually reopens it by sending support a screenshot of the charge.
A workable minimum:
- Save the key and the order number before the request goes out.
- Keep "unknown" visible on the order all the way through to support, and give it a named owner.
- Retry with the saved key well within 24 hours, look the payment up after that, and let the next payout report settle whatever is left.
-
Stripe's newer replay rules: In API v2's idempotency model, a repeated request within 30 days can complete work that failed and return an updated response, so the retry window and what a retry means both differ from v1.
-
When the terminal times out: Mastercard's Transaction Processing Rules require a card terminal that gets no authorization response to send an automatic reversal, and require the issuer to release the hold within 60 minutes of matching it.
-
The rule behind retries: HTTP's own specification, in RFC 9110 §9.2.2, says clients should not automatically retry a request that is not idempotent unless they can tell the original was never applied.
-
Which bank owes compensation: Axis Bank's customer compensation policy assigns the ₹100-a-day penalty for a late UPI merchant reversal to the beneficiary or acquiring bank, which shows how India's rule names a specific payer for an unresolved charge.

