Skip to main content

Idempotency

All write operations (POST, PATCH) require an Idempotency-Key header.

Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000

Send any unique string. UUIDs work well.

How it works

  1. You send a request with an idempotency key
  2. Quda creates the resource and caches the response
  3. If you send the same key again, Quda returns the cached response without creating a duplicate

The response header X-Idempotent-Replayed: true tells you a cached response was returned.

Why it matters

Network failures happen. If your request times out, you don't know if it went through. Retry with the same idempotency key and you'll either get the original result or create the resource for the first time. No duplicates either way.

This is especially critical for transfers. A retry without idempotency could move money twice.

Rules

The key must be unique per operation. Reusing a key from a different operation type returns the cached response from the original operation.

Keys expire after 24 hours.

GET requests do not require an idempotency key.