System Design · Middle · Question 20 of 75

How do you safely retry a payment request after a network error?

Explanation

On a timeout you don't know whether the request got through. The key (Idempotency-Key) is generated by the client per operation; when the server sees a retry, it returns the stored result. This is how Stripe and many payment APIs work.

Further reading

Problem with a question

System Design · Middle · question 20

Test yourself

Take the System Design · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz