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
UNAUTHORIZEDUnauthorized access to authenticated endpoints
UNKNOWN_ERRORWhen the error is unknown
UNSUPPORTED_CURRENCYCurrency is not a valid native currency or erc20 token
UNSUPPORTED_CHAINChain id supplied is unsupported
UNSUPPORTED_ROUTECombination of chains and/or currencies is not supported
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
AMOUNT_TOO_LOWAmount is too small to cover transaction fees

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"
}