> ## Documentation Index
> Fetch the complete documentation index at: https://docs.multiliquid.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Retries and idempotency

> Which requests are safe to repeat, and what a repeat returns.

A request can time out, or its response can be lost, after the API has acted on it. Every route that changes state is built so that you can repeat the same request without it acting twice. No route takes an idempotency key header: each one identifies a repeat by what was signed.

## By route

| Route | What identifies a repeat | What a repeat returns |
| - | - | - |
| `POST /v1/swap/build` | Nothing: a build stores nothing | A fresh build at the current block or slot |
| `POST /v1/batch-orders/prepare`, `POST /v1/batch-orders/{orderId}/cancel/prepare`, `POST /v1/redemptions/prepare` | Nothing: a preparation stores and reserves nothing | A fresh preparation, with a new nonce for a batch order |
| `POST /v1/submissions` | Each transaction hash, or on Solana each fee payer's signature | `200` with the existing submissions, each with `replayed: true`, when every transaction was submitted before |
| `POST /v1/batch-orders` | The order's nonce, or on Solana its signed transaction | `409` with code `DUPLICATE_ORDER` and the accepted order's `details.orderId` |
| `POST /v1/batch-orders/{orderId}/cancel` | The order | The original cancellation time |
| `POST /v1/redemptions` | The signed payload | `200` with the existing redemption and `replayed: true` |
| `PUT /v1/batch-orders/capital-providers/{capitalProviderId}/capacity` | The absolute total | The same capacity: it is set, not added |
| `PUT` and `DELETE /v1/batch-orders/capital-providers/{capitalProviderId}/operator` | The selected operator | `204` with the same selection |

Submissions and redemptions answer an identical repeat with a `2xx`, the existing resource, and `replayed: true`, except a [redemption restart](#restarting-a-failed-redemption). A first acceptance carries `replayed: false`, on `202` for a submission and `201` for a redemption.

Batch order intake is the exception. An order is accepted once, and intake never returns an existing order as a success, so a `201` always means a new order and a new capacity reservation. A repeat answers `409` with code `DUPLICATE_ORDER`, and `details.orderId` lets you read the accepted order.

## After a timeout or a 503

* **Signed transactions or a signed payload** are resubmitted unchanged. Sending the same request to `POST /v1/submissions` again returns the same submissions, with `replayed: true` for each one the first request stored, including when the first broadcast reached the network and the transaction already landed. Signing a new transaction instead creates a different submission, and both could land. A `503` with code `NETWORK_NOT_ACTIVE` is not retried: the API does not serve the network, and nothing was read or broadcast.
* **A redemption** is resubmitted with the same signed fields. A different signature for the same nonce is a new payload: before settlement starts it replaces the earlier redemption, which fails with `SUPERSEDED`, and after settlement starts it is rejected with `NONCE_IN_USE`.
* **A batch order** is resubmitted with the same `order` and signature. `DUPLICATE_ORDER` means the first attempt was accepted.
* **Any other request that changes state**, after a `408`, is retried only after you read the current state, because the first attempt may have taken effect.

## Restarting a failed redemption

Posting the same signed redemption again after it failed restarts it when its `failure.resubmittable` is `true`, and returns `200` with `replayed: false`. Fix the cause first, such as approving more \$TSY; no new signature is needed. [Lifecycle](https://docs.multiliquid.xyz/api-reference/treasury/lifecycle.md#idempotency-and-resubmission) describes when a failure is resubmittable.

## Related

> [card] [Rate limits](https://docs.multiliquid.xyz/api-reference/guides/rate-limits.md)
>
> How long to wait before a retry.

> [card] [Errors](https://docs.multiliquid.xyz/api-reference/guides/errors.md)
>
> Which codes you can retry.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.