Idempotency

How the Idempotency-Key header makes purchases, installment plans and refunds safe to retry, and what a conflict means.

View as .mdUpdated
Three operations move money and therefore require an Idempotency-Key: creating a payment intent, starting an installment purchase and sending a refund. A retry with the same key returns the first result instead of paying twice.
OperationKey
POSTCreate payment intentRequired (header, or idempotency_key in the body)
POSTRequest installment purchaseRequired (header, or idempotency_key in the body)
POSTSend refundRequired (header)

Behaviour

CaseResult
New keyThe operation runs once.
Same key, same bodyThe first result is returned again; nothing new happens.
Same key, different body409 IDEMPOTENCY_CONFLICT.
No key400 VALIDATION_ERROR.

Use one key per purchase, for example a UUID or <task>-<step>. After a timeout, retry with the same key: you will get the original intent, whatever state it reached. The MCP tool request_purchase takes the same key as its idempotency_key argument.

On this page