IDEMPOTENCY_KEY_REUSED
The Idempotency-Key was used in the last 24 hours for a request with a different body or operation.
Typical cause
One key reused for every request of a batch, or a key derived from something that is not unique per request (a date, a customer id).
Fix
Generate a new key (a UUID) for every new logical request; reuse a key only to retry the same request.
Where it comes from
Any operation can answer it (HTTP 409).
Related
{
"error": {
"code": "IDEMPOTENCY_KEY_REUSED",
"message": "…",
"request_id": "req_01JB4Z0K3Q7V8W9X0Y1Z2A3B4C",
"doc_url": "https://developers.tracken.ee/errors/IDEMPOTENCY_KEY_REUSED"
}
}code, never on message, which is developer-facing English and may change. Field problems are in details, each with a JSON Pointer; the figures for your own text are in context. Quote request_id when you contact support.tracken fiscal-years create …
# exits 7 and prints the code, the message, each field problem and the request idimport { isApiError } from "@tracken/sdk";
try {
await tracken.fiscalYears.create(…);
} catch (error) {
if (!isApiError(error, "IDEMPOTENCY_KEY_REUSED")) throw error;
// Generate a new key (a UUID) for every new logical request; reuse a key only to retry the same request.
}