Skip to main content
code is one of the API’s documented error codes, or "upstream_error" when a proxy or CDN in front of the API returned a non-JSON failure. retryAfterMs is undefined when the response has no Retry-After. requestId is the value of the X-Request-Id response header, the same id the error body carries as error.requestId; it is undefined only when the failure came from something in front of the API. Quote it when reporting a problem.

Unknown outcomes

confirmation_timeout carries details with status: "pending" and the hash, and submit_failed carries the hash once the API has tried to send. Both mean the outcome is unknown. Resolve either with getTransaction, using the hash you computed from the envelope you signed, or let runClose do it with reconcile. submit_rejected is 422: the network refused the transaction.

Retrying safely

Retries are off by default. Enable them with retry: { attempts, baseDelayMs } on the client. Waits use Retry-After when present (capped at 30 seconds), otherwise exponential backoff with jitter, and a signal abort cuts a wait short. A timeout or a caller abort is never retried. submit is never retried because a repeated submit can land twice or hide that the first one succeeded; call getTransaction with the hash of the envelope you signed before resubmitting. mediatorSign is never retried because it co-signs with the relay account’s key. The API is stateless and re-reads live state each round, so calling closeTransactions again after a failure is always safe. Before resubmitting a transaction after a timeout, look it up with getTransaction. A signed transaction is valid until its validUntilLedger. Show users the plain-language message from blockers and error bodies, not raw status codes or stack traces.