A customer presses Submit, the connection times out and the interface offers Try again. The first request may already have reached the server. If the second attempt is treated as a new operation, the customer can end up with two orders despite intending to place only one.
Disabling the button helps prevent rapid clicks, but it does not resolve uncertainty across a network. The server needs a way to recognise repeated attempts at the same intended operation.
Give the intention a stable identity
An idempotency key identifies that operation across retries. Reuse the key when retrying the same request; use a new one for a genuinely new order. Define which request fields must remain identical and reject conflicting reuse rather than silently applying different details to the old operation.
Stripe’s idempotency documentation provides a concrete API example, but its behaviour should not be assumed for another provider. Read how your service handles failures, concurrent requests, key retention and repeated parameters. Even versions of an API can differ in these details.
Track the state the customer needs
Distinguish “not submitted,” “received,” “processing,” “completed” and “failed” where the workflow requires them. After a timeout, checking the known operation’s status may be more useful than immediately sending another create request.
In a small test system, simulate a response being lost after the order is saved. Retry with the same identifier and verify that there is still one order. Then test conflicting details, simultaneous retries and a retry after the retention period. Use test data and the provider’s supported sandbox.
Keep sensitive customer information out of identifiers and diagnostic logs. A random reference can usually connect the events without exposing the payload.
The interface should explain the uncertainty honestly: “We are checking whether your order was received” is clearer than inviting endless resubmission. Reliable retries require agreement between the button, the application and the downstream service about what counts as the same action.

