Skip to main content
POST
/
orders
/
quote
Get anyspend quote
curl --request POST \
  --url https://mainnet.anyspend.com/orders/quote \
  --header 'Content-Type: application/json' \
  --data '{
  "type": "swap",
  "srcChain": 1,
  "dstChain": 8453,
  "srcTokenAddress": "0x0000000000000000000000000000000000000000",
  "dstTokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "recipientAddress": "0x55c71fca5e01cf246718748ae540473e608d0282",
  "tradeType": "EXACT_INPUT",
  "amount": "1000000000000000000",
  "onrampVendor": "coinbase"
}'
{
  "success": true,
  "message": "Get quote successfully",
  "data": {
    "operation": "swap",
    "sender": "0x15846E6A7C839A208765a0B4754C2dd15E879990",
    "recipient": "0xaF1ae1B78bc767DaEBB91196Adf982E9d560AAB9",
    "currencyIn": {
      "currency": {
        "chainId": 1,
        "address": "0x0000000000000000000000000000000000000000",
        "symbol": "ETH",
        "name": "Ether",
        "decimals": 18,
        "metadata": {
          "logoURI": "https://assets.relay.link/icons/1/light.png"
        }
      },
      "amount": "1000000000000000000",
      "amountFormatted": "1.0",
      "amountUsd": "3229.715818",
      "minimumAmount": "1000000000000000000"
    },
    "currencyOut": {
      "currency": {
        "chainId": 8453,
        "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
        "symbol": "USDC",
        "name": "USD Coin",
        "decimals": 6,
        "metadata": {
          "logoURI": "https://coin-images.coingecko.com/coins/images/6319/large/usdc.png?1696506694"
        }
      },
      "amount": "3224805862",
      "amountFormatted": "3224.805862",
      "amountUsd": "3224.512405",
      "minimumAmount": "3192557803"
    },
    "totalImpact": {
      "usd": "-5.203413",
      "percent": "-0.16"
    },
    "swapImpact": {
      "usd": "-4.102797",
      "percent": "-0.13"
    },
    "rate": "3224.805862",
    "slippageTolerance": {
      "origin": {
        "usd": "0.000000",
        "value": "0",
        "percent": "0.00"
      },
      "destination": {
        "usd": "32.245124",
        "value": "32248059",
        "percent": "1.00"
      }
    },
    "timeEstimate": 24,
    "userBalance": "0",
    "pointsAmount": 100,
    "pointsMultiplier": 1.5
  },
  "statusCode": 200
}

Body

application/json
  • Option 1
  • Option 2
  • Option 3
  • Option 4
  • Option 5
  • Option 6

Quote for swap order

type
enum<string>
required

Order type for swap

Available options:
swap
srcChain
number
required

Source chain ID

Example:

1

dstChain
number
required

Destination chain ID

Example:

8453

srcTokenAddress
string
required

Source token contract address

Example:

"0x0000000000000000000000000000000000000000"

dstTokenAddress
string
required

Destination token contract address

Example:

"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"

tradeType
enum<string>
required

Type of trade execution

Available options:
EXACT_INPUT,
EXACT_OUTPUT
amount
string
required

Amount to quote

Example:

"1000000000000000000"

recipientAddress
string

Recipient address

Example:

"0x55c71fca5e01cf246718748ae540473e608d0282"

onrampVendor
enum<string>

Optional onramp vendor

Available options:
coinbase,
stripe,
stripe-web2

Response

Quote retrieved successfully

success
boolean
required
Example:

true

message
string
required
Example:

"Get quote successfully"

data
object
required
statusCode
number
required
Example:

200

I