Idempotency
Problem
You send:
Charge customer €100
The connection dies before the response arrives.
Did the payment happen?
Retrying might charge €100 again.
Solution — Idempotency
Give the logical operation an identity:
Idempotency-Key: ORDER-4711
Repeated requests with that key represent the same operation.
Core idea: idempotency makes repeating an operation safe from unintended duplicate effects.