How it works
Include anIdempotency-Key header when creating payments:
- Same key + same data → Returns the original response (cached)
- Same key + different data → Returns 409 Conflict
- Different key → Creates a new resource
Best practices
Do:- Use UUIDs for random keys (guaranteed unique)
- Use timestamps (clock skew defeats idempotency)
- Reuse keys for different logical operations
When to retry
| Error | Action |
|---|---|
| Network/timeout | Retry with same key, exponential backoff |
| 5xx server error | Retry with same key, exponential backoff |
| 409 Conflict | Check original request; use new key if needed |
| Other 4xx | Don’t retry — fix request data first |
Related
- Error Handling - Handling conflicts and other errors