March 2, 2026 6 min read

    PDF API Retries and Idempotency: Avoid Duplicate Processing

    How to safely retry generation/conversion jobs without duplicated outputs.

    Transient failures are normal. Duplicate invoices are not. Pair idempotency keys with durable state transitions.

    Recommended model

    • Create `job_id` and store `PENDING` state before API call.
    • Send idempotency token (or deterministic hash) per operation.
    • Retry only on retriable codes (429/5xx/network timeout).
    • Mark `DONE` only after output URL/hash is persisted.

    Backoff policy

    Use exponential backoff with jitter: 1s, 2s, 4s, 8s + random jitter cap.

    Ready to test this endpoint?

    Generate an API key and run it in the playground in under 60 seconds.