Skip to main content
Errors come back as JSON with an HTTP status and a message. Quote and transaction errors also carry title, detail and extra with the specifics. Successful POST calls return 201, not 200: treat any 2xx as success. Retryable means you can send the same request again, after a backoff, and expect it to succeed. No means the same request will fail again: change what the “What to do” column says first.

Swap endpoints

/quote, /quote/build, /swap and /send. POST /swap behaves differently from /quote/build on a missing trustline: it returns 200 with an action field (CREATE_TRUSTLINE, RESTORE_BALANCE, RESTORE_CONTRACT) instead of an error, so a single call can carry the prerequisite. Sign and submit the xdr of that action, then call /swap again.

Authentication

Any route that needs a credential. Both 401 answers carry code, registerUrl and a WWW-Authenticate header:
POST /send is the exception. It answers 403 Forbidden resource for all of the cases above, with no code, registerUrl or WWW-Authenticate. Handle both statuses if you call it. A key that normally works can also get a 403 when the API could not check it at that moment. Retry with backoff before you replace the key.

Account endpoints

/register, /login, /refresh, /logout, /api-keys, /auth/email/*, /auth/password/* and /users/me/password. A body that fails validation answers 400 with message as an array of strings.

Retry policy in one line

Retry 429 after Retry-After and 503 with exponential backoff. Resolve 428 and build again. Quote again on 409 and on any build older than its time bound. Never retry a 400, 401, 403 or 500 unchanged.