logoalt Hacker News

raffael_detoday at 11:12 AM3 repliesview on HN

How and based on what is the idempotency key calculated which the clients sends with its request? In my double-purchase example above: when would the second purchase be requested with the same key or not?


Replies

Xenoamorphoustoday at 11:26 AM

If it’s a retry of the same request it should have the same key. If it’s not a retry, a different one. I don’t see the issue.

If the client sends the same key but a different payload that’s a 400 or 409 in my eyes.

shiandowtoday at 11:25 AM

It shouldn't, an error would be the right response.

mrkeentoday at 11:25 AM

1) Fresh UUID

2) Client's choice

show 1 reply