> ## Documentation Index
> Fetch the complete documentation index at: https://docs.soroswap.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors

> The HTTP status codes the Soroswap Aggregator API returns, what each one means and what to do about it.

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.

| Status | When | What to do |
| - | - | - |
| **400** `No path found` | No route exists between the two assets for that amount, with the venues in `protocols` | Add venues to `protocols`, try a smaller amount, or check that both assets have liquidity |
| **400** `Invalid Stellar address` | `assetIn` or `assetOut` is not a valid Stellar address | Send contract addresses (`C...`) |
| **400** `amount must be a positive integer number of stroops` | `amount` is zero, negative or has decimals | Send the amount in the asset's smallest unit, as a string |
| **400** `sdex is not available for contract (C) addresses` | `from` or `to` is a contract and `sdex` was the only venue | Add a Soroban venue to `protocols`; see [Routing through SDEX](/api/sdex) |
| **400** `Simulation Failed` | The transaction fails when simulated, for example for lack of balance | Read `errorCode` and `extra`, fix the account state and build again |
| **400** `Transaction Failed` | `/send` submitted the transaction and the network rejected it | Read `detail` and `extra`; quote and build again before retrying |
| **403** | The API key is missing, malformed or revoked, or the route needs a role your key does not have | Send `Authorization: Bearer sk_...` with an active key. The API answers 403, never 401 |
| **409** `Quote stale` | The quote passed to `/quote/build` no longer matches the fee in force or its own amounts | Quote again and build from the new quote |
| **428** `CREATE_TRUSTLINE` | The receiving account has no trustline for the output asset | Sign and submit the transaction in `actionData.xdr`, then build again, or use [Gasless Trustline](/api/gasless-trustline) |
| **429** | You are over your plan's request rate | Wait `Retry-After` seconds; see [Plans and rate limits](/api/plans) |
| **503** `Routing unavailable` | The routing service could not answer | Retry with backoff. It is temporary, not a property of the pair |

`POST /swap` behaves differently from `/quote/build` on a missing trustline: it returns 200 with
an `action` field instead of a 428, so a single call can carry the prerequisite.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.