When an endpoint returns an error it will be accompanied with a code. The code is a predictable way to anticipate errors and handle them accordingly. Below is a list of errors returned by various APIs

NameDescription
AMOUNT_TOO_LOWAmount is too small to cover transaction fees
ERC20_ROUTER_ADDRESS_NOT_FOUNDRouter address for ERC20 token not found
EXTRA_TXS_NOT_SUPPORTEDExtra transactions are not supported for this operation
INSUFFICIENT_FUNDSInsufficient balance to perform crosschain action
INSUFFICIENT_LIQUIDITYSolver liquidity is insufficient to fulfill order
INVALID_ADDRESSAddress format is invalid or address has been blocked by OFAC
INVALID_EXTRA_TXSProvided extra transactions are invalid
NO_QUOTESNo quotes available for the requested transaction
NO_SWAP_ROUTES_FOUNDNo valid swap routes found for the requested pair
PERMIT_FAILEDToken permit operation failed
SWAP_IMPACT_TOO_HIGHSwap price impact exceeds acceptable threshold
SWAP_QUOTE_FAILEDFailed to get quote for swap operation
UNAUTHORIZEDUnauthorized access to authenticated endpoints
UNKNOWN_ERRORWhen the error is unknown
UNSUPPORTED_CHAINChain id supplied is unsupported
UNSUPPORTED_CURRENCYCurrency is not a valid native currency or erc20 token
UNSUPPORTED_EXECUTION_TYPERequested execution type is not supported
UNSUPPORTED_ROUTECombination of chains and/or currencies is not supported
USER_RECIPIENT_MISMATCHUser and recipient addresses do not match when required

These errors will be accompanied by a contextual message, for example:

{
  "message": "Swap output amount is too small to cover fees required to execute swap",
  "code": "AMOUNT_TOO_LOW"
}