> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anyspend.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get anyspend quote

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

` POST /orders/quote `

Get anyspend quote

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

## Servers

- ` https://mainnet.anyspend.com ` — Production server

## Request body (required)

Content type: ` application/json `

- ` value `: type ` unknown `

  - ` oneOf alternative 1 `: type ` object ` — Quote for swap order

    - Required fields: ` type `, ` srcChain `, ` dstChain `, ` srcTokenAddress `, ` dstTokenAddress `, ` tradeType `, ` amount `

    - ` type `: type ` string ` — Order type for swap

      - enum: ` ["swap"] `

    - ` srcChain `: type ` number ` — Source chain ID

      - example: ` 1 `

    - ` dstChain `: type ` number ` — Destination chain ID

      - example: ` 8453 `

    - ` srcTokenAddress `: type ` string ` — Source token contract address

      - example: ` "0x0000000000000000000000000000000000000000" `

    - ` dstTokenAddress `: type ` string ` — Destination token contract address

      - example: ` "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" `

    - ` recipientAddress `: type ` string ` — Recipient address

      - example: ` "0x55c71fca5e01cf246718748ae540473e608d0282" `

    - ` tradeType `: type ` string ` — Type of trade execution

      - enum: ` ["EXACT_INPUT","EXACT_OUTPUT"] `

    - ` amount `: type ` string ` — Amount to quote

      - example: ` "1000000000000000000" `

    - ` onrampVendor `: type ` string ` — Optional onramp vendor

      - enum: ` ["coinbase","stripe","stripe-web2","none"] `

    - ` partnerId `: type ` string ` — Optional partner ID

  - ` oneOf alternative 2 `: type ` object ` — Quote for X402 swap order

    - Required fields: ` type `, ` srcChain `, ` dstChain `, ` srcTokenAddress `, ` dstTokenAddress `, ` amount `

    - ` type `: type ` string ` — Order type for X402 swap

      - enum: ` ["x402_swap"] `

    - ` srcChain `: type ` number ` — Source chain ID

      - example: ` 8453 `

    - ` dstChain `: type ` number ` — Destination chain ID

      - example: ` 8453 `

    - ` srcTokenAddress `: type ` string ` — Source token contract address

      - example: ` "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" `

    - ` dstTokenAddress `: type ` string ` — Destination token contract address

      - example: ` "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" `

    - ` recipientAddress `: type ` string ` — Recipient address

      - example: ` "0x55c71fca5e01cf246718748ae540473e608d0282" `

    - ` amount `: type ` string ` — Amount to quote

      - example: ` "1000000" `

    - ` onrampVendor `: type ` string ` — Optional onramp vendor

      - enum: ` ["coinbase","stripe","stripe-web2","none"] `

    - ` partnerId `: type ` string ` — Optional partner ID

  - ` oneOf alternative 3 `: type ` object ` — Quote for custom order

    - Required fields: ` type `, ` srcChain `, ` dstChain `, ` srcTokenAddress `, ` dstTokenAddress `, ` payload `

    - ` type `: type ` string ` — Order type for custom execution

      - enum: ` ["custom"] `

    - ` srcChain `: type ` number ` — Source chain ID

      - example: ` 1 `

    - ` dstChain `: type ` number ` — Destination chain ID

      - example: ` 8453 `

    - ` srcTokenAddress `: type ` string ` — Source token contract address

      - example: ` "0x0000000000000000000000000000000000000000" `

    - ` dstTokenAddress `: type ` string ` — Destination token contract address

      - example: ` "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" `

    - ` recipientAddress `: type ` string ` — Recipient address

      - example: ` "0x55c71fca5e01cf246718748ae540473e608d0282" `

    - ` payload `: type ` object ` — Custom payload for execution

      - Required fields: ` data `, ` to `, ` amount `

      - ` data `: type ` string ` — Encoded transaction data

      - ` to `: type ` string ` — Target contract address

      - ` spenderAddress `: type ` string ` — Optional spender address for token approval

      - ` amount `: type ` string ` — Amount for the custom operation

    - ` onrampVendor `: type ` string ` — Optional onramp vendor

      - enum: ` ["coinbase","stripe","stripe-web2","none"] `

    - ` partnerId `: type ` string ` — Optional partner ID

  - ` oneOf alternative 4 `: type ` object ` — Quote for minting an NFT

    - Required fields: ` type `, ` srcChain `, ` dstChain `, ` srcTokenAddress `, ` dstTokenAddress `, ` contractAddress `, ` contractType `, ` price `

    - ` type `: type ` string `

      - enum: ` ["mint_nft"] `

    - ` srcChain `: type ` number `

    - ` dstChain `: type ` number `

    - ` srcTokenAddress `: type ` string `

    - ` dstTokenAddress `: type ` string `

    - ` recipientAddress `: type ` string ` — Recipient address

      - example: ` "0x55c71fca5e01cf246718748ae540473e608d0282" `

    - ` onrampVendor `: type ` string `

      - enum: ` ["coinbase","stripe","stripe-web2","none"] `

    - ` partnerId `: type ` string ` — Optional partner ID

    - ` contractAddress `: type ` string `

    - ` tokenId `: type ` number `; nullable

    - ` contractType `: type ` string `

      - enum: ` ["erc721","erc1155"] `

    - ` price `: type ` string `

  - ` oneOf alternative 5 `: type ` object ` — Quote for joining a tournament

    - Required fields: ` type `, ` srcChain `, ` dstChain `, ` srcTokenAddress `, ` dstTokenAddress `, ` contractAddress `, ` price `

    - ` type `: type ` string `

      - enum: ` ["join_tournament"] `

    - ` srcChain `: type ` number `

    - ` dstChain `: type ` number `

    - ` srcTokenAddress `: type ` string `

    - ` dstTokenAddress `: type ` string `

    - ` recipientAddress `: type ` string ` — Recipient address

      - example: ` "0x55c71fca5e01cf246718748ae540473e608d0282" `

    - ` onrampVendor `: type ` string `

      - enum: ` ["coinbase","stripe","stripe-web2","none"] `

    - ` partnerId `: type ` string ` — Optional partner ID

    - ` contractAddress `: type ` string `

    - ` price `: type ` string `

  - ` oneOf alternative 6 `: type ` object ` — Quote for funding a tournament

    - Required fields: ` type `, ` srcChain `, ` dstChain `, ` srcTokenAddress `, ` dstTokenAddress `, ` contractAddress `, ` fundAmount `

    - ` type `: type ` string `

      - enum: ` ["fund_tournament"] `

    - ` srcChain `: type ` number `

    - ` dstChain `: type ` number `

    - ` srcTokenAddress `: type ` string `

    - ` dstTokenAddress `: type ` string `

    - ` recipientAddress `: type ` string ` — Recipient address

      - example: ` "0x55c71fca5e01cf246718748ae540473e608d0282" `

    - ` onrampVendor `: type ` string `

      - enum: ` ["coinbase","stripe","stripe-web2","none"] `

    - ` partnerId `: type ` string ` — Optional partner ID

    - ` contractAddress `: type ` string `

    - ` fundAmount `: type ` string `

  - ` oneOf alternative 7 `: type ` object ` — Quote for HypeDuel order

    - Required fields: ` type `, ` srcChain `, ` dstChain `, ` srcTokenAddress `, ` dstTokenAddress `, ` amount `

    - ` type `: type ` string ` — Order type for HypeDuel

      - enum: ` ["hype_duel"] `

    - ` srcChain `: type ` number ` — Source chain ID

      - example: ` 1 `

    - ` dstChain `: type ` number ` — Destination chain ID

      - example: ` 8453 `

    - ` srcTokenAddress `: type ` string ` — Source token contract address

      - example: ` "0x0000000000000000000000000000000000000000" `

    - ` dstTokenAddress `: type ` string ` — Destination token contract address

      - example: ` "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" `

    - ` recipientAddress `: type ` string ` — Recipient address

      - example: ` "0x55c71fca5e01cf246718748ae540473e608d0282" `

    - ` amount `: type ` string ` — Amount to quote

      - example: ` "1000000000000000000" `

    - ` onrampVendor `: type ` string ` — Optional onramp vendor

      - enum: ` ["coinbase","stripe","stripe-web2","none"] `

    - ` partnerId `: type ` string ` — Optional partner ID

  - ` oneOf alternative 8 `: type ` object ` — Quote for custom exact in order

    - Required fields: ` type `, ` srcChain `, ` dstChain `, ` srcTokenAddress `, ` dstTokenAddress `, ` amount `

    - ` type `: type ` string ` — Order type for custom exact in execution

      - enum: ` ["custom_exact_in"] `

    - ` srcChain `: type ` number ` — Source chain ID

      - example: ` 1 `

    - ` dstChain `: type ` number ` — Destination chain ID

      - example: ` 8453 `

    - ` srcTokenAddress `: type ` string ` — Source token contract address

      - example: ` "0x0000000000000000000000000000000000000000" `

    - ` dstTokenAddress `: type ` string ` — Destination token contract address

      - example: ` "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" `

    - ` recipientAddress `: type ` string ` — Recipient address

      - example: ` "0x55c71fca5e01cf246718748ae540473e608d0282" `

    - ` amount `: type ` string ` — Destination amount for exact in execution

      - example: ` "1000000000000000000" `

    - ` onrampVendor `: type ` string ` — Optional onramp vendor

      - enum: ` ["coinbase","stripe","stripe-web2","none"] `

    - ` partnerId `: type ` string ` — Optional partner ID

## Responses

### ` 200 ` — Quote retrieved successfully

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` success `, ` message `, ` data `, ` statusCode `

  - ` success `: type ` boolean `

    - example: ` true `

  - ` message `: type ` string `

    - example: ` "Get quote successfully" `

  - ` data `: type ` object `

    - Required fields: ` fee `

    - ` operation `: type ` string ` — Type of operation

      - example: ` "swap" `

    - ` sender `: type ` string ` — Sender address for the operation

      - example: ` "0x15846E6A7C839A208765a0B4754C2dd15E879990" `

    - ` recipient `: type ` string ` — Recipient address for the operation

      - example: ` "0xaF1ae1B78bc767DaEBB91196Adf982E9d560AAB9" `

    - ` currencyIn `: type ` object ` — Input currency details

      - ` currency `: type ` object `

        - ` chainId `: type ` number `

          - example: ` 1 `

        - ` address `: type ` string `

          - example: ` "0x0000000000000000000000000000000000000000" `

        - ` symbol `: type ` string `

          - example: ` "ETH" `

        - ` name `: type ` string `

          - example: ` "Ether" `

        - ` decimals `: type ` number `

          - example: ` 18 `

        - ` metadata `: type ` object `

          - ` logoURI `: type ` string `

            - example: ` "https://assets.relay.link/icons/1/light.png" `

      - ` amount `: type ` string ` — Raw amount

        - example: ` "1000000000000000000" `

      - ` amountFormatted `: type ` string ` — Human-readable formatted amount

        - example: ` "1.0" `

      - ` amountUsd `: type ` string ` — USD value of the amount

        - example: ` "3229.715818" `

      - ` minimumAmount `: type ` string ` — Minimum required amount

        - example: ` "1000000000000000000" `

    - ` currencyOut `: type ` object ` — Output currency details

      - ` currency `: type ` object `

        - ` chainId `: type ` number `

          - example: ` 8453 `

        - ` address `: type ` string `

          - example: ` "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913" `

        - ` symbol `: type ` string `

          - example: ` "USDC" `

        - ` name `: type ` string `

          - example: ` "USD Coin" `

        - ` decimals `: type ` number `

          - example: ` 6 `

        - ` metadata `: type ` object `

          - ` logoURI `: type ` string `

            - example: ` "https://coin-images.coingecko.com/coins/images/6319/large/usdc.png?1696506694" `

      - ` amount `: type ` string ` — Raw output amount

        - example: ` "3224805862" `

      - ` amountFormatted `: type ` string ` — Human-readable formatted output amount

        - example: ` "3224.805862" `

      - ` amountUsd `: type ` string ` — USD value of output amount

        - example: ` "3224.512405" `

      - ` minimumAmount `: type ` string ` — Minimum guaranteed output amount

        - example: ` "3192557803" `

    - ` totalImpact `: type ` object ` — Total price impact of the trade

      - ` usd `: type ` string ` — USD impact amount

        - example: ` "-5.203413" `

      - ` percent `: type ` string ` — Percentage impact

        - example: ` "-0.16" `

    - ` swapImpact `: type ` object ` — Price impact from the swap portion

      - ` usd `: type ` string ` — USD swap impact

        - example: ` "-4.102797" `

      - ` percent `: type ` string ` — Percentage swap impact

        - example: ` "-0.13" `

    - ` rate `: type ` string ` — Exchange rate

      - example: ` "3224.805862" `

    - ` slippageTolerance `: type ` object ` — Slippage tolerance settings

      - ` origin `: type ` object `

        - ` usd `: type ` string `

          - example: ` "0.000000" `

        - ` value `: type ` string `

          - example: ` "0" `

        - ` percent `: type ` string `

          - example: ` "0.00" `

      - ` destination `: type ` object `

        - ` usd `: type ` string `

          - example: ` "32.245124" `

        - ` value `: type ` string `

          - example: ` "32248059" `

        - ` percent `: type ` string `

          - example: ` "1.00" `

    - ` timeEstimate `: type ` number ` — Estimated completion time in seconds

      - example: ` 24 `

    - ` userBalance `: type ` string ` — User's current balance

      - example: ` "0" `

    - ` pointsAmount `: type ` number ` — Anyspend points that will be awarded for the order

      - example: ` 100 `

    - ` pointsMultiplier `: type ` number ` — Multiplier applied to points that will be awarded for the order

      - example: ` 1.5 `

    - ` fee `: type ` unknown `

      - ` oneOf alternative 1 `: type ` object ` — Standard crypto fee structure (non-Stripe transactions)

        - Required fields: ` type `, ` feeVersion `, ` tokenToCheckBalance `, ` recipientBalance `, ` anyspendFeeBps `, ` anyspendWhaleDiscountBps `, ` anyspendPartnerDiscountBps `, ` finalFeeBps `

        - ` type `: type ` string ` — Fee type identifier

          - enum: ` ["standard_fee"] `

        - ` feeVersion `: type ` number ` — Fee version number

          - example: ` 1 `

        - ` tokenToCheckBalance `: type ` string ` — Token contract address used to check balance for whale discount (B3 token)

          - example: ` "0xb3b32f9f8827d4634fe7d973fa1034ec9fddb3b3" `

        - ` recipientBalance `: type ` string ` — Recipient's B3 token balance

          - example: ` "302843673392800000000000" `

        - ` anyspendFeeBps `: type ` number ` — AnySpend base fee in basis points before discounts

          - example: ` 80 `

        - ` anyspendWhaleDiscountBps `: type ` number ` — Whale discount in basis points based on B3 balance

          - example: ` 5000 `

        - ` anyspendPartnerDiscountBps `: type ` number ` — Partner discount in basis points (deprecated, always 0)

          - example: ` 0 `

        - ` finalFeeBps `: type ` number ` — Final fee in basis points after all discounts applied

          - example: ` 40 `

      - ` oneOf alternative 2 `: type ` object ` — Stripe Web2 fee structure including both Stripe and AnySpend fees

        - Required fields: ` type `, ` feeVersion `, ` tokenToCheckBalance `, ` recipientBalance `, ` stripeFeeBps `, ` stripeFeeUsd `, ` anyspendFeeBps `, ` anyspendFeeUsd `, ` anyspendWhaleDiscountBps `, ` anyspendPartnerDiscountBps `, ` finalFeeBps `, ` finalFeeUsd `, ` originalAmount `, ` finalAmount `

        - ` type `: type ` string ` — Fee type identifier

          - enum: ` ["stripeweb2_fee"] `

        - ` feeVersion `: type ` number ` — Fee version number

          - example: ` 1 `

        - ` tokenToCheckBalance `: type ` string ` — Token contract address used to check balance for whale discount (B3 token)

          - example: ` "0xb3b32f9f8827d4634fe7d973fa1034ec9fddb3b3" `

        - ` recipientBalance `: type ` string ` — Recipient's B3 token balance

          - example: ` "302843673392800000000000" `

        - ` stripeFeeBps `: type ` number ` — Stripe fee percentage in basis points (5.4%)

          - example: ` 540 `

        - ` stripeFeeUsd `: type ` number ` — Stripe fixed fee in USD

          - example: ` 0.3 `

        - ` anyspendFeeBps `: type ` number ` — AnySpend base fee in basis points before discounts

          - example: ` 80 `

        - ` anyspendFeeUsd `: type ` number ` — AnySpend fixed fee in USD before discounts

          - example: ` 0 `

        - ` anyspendWhaleDiscountBps `: type ` number ` — Whale discount in basis points based on B3 balance

          - example: ` 5000 `

        - ` anyspendPartnerDiscountBps `: type ` number ` — Partner discount in basis points (deprecated, always 0)

          - example: ` 0 `

        - ` finalFeeBps `: type ` number ` — Final combined fee percentage in basis points after all discounts

          - example: ` 580 `

        - ` finalFeeUsd `: type ` number ` — Final combined fixed fee in USD after all discounts

          - example: ` 0.3 `

        - ` originalAmount `: type ` string ` — Original amount before fees in USDC units (6 decimals)

          - example: ` "10000000" `

        - ` finalAmount `: type ` string ` — Final amount after applying all fees in USDC units (6 decimals)

          - example: ` "9120000" `

  - ` statusCode `: type ` number `

    - example: ` 200 `

### ` 400 ` — Bad request

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` success `, ` message `, ` statusCode `

  - ` success `: type ` boolean `

    - example: ` false `

  - ` message `: type ` string `

    - example: ` "Bad request" `

  - ` statusCode `: type ` number `

    - example: ` 400 `

## Request examples

### cURL

```curl
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"
}'
```

### JavaScript

```javascript
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);
```

### Python

```python
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())
```