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

# Idempotency

> Retry a create safely with an Idempotency-Key.

A network error can leave you unsure whether a `POST` went through. Send an `Idempotency-Key` with it, and a retry with the same key cannot create twice.

```bash theme={"dark"}
curl -X POST "https://api.easy-orders.net/api/partners-apps/v1/orders" \
  -H "Authorization: Bearer $EASYORDERS_ACCESS_TOKEN" \
  -H "Idempotency-Key: INV-778" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
```

* Use a key that comes from your own record, such as your invoice number, so a retry sends the same key. Up to 255 printable ASCII characters.
* The same key from your app within **24 hours** answers the first result again, with the header `Idempotent-Replayed: true`, and creates nothing.
* Only successful answers are kept. If the first request was refused, fix it and send it again with the same key.
* The same key with a different body answers `422 idempotency_key_reused`.
* While the first request is still running, the same key answers `409 idempotency_in_progress`: retry shortly.

Endpoints that take a key say so in the [API reference](https://developers-docs.easyorders.ai/api-reference/orders/overview.md).


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