0x · Example Payload

0X Gasless Get Quote Example

CryptocurrencyDeFiDEX AggregatorSwapGaslessCross-ChainPermit2LiquidityTrade AnalyticsWeb3SettlementSmart Contracts

0X Gasless Get Quote Example is an example object payload from 0x, with 2 top-level fields. It illustrates the shape of data this provider's APIs accept or return.

Top-level fields

requestresponse

Example Payload

Raw ↑
{
  "request": {
    "method": "GET",
    "url": "https://api.0x.org/gasless/quote?chainId=1&sellToken=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48&buyToken=0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2&sellAmount=1000000000&taker=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
    "headers": {
      "0x-api-key": "YOUR_API_KEY",
      "0x-version": "v2"
    }
  },
  "response": {
    "status": 200,
    "body": {
      "liquidityAvailable": true,
      "chainId": 1,
      "blockNumber": "20850142",
      "buyAmount": "380000000000000",
      "buyToken": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
      "sellAmount": "1000000000",
      "sellToken": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "minBuyAmount": "376200000000000",
      "approval": {
        "type": "permit2",
        "hash": "0xabc1234567890abcdef1234567890abcdef1234567890abcdef1234567890abc",
        "eip712": {
          "domain": {
            "name": "Permit2",
            "chainId": 1,
            "verifyingContract": "0x000000000022D473030F116dDEE9F6B43aC78BA3"
          },
          "primaryType": "PermitTransferFrom",
          "message": {
            "permitted": {"token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "amount": "1000000000"},
            "spender": "0x7F6cEE965959295cC64d0E6c00d99d6532d8e86b",
            "nonce": "0",
            "deadline": "1735689600"
          }
        }
      },
      "trade": {
        "type": "metatransaction_v2",
        "hash": "0xdef0987654321fedcba0987654321fedcba0987654321fedcba0987654321fed",
        "eip712": {
          "domain": {
            "name": "ZeroEx",
            "version": "1.0.0",
            "chainId": 1,
            "verifyingContract": "0xdef1c0ded9bec7f1a1670819833240f027b25eff"
          },
          "primaryType": "MetaTransactionDataV2",
          "message": {
            "signer": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
            "sender": "0x0000000000000000000000000000000000000000",
            "expirationTimeSeconds": "1735689600",
            "salt": "1735682400",
            "callData": "0x...",
            "feeToken": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
            "fees": []
          }
        }
      },
      "fees": {
        "gasFee": {"amount": "2500000", "token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "type": "gas"},
        "integratorFee": null,
        "zeroExFee": {"amount": "0", "token": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", "type": "volume"}
      },
      "issues": {"allowance": null, "balance": null, "simulationIncomplete": false}
    }
  }
}