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
| Status | Safe to retry | Notes |
|---|---|---|
| 429 | Yes | Wait for error.details.retry_after seconds |
| 500 | Yes | Unexpected server error — retry with backoff |
| 502 | Yes | Upstream court error — retry later |
| 503 | Yes | Court temporarily unavailable — retry later |
| 504 | Yes | Query timed out — retry later |
| 402 | No | Payment failed — fix wallet or x402 config first |
| 400 | No | Malformed request — fix parameters |
| 404 | Conditionally | Case not found — DocketLayer has enqueued it; retry in a few minutes |
| 422 | No | Court not covered — check /v2/status |
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 useIdempotency-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:
Case not found — auto-enqueue
WhenGET /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.