First of all two words about the origin of the term idempotency. It’s a property of the object or operation at repeat application of operation to the object to give the same result, as at the first. In the context of the API, idempotency means that multiple requests are handled in the same way as one-time requests. In fact, the server should return the same answers to identical enquiries. On a pic.1, you can see an example of using a key in a postman:
It’s charm is that you can generate it yourself, in random order.
Moreover, no matter how many times you will send a request – the server will return the same value.
The use of the idempotency principle allows increase Internet transaction security and minimize possible financial losses; to be sure, that only one transaction has been made in the event that there were connection/network problems, problems with the cloud payments etc. Allow the accountant to eliminate the duplicate errors, because resending a “debit” request might cause two debits. In any case, with the idempotency key you will be sure that the transaction only runs once, excluding all repetitions.