Idempotency & retries
Avoid duplicate logical lookups and handle uncertain outcomes safely.
Choose a stable request key
For each new logical lookup, generate a fresh Idempotency-Key. Use 8–128 letters, digits, underscores, hyphens, dots or colons. A UUID is a suitable choice.
Idempotency-Key: 72c945f1-e973-43eb-b90e-f38147a82344Retain the original endpoint and JSON input when retrying. Do not recycle a key for a different operation or vehicle. Normalising whitespace/case is not permission to change the logical request.
Completed replay
A completed authenticated replay returns the saved result with Idempotency-Replayed: true, without another lookup charge. The saved billing object describes the original lookup; it is not a new charge instruction merely because billable remains true in that replay.
Retrying a lookup that did not finish
A lookup that ended with HTTP 503 has no answer to replay and was not charged, so retrying it with the same key runs it again; a charge applies only if that attempt returns a result. A completed no-match answer (HTTP 200 or 404) replays as saved.
Still running
An in-progress duplicate may returnHTTP409 with status: in_progress, request_id and retry_after. A recoverably queued execution can returnHTTP202. Follow the original lookup using status polling.
Conflicting reuse
Reusing a key for different input/operation returnsHTTP409. Do not automatically change the key and retry without deciding whether you actually want a new logical lookup.
Connection lost or client timeout
A lookup continues if your client disconnects. Retrying with the original key returns its result, or its progress if it is still running. Keep the original key to recover the outcome. Do not unconditionally generate a fresh key on each network retry. Observe returned waiting guidance and use bounded backoff rather than an immediate retry loop.
Rate and temporary errors
ForHTTP429, respect Retry-After. For an operational failure, inspect reason, detail and retryable. A retryable flag is not a promise of immediate recovery. A completed no-match result should not be repeatedly retried as if it were pending.
Replayed success example
The response body is the saved original result; there is no separate replay JSON envelope. A response may include:
HTTP/1.1 200 OK
Idempotency-Replayed: true
X-Request-Id: docs-example-paint-001The following is a field subset of the saved successful paint result:
{
"status": "found",
"paint": {
"code": "C6P",
"name": "Legend Grey",
"code_status": "identified",
"label_verified": false
},
"request_id": "docs-example-paint-001",
"billing": {
"billable": true,
"charge_pence": 0,
"currency": "GBP",
"included": true
}
}The original billing object is replayed unchanged, not charged again. Actual replay preserves the complete saved response body. Illustrative identifiers and values match the example on the paint endpoint page. In-progress duplicates and conflicting reuse have distinct HTTP 409 JSON examples.
