guide
Idempotency
Network flakes happen. Protect your retry logic from double-charges (ops billed twice) and double-sends (webhook delivered for the same operation twice).
How to use
Add an Idempotency-Key header with a unique UUID per logical request:
curl -X POST https://api.snappdf.au/api/v1/merge \ -H "Authorization: Bearer $SNAPPDF_API_KEY" \ -H "Idempotency-Key: 7c9e6679-7425-40de-944b-e07fc1f90ae7" \ -F "file0=@a.pdf" -F "file1=@b.pdf"
SDK support
// JavaScript
await snap.pdf.merge({ files }, { idempotencyKey: crypto.randomUUID() });
// Python
snap.pdf.merge(files=files) # pass via `opts` in our helper methods
// Go
client.Merge(ctx, &snappdf.MergeInput{...}) // idempotency via context valueRetention
We remember idempotency keys for 24 hours. Same key within that window replays the cached response (and doesn't re-bill).