User bought some stock but the network is slow. There is no immediate feedback, so out of frustration, they tap the Buy button several times. A few seconds later, multiple orders are matched.

Have you ever got into this situation?

Disabling the button in the UI helps, but it isn't guarantee. UI state changes happen on main thread and depend on when the run loops get a chance to process them. If the main thread is busy, multiple tap events may be handled before the UI visibly transitions into its disabled state.

And even when the UI behaves perfectly, relying on the client alone is dangerous. This is where idempotency comes in.

Idempotency