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

# Idempotency

> Safely retry create requests.

Generate a unique, stable `Idempotency-Key` from your logical order ID and
attempt number for each checkout creation attempt:
Retrying the same key with the same normalized request returns the original
checkout. Here, the normalized request is the server-validated request content
after JSON parsing and application of documented defaults; JSON whitespace and
object-key order do not make a new request. A changed amount, order ID, game
selection, URL, metadata value, or other effective input returns `409`.

```js theme={null}
const idempotencyKey = `${orderId}_checkout_attempt_${attemptNumber}`;
```

Persist the key with the order attempt and do not generate a new key for every
network retry. Skinloop does not currently publish a fixed retention duration,
so do not rely on a key expiring at a particular time.

The create endpoint returns `201` for a new checkout and `200` for an
idempotent replay. A `409` means the same key was used with a different
request; preserve the original attempt and use a new key for a genuinely new
attempt. Apply the same rule to payout requests and checkout deposits.
