---
title: "getQuote (Permit2)"
method: GET
path: "/swap/permit2/quote"
tags: ["Swap"]
---

# getQuote (Permit2)

`GET /swap/permit2/quote`

Get the firm quote for a swap using Permit2 to set allowances

## Query parameters

- `chainId` integer, required
- `buyToken` string, required
- `sellToken` string, required
- `sellAmount` string
- `buyAmount` string
- `taker` string, required
- `txOrigin` string
- `recipient` string
- `swapFeeRecipient` string
- `swapFeeBps` string
- `swapFeeToken` string
- `tradeSurplusRecipient` string
- `tradeSurplusMaxBps` integer
- `gasPrice` string
- `slippageBps` integer
- `slippagePpm` integer
- `excludedSources` string
- `sellEntireBalance` 'true' | 'false'
- `wrapUnwrapMode` 'direct' | 'settler'

## Headers

- `0x-api-key` string, required
- `0x-version` string, required

## Response `200`

Successful response

- union
  - object
    - `allowanceTarget` string, nullable, required — The target contract address for which the `taker` needs to have an allowance in order to be able to complete the swap. For swaps with the native asset (ie "ETH" or "BNB") as the `sellToken`, wrapping the native asset (i.e. "ETH" to "WETH") or unwrapping, no allowance is needed
    - `blockNumber` string, required — The block number at which the liquidity sources were sampled to generate the quote. This indicates the freshness of the quote
    - `buyAmount` string, required — The amount of `buyToken` (in `buyToken` units) that will be bought in the swap
    - `buyToken` string, required — The contract address of the token to buy in the swap
    - `fees` object, required — Fees to be deducted in this transaction. It contains the `integratorFee`, `zeroExFee` and `gasFee`
      - `integratorFee` object, nullable, required — The specified fee to charge and deliver to the `swapFeeRecipient`.
        - `amount` string, required — The amount of token charged as the integrator fee
        - `token` string, required — The address of the token charged as the integrator fee
        - `type` 'volume', required
      - `integratorFees` object[], nullable, required — The specified fees to charge and deliver to the `swapFeesRecipient`.
        - `amount` string, required — The amount of token charged as the integrator fee
        - `token` string, required — The address of the token charged as the integrator fee
        - `type` 'volume', required
      - `zeroExFee` object, nullable, required — The fee charged by 0x for the trade.
        - `amount` string, required — The amount of token charged as the 0x fee
        - `token` string, required — The address of the token charged as the 0x fee
        - `type` 'volume', required
      - `gasFee` object, nullable, required — The gas fee to be used in submitting the transaction.
        - `amount` string, required — The amount of token charged as the gas fee
        - `token` string, required — The address of the token charged as the gas fee
        - `type` 'gas', required
    - `issues` object, required — An object containing potential issues discovered during 0x validation that can prevent the swap from being executed successfully by the `taker`
      - `allowance` object, nullable, required — Details of allowances that the `taker` must set for in order to execute the swap successfully. Null if no allowance is required
        - `actual` string, required — The `taker`'s current allowance of the `spender`
        - `spender` string, required — The address to set the allowance on
      - `balance` object, nullable, required — Details of balance of the `sellToken` that the `taker` must hold. Null if the `taker` has sufficient balance
        - `token` string, required — The contract address of the `sellToken`
        - `actual` string, required — The current balance of the `sellToken` in the `taker` address
        - `expected` string, required — The balance of the `sellToken` required for the swap to execute successfully
      - `simulationIncomplete` boolean, required — This is set to `true` when 0x cannot validate the transaction. This happens when the `taker` has an insufficient balance of the `sellToken` and 0x is unable to peform ehanced quote validation with the low balance. Note that this does not necessarily mean that the trade will revert
      - `invalidSourcesPassed` string[], required — A list of invalid sources present in `excludedSources` request. See `https://api.0x.org/sources?chainId=` with the desired chain's ID for the list of valid sources
    - `liquidityAvailable` true, required — This validates the availability of liquidity for the quote requested. The rest of the fields will only be returned if `true`
    - `minBuyAmount` string, required — The price which must be met or else the entire transaction will revert. This price is influenced by the `slippageBps` parameter. On-chain sources may encounter price movements from quote to settlement
    - `mode` 'exact-in', required
    - `route` object, required — The path of liquidity sources to be used in executing this swap
      - `fills` object[], required — Details of each segment that 0x routes the swap through
        - `from` string, required — The contract address of the input token
        - `to` string, required — The contract address of the output token
        - `source` string, required — The liquidity source used in the route
        - `proportionBps` string, required — The proportion of the trade to be filled by the `source`
      - `tokens` object[], required — Properties of the tokens involved in the swap
        - `address` string, required — The token address. This is the unique identifier of the token
        - `symbol` string, required — The token symbol. This is not guaranteed to be unique, as multiple tokens can have the same symbol
    - `sellAmount` string, required — The amount of `sellToken` (in `sellToken` units) that will be sold in this swap
    - `sellToken` string, required — The contract address of the token to sell in the swap
    - `tokenMetadata` object, required — Swap-related metadata for the buy and sell token in the swap
      - `buyToken` object, required — Swap-related metadata for the buy token
        - `buyTaxBps` string, nullable, required — The buy tax in bps of the token. Since each token could have arbitrary implementation, this field is best effort, meaning it would be set to `null` if the system is not able to determine the tax
        - `sellTaxBps` string, nullable, required — The sell tax in bps of the token. Since each token could have arbitrary implementation, this field is best effort, meaning it would be set to `null` if the system is not able to determine the tax
        - `transferTaxBps` string, nullable, required — The transfer tax in bps of the token. Since each token could have arbitrary implementation, this field is best effort, meaning it would be set to `null` if the system is not able to determine the tax
      - `sellToken` object, required — Swap-related metadata for the sell token
        - `buyTaxBps` string, nullable, required — The buy tax in bps of the token. Since each token could have arbitrary implementation, this field is best effort, meaning it would be set to `null` if the system is not able to determine the tax
        - `sellTaxBps` string, nullable, required — The sell tax in bps of the token. Since each token could have arbitrary implementation, this field is best effort, meaning it would be set to `null` if the system is not able to determine the tax
        - `transferTaxBps` string, nullable, required — The transfer tax in bps of the token. Since each token could have arbitrary implementation, this field is best effort, meaning it would be set to `null` if the system is not able to determine the tax
    - `totalNetworkFee` string, nullable, required — The estimated total network cost of the swap. On chains where there is no L1 data cost, it is calculated as `gas` * `gasPrice`. On chains where there is an L1 data cost, it is calculated as `gas` * `gasPrice` + L1 data cost.
    - `zid` string, required — The unique ZeroEx identifier of the request
    - `permit2` object, nullable, required — This is the approval object which contains the necessary fields to submit an approval for this transaction. Null if sell token is the native token or the transaction is a native token wrap / unwrap
      - `type` 'Permit2', required — `Permit2`
      - `hash` string, required — The hash for the approval according to [EIP-712](https://eips.ethereum.org/EIPS/eip-712). If you compute the hash from eip712 field, it should match the value of this field
      - `eip712` object, required — Necessary data for [EIP-712](https://eips.ethereum.org/EIPS/eip-712)
        - `types` object, required
        - `domain` object, required
          - `name` string
          - `version` string
          - `chainId` number
          - `verifyingContract` string
          - `salt` string
        - `message` object, required
        - `primaryType` string, required
    - `transaction` object, required — This object contains the details required to submit the transaction
      - `to` string, required — The address of the target contract to send call `data` to. Do NOT use this field when setting token allowances — doing so can result in lost funds. Always use `issues.allowance.spender` or `allowanceTarget` for setting allowances.
      - `data` string, required — The calldata containing transaction execution details to be sent to the `to` address
      - `gas` string, nullable, required — The estimated gas limit that should be used to send the transaction to guarantee settlement
      - `gasPrice` string, required — The gas price (in wei) that should be used to send the transaction
      - `value` string, required — The amount of ether (in wei) that should be sent with the transaction
  - object
    - `allowanceTarget` string, nullable, required — The target contract address for which the `taker` needs to have an allowance in order to be able to complete the swap.
    - `blockNumber` string, required — The block number at which the liquidity sources were sampled to generate the quote. This indicates the freshness of the quote
    - `buyAmount` string, required — The amount of `buyToken` (in `buyToken` units) requested for the swap
    - `buyToken` string, required — The contract address of the token to buy in the swap
    - `estimatedNetSellAmount` string, required — The estimated net amount of `sellToken` spent after any exact-out refund route executes
    - `fees` object, required — Fees to be deducted in this transaction.
      - `integratorFee` object, nullable, required — The specified fee to charge and deliver to the `swapFeeRecipient`.
        - `amount` string, required — The amount of token charged as the integrator fee
        - `token` string, required — The address of the token charged as the integrator fee
        - `type` 'volume', required
      - `integratorFees` object[], nullable, required — The specified fees to charge and deliver to the `swapFeesRecipient`.
        - `amount` string, required — The amount of token charged as the integrator fee
        - `token` string, required — The address of the token charged as the integrator fee
        - `type` 'volume', required
      - `zeroExFee` object, nullable, required — The fee charged by 0x for the trade.
        - `amount` string, required — The amount of token charged as the 0x fee
        - `token` string, required — The address of the token charged as the 0x fee
        - `type` 'volume', required
    - `issues` object, required — An object containing potential issues discovered during 0x validation that can prevent the swap from being executed successfully by the `taker`
      - `allowance` object, nullable, required — Details of allowances that the `taker` must set for in order to execute the swap successfully. Null if no allowance is required
        - `actual` string, required — The `taker`'s current allowance of the `spender`
        - `spender` string, required — The address to set the allowance on
      - `balance` object, nullable, required — Details of balance of the `sellToken` that the `taker` must hold. Null if the `taker` has sufficient balance
        - `token` string, required — The contract address of the `sellToken`
        - `actual` string, required — The current balance of the `sellToken` in the `taker` address
        - `expected` string, required — The balance of the `sellToken` required for the swap to execute successfully
      - `simulationIncomplete` boolean, required — This is set to `true` when 0x cannot validate the transaction. This happens when the `taker` has an insufficient balance of the `sellToken` and 0x is unable to peform ehanced quote validation with the low balance. Note that this does not necessarily mean that the trade will revert
      - `invalidSourcesPassed` string[], required — A list of invalid sources present in `excludedSources` request. See `https://api.0x.org/sources?chainId=` with the desired chain's ID for the list of valid sources
    - `liquidityAvailable` true, required — This validates the availability of liquidity for the quote requested. The rest of the fields will only be returned if `true`
    - `mode` 'exact-out', required
    - `routes` object, required — The exact-out forward and refund routes
      - `forward` object, required — The forward route used to acquire at least the requested buy amount
        - `fills` object[], required — Details of each segment that 0x routes the swap through
          - `from` string, required — The contract address of the input token
          - `to` string, required — The contract address of the output token
          - `source` string, required — The liquidity source used in the route
          - `proportionBps` string, required — The proportion of the trade to be filled by the `source`
        - `tokens` object[], required — Properties of the tokens involved in the swap
          - `address` string, required — The token address. This is the unique identifier of the token
          - `symbol` string, required — The token symbol. This is not guaranteed to be unique, as multiple tokens can have the same symbol
      - `refund` object, required — The refund route used to convert buy-token surplus back to the sell token
        - `fills` object[], required — Details of each segment that 0x routes the swap through
          - `from` string, required — The contract address of the input token
          - `to` string, required — The contract address of the output token
          - `source` string, required — The liquidity source used in the route
          - `proportionBps` string, required — The proportion of the trade to be filled by the `source`
        - `tokens` object[], required — Properties of the tokens involved in the swap
          - `address` string, required — The token address. This is the unique identifier of the token
          - `symbol` string, required — The token symbol. This is not guaranteed to be unique, as multiple tokens can have the same symbol
    - `maxSellAmount` string, required — The maximum amount of `sellToken` that may be spent by the exact-out swap
    - `sellToken` string, required — The contract address of the token to sell in the swap
    - `tokenMetadata` object, required — Swap-related metadata for the buy and sell token in the swap
      - `buyToken` object, required — Swap-related metadata for the buy token
        - `buyTaxBps` string, nullable, required — The buy tax in bps of the token. Since each token could have arbitrary implementation, this field is best effort, meaning it would be set to `null` if the system is not able to determine the tax
        - `sellTaxBps` string, nullable, required — The sell tax in bps of the token. Since each token could have arbitrary implementation, this field is best effort, meaning it would be set to `null` if the system is not able to determine the tax
        - `transferTaxBps` string, nullable, required — The transfer tax in bps of the token. Since each token could have arbitrary implementation, this field is best effort, meaning it would be set to `null` if the system is not able to determine the tax
      - `sellToken` object, required — Swap-related metadata for the sell token
        - `buyTaxBps` string, nullable, required — The buy tax in bps of the token. Since each token could have arbitrary implementation, this field is best effort, meaning it would be set to `null` if the system is not able to determine the tax
        - `sellTaxBps` string, nullable, required — The sell tax in bps of the token. Since each token could have arbitrary implementation, this field is best effort, meaning it would be set to `null` if the system is not able to determine the tax
        - `transferTaxBps` string, nullable, required — The transfer tax in bps of the token. Since each token could have arbitrary implementation, this field is best effort, meaning it would be set to `null` if the system is not able to determine the tax
    - `totalNetworkFee` string, nullable, required — The estimated total network cost of the swap. On chains where there is no L1 data cost, it is calculated as `gas` * `gasPrice`. On chains where there is an L1 data cost, it is calculated as `gas` * `gasPrice` + L1 data cost.
    - `zid` string, required — The unique ZeroEx identifier of the request
    - `permit2` object, nullable, required — This is the approval object which contains the necessary fields to submit an approval for this transaction. Null if sell token is the native token or the transaction is a native token wrap / unwrap
      - `type` 'Permit2', required — `Permit2`
      - `hash` string, required — The hash for the approval according to [EIP-712](https://eips.ethereum.org/EIPS/eip-712). If you compute the hash from eip712 field, it should match the value of this field
      - `eip712` object, required — Necessary data for [EIP-712](https://eips.ethereum.org/EIPS/eip-712)
        - `types` object, required
        - `domain` object, required
          - `name` string
          - `version` string
          - `chainId` number
          - `verifyingContract` string
          - `salt` string
        - `message` object, required
        - `primaryType` string, required
    - `transaction` object, required — This object contains the details required to submit the transaction
      - `to` string, required — The address of the target contract to send call `data` to. Do NOT use this field when setting token allowances — doing so can result in lost funds. Always use `issues.allowance.spender` or `allowanceTarget` for setting allowances.
      - `data` string, required — The calldata containing transaction execution details to be sent to the `to` address
      - `gas` string, nullable, required — The estimated gas limit that should be used to send the transaction to guarantee settlement
      - `gasPrice` string, required — The gas price (in wei) that should be used to send the transaction
      - `value` string, required — The amount of ether (in wei) that should be sent with the transaction
  - object
    - `liquidityAvailable` false, required — This validates the availability of liquidity for the quote requested. No other fields will be returned if it is `false`
    - `zid` string, required — The unique ZeroEx identifier of the request

## Other responses

- `400` — 400 error response
- `403` — 403 error response
- `422` — 422 error response
- `500` — 500 error response

## Changes

- **2026-05-21** `9d5781bb0695` — 1 breaking
  - removed the required property `anyOf[subschema #1]/anyOf[subschema #2]/fees/gasFee` from the response with the `200` status
- **2026-05-13** `23db116bcbf5` — 17 breaking, 3 info
  - the `anyOf[subschema #1]/` response's property type/format changed from `object`/`` to ``/`` for status `200`
  - removed the required property `anyOf[subschema #1]/allowanceTarget` from the response with the `200` status
  - removed the required property `anyOf[subschema #1]/blockNumber` from the response with the `200` status
  - removed the required property `anyOf[subschema #1]/buyAmount` from the response with the `200` status
  - …16 more
- **2026-04-24** `2df8a96131a3` — 1 breaking, 1 info
  - for the `query` request parameter `slippageBps`, default value `100` was removed
  - added the new optional `query` request parameter `slippagePpm`
- **2026-04-08** `3266ce981e2f` — 1 info
  - added the new optional `query` request parameter `wrapUnwrapMode`

[Change history](https://skmtc.dev/0xproject/apis/0x-api/changes/swap/permit2/quote/get.md)

---

[API](https://skmtc.dev/0xproject/apis/0x-api.md) · [All operations](https://skmtc.dev/0xproject/apis/0x-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/0xproject/0x-api/revisions/27a84feeb09b/schema)
