POST /orders/quote
Retrieves a quote to swap, execute contract, or participate in HypeDuel

Request Body required

application/json
One of:
Option 1
type string REQUIRED
Order type for swap
Enum: swap
srcChain number REQUIRED
Source chain ID
dstChain number REQUIRED
Destination chain ID
srcTokenAddress string REQUIRED
Source token contract address
dstTokenAddress string REQUIRED
Destination token contract address
recipientAddress string
Recipient address
tradeType string REQUIRED
Type of trade execution
Enum: EXACT_INPUT, EXACT_OUTPUT
amount string REQUIRED
Amount to quote
onrampVendor string
Optional onramp vendor
Enum: coinbase, stripe, stripe-web2, none
partnerId string
Optional partner ID
Option 2
type string REQUIRED
Order type for X402 swap
Enum: x402_swap
srcChain number REQUIRED
Source chain ID
dstChain number REQUIRED
Destination chain ID
srcTokenAddress string REQUIRED
Source token contract address
dstTokenAddress string REQUIRED
Destination token contract address
recipientAddress string
Recipient address
amount string REQUIRED
Amount to quote
onrampVendor string
Optional onramp vendor
Enum: coinbase, stripe, stripe-web2, none
partnerId string
Optional partner ID
Option 3
type string REQUIRED
Order type for custom execution
Enum: custom
srcChain number REQUIRED
Source chain ID
dstChain number REQUIRED
Destination chain ID
srcTokenAddress string REQUIRED
Source token contract address
dstTokenAddress string REQUIRED
Destination token contract address
recipientAddress string
Recipient address
payload object REQUIRED
Custom payload for execution
data string REQUIRED
Encoded transaction data
to string REQUIRED
Target contract address
spenderAddress string
Optional spender address for token approval
amount string REQUIRED
Amount for the custom operation
onrampVendor string
Optional onramp vendor
Enum: coinbase, stripe, stripe-web2, none
partnerId string
Optional partner ID
Option 4
type string REQUIRED
Enum: mint_nft
srcChain number REQUIRED
dstChain number REQUIRED
srcTokenAddress string REQUIRED
dstTokenAddress string REQUIRED
recipientAddress string
Recipient address
onrampVendor string
Enum: coinbase, stripe, stripe-web2, none
partnerId string
Optional partner ID
contractAddress string REQUIRED
tokenId number | null
contractType string REQUIRED
Enum: erc721, erc1155
price string REQUIRED
Option 5
type string REQUIRED
Enum: join_tournament
srcChain number REQUIRED
dstChain number REQUIRED
srcTokenAddress string REQUIRED
dstTokenAddress string REQUIRED
recipientAddress string
Recipient address
onrampVendor string
Enum: coinbase, stripe, stripe-web2, none
partnerId string
Optional partner ID
contractAddress string REQUIRED
price string REQUIRED
Option 6
type string REQUIRED
Enum: fund_tournament
srcChain number REQUIRED
dstChain number REQUIRED
srcTokenAddress string REQUIRED
dstTokenAddress string REQUIRED
recipientAddress string
Recipient address
onrampVendor string
Enum: coinbase, stripe, stripe-web2, none
partnerId string
Optional partner ID
contractAddress string REQUIRED
fundAmount string REQUIRED
Option 7
type string REQUIRED
Order type for HypeDuel
Enum: hype_duel
srcChain number REQUIRED
Source chain ID
dstChain number REQUIRED
Destination chain ID
srcTokenAddress string REQUIRED
Source token contract address
dstTokenAddress string REQUIRED
Destination token contract address
recipientAddress string
Recipient address
amount string REQUIRED
Amount to quote
onrampVendor string
Optional onramp vendor
Enum: coinbase, stripe, stripe-web2, none
partnerId string
Optional partner ID
Option 8
type string REQUIRED
Order type for custom exact in execution
Enum: custom_exact_in
srcChain number REQUIRED
Source chain ID
dstChain number REQUIRED
Destination chain ID
srcTokenAddress string REQUIRED
Source token contract address
dstTokenAddress string REQUIRED
Destination token contract address
recipientAddress string
Recipient address
amount string REQUIRED
Destination amount for exact in execution
onrampVendor string
Optional onramp vendor
Enum: coinbase, stripe, stripe-web2, none
partnerId string
Optional partner ID

Responses

200 Quote retrieved successfully
application/json
success boolean REQUIRED
message string REQUIRED
data object REQUIRED
operation string
Type of operation
sender string
Sender address for the operation
recipient string
Recipient address for the operation
currencyIn object
Input currency details
currency object
chainId number
address string
symbol string
name string
decimals number
metadata object
logoURI string
amount string
Raw amount
amountFormatted string
Human-readable formatted amount
amountUsd string
USD value of the amount
minimumAmount string
Minimum required amount
currencyOut object
Output currency details
currency object
chainId number
address string
symbol string
name string
decimals number
metadata object
logoURI string
amount string
Raw output amount
amountFormatted string
Human-readable formatted output amount
amountUsd string
USD value of output amount
minimumAmount string
Minimum guaranteed output amount
totalImpact object
Total price impact of the trade
usd string
USD impact amount
percent string
Percentage impact
swapImpact object
Price impact from the swap portion
usd string
USD swap impact
percent string
Percentage swap impact
rate string
Exchange rate
slippageTolerance object
Slippage tolerance settings
origin object
usd string
value string
percent string
destination object
usd string
value string
percent string
timeEstimate number
Estimated completion time in seconds
userBalance string
User's current balance
pointsAmount number
Anyspend points that will be awarded for the order
pointsMultiplier number
Multiplier applied to points that will be awarded for the order
fee unknown REQUIRED
statusCode number REQUIRED
400 Bad request
curl -X POST 'https://mainnet.anyspend.com/orders/quote' \
  -H 'Content-Type: application/json' \
  -d '{
  "type": "swap",
  "srcChain": 1,
  "dstChain": 8453,
  "srcTokenAddress": "0x0000000000000000000000000000000000000000",
  "dstTokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "recipientAddress": "0x55c71fca5e01cf246718748ae540473e608d0282",
  "tradeType": "EXACT_INPUT",
  "amount": "1000000000000000000",
  "onrampVendor": "coinbase",
  "partnerId": "string"
}'
const response = await fetch('https://mainnet.anyspend.com/orders/quote', {
  method: 'POST',
  headers: {
      "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "type": "swap",
    "srcChain": 1,
    "dstChain": 8453,
    "srcTokenAddress": "0x0000000000000000000000000000000000000000",
    "dstTokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "recipientAddress": "0x55c71fca5e01cf246718748ae540473e608d0282",
    "tradeType": "EXACT_INPUT",
    "amount": "1000000000000000000",
    "onrampVendor": "coinbase",
    "partnerId": "string"
  })
});

const data = await response.json();
console.log(data);
import requests

response = requests.post('https://mainnet.anyspend.com/orders/quote', json={
  "type": "swap",
  "srcChain": 1,
  "dstChain": 8453,
  "srcTokenAddress": "0x0000000000000000000000000000000000000000",
  "dstTokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "recipientAddress": "0x55c71fca5e01cf246718748ae540473e608d0282",
  "tradeType": "EXACT_INPUT",
  "amount": "1000000000000000000",
  "onrampVendor": "coinbase",
  "partnerId": "string"
})
print(response.json())
200 Response
{
  "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,
    "fee": {
      "type": "standard_fee",
      "feeVersion": 1,
      "tokenToCheckBalance": "0xb3b32f9f8827d4634fe7d973fa1034ec9fddb3b3",
      "recipientBalance": "302843673392800000000000",
      "anyspendFeeBps": 80,
      "anyspendWhaleDiscountBps": 5000,
      "anyspendPartnerDiscountBps": 0,
      "finalFeeBps": 40
    }
  },
  "statusCode": 200
}
POST /orders/quote
Ask a question... ⌘I