# Idempotency

> orderId is the idempotency key for invoices, deposits, and withdrawal quotes.

`orderId` is the idempotency key when creating invoices, standalone deposits, and withdrawal quotes.

If the same request is sent more than once with the same `orderId`, Cryptonly treats it as the same logical operation and does not create a second object.

## Supported operations

`orderId` applies on:

* **invoice creation** (`POST /invoice`)
* **standalone deposit creation** (`POST /deposit`)
* **withdrawal quote** (`POST /withdrawal/quote`)

For withdrawals, idempotency applies at the **quote** step. The same `(accountId, orderId)` pair collapses to a single quote. **Commit** (`POST /withdrawal/commit`) reuses that quote and can back at most one committed withdrawal per `(accountId, orderId)`.

`orderId` is not a general-purpose idempotency key for other endpoints.

## Retries

Use a different `orderId` for each new invoice, deposit, or withdrawal. Reuse the same `orderId` only when retrying that request after a timeout or an uncertain response.

Generate `orderId` in your system. It should identify your own object, such as an order number, payment attempt, or withdrawal request.

For withdrawals, repeat the same `orderId` on **quote** retries, then commit once you have a `quoteId`.

:::caution
If a retried request uses a new `orderId`, Cryptonly treats it as a new create request.
:::

## Related pages

- [Invoices](https://docs.cryptonly.net/guides/invoices.md): orderId on invoice creation
- [Deposits](https://docs.cryptonly.net/guides/deposits.md): orderId on standalone deposits
- [Withdrawals lifecycle](https://docs.cryptonly.net/guides/withdrawals/withdrawals-lifecycle.md): orderId applies to the quote, then commit
- [HTTP status codes](https://docs.cryptonly.net/api-reference/http-status-codes.md): 409 when that orderId was already used
