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

# Idempotency

> Retry payment requests safely without creating duplicate invoices.

Network failures happen. When a request times out, you cannot tell whether PapelShip created the invoice. Idempotency keys let you retry safely.

## How it works

Add an `Idempotency-Key` header to a create request. If you send the same key again, PapelShip returns the original result instead of creating a second invoice or deposit address.

```bash theme={"system"}
curl -X POST https://app.papelship.com/api/api-store/v1/crypto-invoice \
  -H "Authorization: Bearer psa_your_api_key" \
  -H "Idempotency-Key: 9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d" \
  -H "Content-Type: application/json" \
  -d '{ "amount": 50, "coin_type": "LTC" }'
```

## Supported endpoints

* [`POST /payment-links`](/en/api-store/overview)
* [`POST /v1/crypto-invoice`](/en/api-store/crypto-payments)

## Best practices

* Generate one UUID v4 per order, not per request.
* Store the key with your order so every retry reuses it.
* Never reuse a key for a different order or amount.
