# Which press paid?

> The student pressed Pay three times. The master was charged once. Which press paid?

- Concept: Idempotency keys
- Published: 2026-12-04

A payment button you can press as many times as you like. How many times will you pay?

When you pay online, the app sends a message to the bank and waits for an answer. Sometimes
the answer gets lost on the way back. Did the payment go through? The app can't know, so it
asks again. Without care, asking again means paying again.

An idempotency key is a ticket number for one intention. The app writes it on every message
about that order. The bank keeps a list of numbers it has already handled. A second message
with the same number gets the same answer as the first, and no new charge.

So which press paid? The first one to arrive. The others were the same wish, asked again.
