Idempotency
Networks fail. When a request times out you don’t know whether it reached Xaalis. Idempotency keys make the
retry safe: send the same Idempotency-Key header and you get the original object back instead of a second
payment or a second payout.
POST /v1/paymentsIdempotency-Key: order-1042- Required on
POST /v1/payouts, refunds, subscription create/cancel/advance and agent-wallet writes (a request without it gets400); strongly recommended onPOST /v1/payments. - Keys are scoped to your merchant account; up to you to make them unique — your order or withdrawal id works well.
- Same key, same request → the original object (even under concurrent retries for payments).
- Same key, different parameters →
409 idempotency_conflict(a payment’s amount; a payout’s amount, provider or recipient). Nothing is created. - Reuse a key only for a retry of the same operation. A new payment needs a new key.
The Node SDK generates a key for every create and reuses it on its automatic retries; pass your own to stay safe across process restarts.