Understanding idempotency

The Idempotency-Key header prevents duplicate payments or transfers when a request is retried.

❗️

Important: Idempotency is a mandatory requirement for every API integration that uses POST requests. Integrations that do not implement idempotency, or implement it incorrectly, will not be certified, and API access will not be enabled in production until the issue has been resolved.

How it works

  1. Generate a unique UUIDv4 Idempotency-Key for each request.
  2. If a request fails or you receive an uncertain response, retry it with the same key - the API will return the original result without processing the operation again.
  3. Use a different key for each distinct operation. Reusing a key with a different payload will return a 422 error.
curl --request POST \
     --url https://api-sandbox.fuse.com/v1/payments \
     --header 'authorization: Bearer <YOUR_ACCESS_TOKEN>' \
     --header 'Idempotency-Key: <YOUR_IDEMPOTENCY_KEY>' \
     --header 'content-type: application/json' \
     --data '{}'

Idempotency Errors

Status CodeError TypeDetailSolution
400Bad RequestIdempotency-Key was not provided or is not a valid UUIDv4.Provide a valid UUIDv4 in the Idempotency-Key header.
409ConflictA request with the same key has started but not yet completed.Wait for the original request to complete, then retry.
422Unprocessable EntityThe same key was used with a different request payload.Generate a new key and try again.

Did this page help you?