# Cancellations can be retried safely with Idempotency-Key

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

POST /api/public/orders/{orderId}/cancel accepts an optional Idempotency-Key header, the same way the refund does: 1 to 255 printable ASCII characters, a new value for every cancellation and the same value when you retry that cancellation. The first 2xx response is stored for 24 hours and is sent again, with Idempotent-Replayed: true, for the same key, order and body. Without a key, a retry is safe only as long as the order stays cancelled. With a key, a late retry gets the stored 204 and does not cancel an order that has been opened again with PUT in the meantime. A key is scoped to the endpoint, so a key used on /refund is not the same key on /cancel. With the header, /cancel can answer idempotency_key_invalid, idempotency_in_progress, idempotency_mismatch, idempotency_outcome_unknown and idempotency_unavailable, which have pages under Error codes. Without the header the endpoint behaves exactly as before. In the sandbox and in production since platform release 2026.10.25.2647.

