Every response uses the same envelope. On success data carries the result; on
failure it is absent and message explains why.
Status codes
Request validation
A quote request missing fields returns every problem at once, semicolon separated,
rather than failing on the first one:
POST /quotes/routes requires matching originChainId and destinationChainId.
Its API reference documents a 400 response for invalid requests or when no
acceptable same-chain quote is available.
A 200 can still carry nothing
An unknown chainId on /blockchains/pools returns 200 with data: null,
not a 404. Null-check every data before iterating, or you will crash on a
request that technically succeeded.
Omitting chainId entirely is a different case and does fail properly:
Failures that are not HTTP errors
- The swap reverts.
amountOutMinimum is enforced on-chain, so a market that
moved between quoting and broadcasting reverts the transaction rather than filling
at a worse price. Re-quote and retry.