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

# Idempotency

> Retry any write without paying or charging twice.

Networks fail. If a request times out you cannot know whether it ran, so
you need to send it again without risk. Send an `Idempotency-Key` header
with a value of your own, up to 255 characters, unique per operation:
your order id is ideal.

```http theme={null}
Idempotency-Key: order-1042
```

`POST /v1/payins` and `POST /v1/payouts` **require** one; every other write
accepts one.

| Situation | What happens |
| - | - |
| First request with this key | It runs |
| Same key and same body, after it finished | The same answer again, with header `Idempotent-Replayed: true` |
| Same key, different body | `409 idempotency_conflict`: nothing runs |
| Same key while the first is still running | `409 idempotency_in_progress`: retry in a moment |
| The first request failed (an error answer) | The key is free again: retrying runs the request |

Keys are kept for 24 hours, separately for each account and for test and
live mode.

> [!TIP]
>
> Retry with the **same** key and the **same** body. A new key means a new
> payment.


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