# Refunds can be retried safely with Idempotency-Key

- Date: 2026-10-21
- Type: New
- Surface: /api/public
- What you need to do: Nothing.
- Address: https://developers.rivr.io/changelog/2026-10-21-refund-idempotency-key

POST /api/public/orders/{orderId}/refund accepts an optional Idempotency-Key header: 1 to 255 printable ASCII characters, a new value for every refund and the same value when you retry that refund. The first 2xx response is stored for 24 hours and is sent again, with Idempotent-Replayed: true, for the same key, order and body, so a retry never refunds twice. Two requests with the same key that arrive at the same time never refund twice either: the second gets 409 idempotency_in_progress with Retry-After. A refusal is not stored, so the key can be used again once the cause is gone. Without the header the endpoint behaves as before. Creating an order is already idempotent through the order id. The codes idempotency_key_invalid, idempotency_in_progress, idempotency_mismatch, idempotency_outcome_unknown and idempotency_unavailable have pages under Error codes. In production since 2026-10-21 (platform release 2026.10.20.2531).

