01
How would you design an idempotent payment API?
Tap to write answer
0 words | 0 charsPress Enter ↵ to reveal
Your Attempt
0 wordsRefined Model Answer
ReferenceI would require a client-generated idempotency key and store the first successful request result against that key. If the same key is retried, the API should return the original outcome instead of creating a duplicate charge. The important trade-off is balancing strict deduplication with safe retries across timeouts, partial failures, and network ambiguity.