What is idempotency?
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.
Written by - Dishant Sethi
Tags
Enjoyed the blog? If so, you'll appreciate collaborating with the minds behind it as well.
PreviousHow to download/view code running in your lambda functions?NextDatabase Optimisation - Indexing vs Sharding with Postgres and Django ORM examples
Last updated