Skip to main content

Retrying failed requests

DocketLayer charges only on successful 200 responses. A request that fails — network timeout, 500, 503, 429 — incurs no charge. It is safe to retry any non-200 response.

What to retry

Retry pattern

Payment replay protection

DocketLayer’s x402 implementation includes replay protection. Each payment transaction is claimed atomically within a 5-minute window — the same transaction signature cannot be used twice. Your x402 client library handles this automatically: if a request fails after payment is constructed, the library creates a fresh transaction on retry rather than reusing the signed bytes from the failed attempt. You do not need to manage this yourself. Do not manually reuse a signed Solana transaction across retries.

Idempotency keys on callbacks

Callback deliveries use Idempotency-Key — a stable UUIDv4 that is the same on every retry attempt for a given delivery. If DocketLayer retries a delivery because your endpoint was slow or returned a non-2xx response, you may receive the same payload more than once. Store processed Idempotency-Key values and skip duplicates:
In production, store processed keys in a database with a TTL that exceeds DocketLayer’s retry window (~54 hours).

Case not found — auto-enqueue

When GET /v2/case returns 404 with case_not_found, DocketLayer automatically enqueues the case for its next scrape cycle. Retrying the same query a few minutes later will typically succeed once the normalization service has populated the case. You are not charged for the 404.