Skip to main content
Network timeouts and client retries can cause duplicate operations. RemitFlex idempotency lets you retry mutating requests safely when authenticated with an API key.

When idempotency is required

Auth methodMutating requests (POST, PUT, PATCH, DELETE)
API keyRequired — include Idempotency-Key
Dashboard JWTNot required
Idempotency-Key: 7f3c2a1b-4e5d-6c7b-8a9f-0e1d2c3b4a5f
  • Max length: 255 characters
  • Use a fresh UUID (or similar unique string) per distinct operation
  • TTL: 24 hours (configurable server-side via IDEMPOTENCY_TTL_SECONDS)

Behavior

  1. First request with a given key → processed normally; response cached in Redis.
  2. Retry with the same key, org, HTTP method, and path → cached response returned without re-executing.
  3. Different operation → use a new idempotency key.
Reusing an idempotency key for a different request body returns the original response. Always generate a new key per operation.

Example: create swap

curl -X POST https://api.remitflex.com/v1/swaps \
  -H "Authorization: Bearer $REMITFLEX_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "USDC",
    "to": "EURC",
    "amount": 100,
    "destinationAddress": "2dudFU32c5wsRpfRZDXBAJFirHC4hindqpKSCwwtDaAB"
  }'

Endpoints that require idempotency (API key)

All POST and DELETE endpoints in this reference, including:
  • POST /swaps, POST /swaps/{id}/cancel
  • POST /customers
  • POST /payment-routes, POST /payment-routes/{id}/pause, POST /payment-routes/{id}/activate, POST /payment-routes/{id}/deposits/sync, DELETE /payment-routes/{id}

Errors

CodeMessage
400Idempotency-Key header is required for mutating API requests
422Idempotency-Key must be 255 characters or fewer
Failed requests are not cached — safe to retry with the same key after fixing the error.