What is idempotency?
PreviousHow to download/view code running in your lambda functions?NextDatabase Optimisation - Indexing vs Sharding with Postgres and Django ORM examples
Last updated
You might ignore idempotency but not when you are a fintech. Dealing with payments and not building idempotent APIs could be a nightmare.
But, What are idempotent APIs? An idempotent API endpoint is one that can be called any number of times while guaranteeing that the operation will occur only once.
How to design an idempotent payment API?
Generate an idempotent key at the server side.
Send it along with the payment request.
Validate it before starting the payment process.
Refer to the flow diagram below.