Same Key Different Amount
A checkout service posts a charge with an idempotency key. The connection drops with no response. Before retrying, the app re-runs pricing and a coupon has since applied, so the retry carries the same key and a different amount.
POST /v1/charges HTTP/1.1
Host: api.stripe.com
Idempotency-Key: 4f8b1c2e-77a1-4d3e-9c05-2f1ab6d9e410
Content-Type: application/x-www-form-urlencoded
amount=4200¤cy=usd&customer=cus_92
POST /v1/charges HTTP/1.1
Host: api.stripe.com
Idempotency-Key: 4f8b1c2e-77a1-4d3e-9c05-2f1ab6d9e410
Content-Type: application/x-www-form-urlencoded
amount=3780¤cy=usd&customer=cus_92
The first request had already begun executing server-side. What does the second request return?
Sign in to answer questions and track your progress
Sign In