Field Manual PHP / Laravel reference
← HTTP / API

Idempotency

Idempotency means repeating an operation has the same intended effect.

What it is

Idempotency means repeating an operation has the same intended effect.

When to use it

Allow safe retries of payments or creation requests.

Syntax

POST /transfers
Idempotency-Key: 9cc64f1a-unique-client-key

Example

// Persist a unique (actor_id, key) plus request fingerprint and result.
// Same key + same fingerprint: return saved result.
// Same key + different payload: 409 conflict.
// Atomically persist the operation and result in one database transaction.

Common mistakes

An in-memory check races; a key without payload comparison can replay the wrong result; define expiry.

Related topics

Idempotency