POST /v1/transactions/analyze, /analyze/sandbox, /analyze/async, and /analyze/async/sandbox
require the X-Idempotency-Key header on every request.
- It is required — without a stable key you cannot retry safely.
- It must be between 16 and 128 characters, from the url-safe alphabet (
A-Z a-z 0-9 _ : . -). - The client generates and controls the key: you decide which transactions are “the same” by retrying with the same key, and which ones are new by using a different key.
The behaviors
The two 409s
They share HTTP 409 and error_code DATA_CONFLICT. You tell them apart by details (not
by message, which is the code’s generic prose).
1. Request in flight
details contains A request with this X-Idempotency-Key is already in progress.
Retry later with the same key. It is not an error in your payload.
2. Unreadable previous response
details contains The response stored for this X-Idempotency-Key was produced by an earlier version of the API and can no longer be replayed.
When Fraudeg scores a transaction, it stores the response tied to your key so it can
replay it. If that response was written under an earlier version of the contract and no longer
matches the current shape, it cannot be returned as is.
What matters:
- The transaction was scored and is stored. Nothing was lost.
- It is not an error in your request. Your payload and your key were fine.
- It is not scored again with that key. Reprocessing it would produce a different result from the one already stored — exactly what idempotency exists to prevent.
On the asynchronous paths
The key follows the same rule and lives in the same space as on the synchronous path: a key already decided by/analyze is replayed by /analyze/async, and vice versa. The difference is where
you see the result: the 202 only accepts the request, and the result arrives as a webhook (or you
read it from /analysis). With the same key you always get the
same transaction_id.
A
DECIDED key never changes. Each 202 generates its own webhook: a resend of a
decided key gets its own completed.
See Asynchronous analysis.
Next step: Fields.