# Safe retries

How to retry a transacting call without creating it twice.

A network can fail after Ryde has already acted. Without protection, the obvious retry creates a second ride or a second order — and an AI agent retrying on a timeout is exactly the scenario this exists for.

```http
Idempotency-Key: 7f1c2b8e-49aa-4d2b-9d5f-6c3e0b1a8d24
```

- REQUIRED on every operation that creates a transaction. Optional but honoured on cancellations.
- Use a fresh UUID per intended action — not per retry, and not per customer.
- A repeat with the SAME key and the same body replays the original response, including its original status. Ryde does not act twice.
- The same key with a DIFFERENT body is refused with 409 IDEMPOTENCY_KEY_REUSED. A key identifies one intended transaction.
- Keys are retained for 24 hours; after that the same key is treated as new.

> **Info:** Generate the key BEFORE the first attempt and keep it with the request you are retrying. A key generated inside the retry loop is a new key every time and protects nothing.
