Common API Error Messages

If you're encountering issues with our API, this guide will help you understand some of our common API error messages.

General Errors

The following errors apply to all of Swing's endpoints:

  • 400 - Bad Request: This indicates an incorrect parameter. Ensure that all required parameters are correctly set.
{
  "statusCode": 400,
  "message": "polygons: Incorrect or unsupported chain slug",
  "error": "Bad Request"
}
  • 403 - Forbidden: The IP address you're using to access the API is within an unsupported jurisdiction.
{
  "error": "forbidden",
  "message": "unsupported jurisdiction"
}

Specific Errors:

The following errors apply to only the /send endpoint:

  • 400 - Bad Request:
    • Transfer amount exceeds allowance: This error indicates that the amount you are trying to transfer is greater than the amount that has been approved (allowed) for transfer by the user.
      {
        "statusCode": 400,
        "message": "Transfer amount exceeds allowance: 0x018c15DA1239B84b08283799B89045CD476BBbBb/0x3c499c542cef5e3811e1192ce70d8cc03d5c3359/4000000000000000, amount approved: 0"
      }
    • Insufficient funds for intrinsic transaction cost: This error indicates that the user has enough funds in thier wallets, but not enough to cover the gas fees.
      {
        "statusCode": 400,
        "message": "insufficient funds for intrinsic transaction cost"
      }
    • execution reverted: ERC20: transfer amount exceeds balance: This error indicates that the transaction was reverted because the amount of ERC20 tokens you attempted to transfer is greater than the balance available in the sender's account.
      {
        "id": 267870,
        "fromToken": {
          "address": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
          "symbol": "USDC",
          "name": "USDC",
          "decimals": 6,
          "logoURI": "https://raw.githubusercontent.com/multiversx/mx-assets/master/tokens/USDC-c76f1f/logo.png"
        },
        "toToken": {
          "address": "0x0000000000000000000000000000000000000000",
          "symbol": "MATIC",
          "name": "MATIC",
          "decimals": 18,
          "logoURI": "https://raw.githubusercontent.com/polkaswitch/assets/master/blockchains/ethereum/assets/0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0/logo.png"
        },
        "fromChain": {
          "chainId": 137,
          "name": "Polygon",
          "slug": "polygon",
          "protocolType": "evm"
        },
        "toChain": {
          "chainId": 137,
          "name": "Polygon",
          "slug": "polygon",
          "protocolType": "evm"
        },
        "route": [],
        "message": "execution reverted: ERC20: transfer amount exceeds balance",
        "error": "INSUFFICIENT_FUNDS",
        "statusCode": 400,
        "tx": {
          "from": "0x018c15DA1239B84b08283799B89045CD476BBbBb",
          "to": "0x6352a56caadC4F1E25CD6c75970Fa768A3304e64",
          "data": "0x90411a32000000000000000000000000000000000000000000000..",
          "value": "0x00"
        }
      }