openapi: 3.0.3 info: title: 0x Cross-Chain Swap API description: This is the official API reference for the latest 0x API (v2). version: v2 x-source-url: https://github.com/0xProject/0x-docs/blob/main/fern/openapi.json x-last-validated: '2026-05-28' servers: - url: https://api.0x.org tags: - name: Swap description: Swap API endpoints paths: /swap/allowance-holder/price: get: operationId: swap::allowanceHolder::getPrice summary: Get Price (Allowance Holder) description: Get the indicative price for a swap using Allowance Holder to set allowances tags: - Swap parameters: - description: Visit dashboard.0x.org to get your API Key in: header name: 0x-api-key required: true schema: type: string - description: API version in: header name: 0x-version required: true schema: type: string example: v2 - name: chainId in: query required: true schema: type: integer exclusiveMinimum: true minimum: 0 description: Chain ID. See [here](https://docs.0x.org/docs/introduction/supported-chains) for the list of supported chains example: 1 - name: buyToken in: query required: true schema: type: string pattern: ^0x(?!0{40})[a-fA-F0-9]{40}$ description: The contract address of the token to buy example: '0xdac17f958d2ee523a2206206994597c13d831ec7' - name: sellToken in: query required: true schema: type: string pattern: ^0x(?!0{40})[a-fA-F0-9]{40}$ description: The contract address of the token to sell example: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' - name: sellAmount in: query required: false schema: type: string description: The amount of `sellToken` in `sellToken` base units to sell example: '100000000' - name: buyAmount in: query required: false schema: type: string description: The exact amount of `buyToken` in `buyToken` base units to buy - name: taker in: query required: false schema: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address which holds the `sellToken` balance and has the allowance set for the swap example: '0x70a9f34f9b34c64957b9c401a97bfed35b95049e' - name: txOrigin in: query required: false schema: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the external account that started the transaction. This is only needed if `taker` is a smart contract. - name: recipient in: query required: false schema: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address to receive the `buyToken`. If not provided, defaults to the taker address. Not supported for wrap/unwrap operations. - name: swapFeeRecipient in: query required: false schema: type: string pattern: ^\s*0x[a-fA-F0-9]{40}(\s*,\s*0x[a-fA-F0-9]{40})*\s*$ description: The wallet address to receive the specified trading fees (supports single or multiple comma-separated values). You must also specify the `swapFeeBps` in the request to use this feature. When multiple values are provided, must match length of `swapFeeBps`. - name: swapFeeBps in: query required: false schema: type: string pattern: ^\s*\d+(\s*,\s*\d+)*\s*$ description: The amount in Bps of the `swapFeeToken` to charge and deliver to the `swapFeeRecipient` (supports single or multiple comma-separated values). You must also specify the `swapFeeRecipient` in the request to use this feature. For security, this field has a default limit of 1000 Bps. If your application requires a higher value, please reach out to us. - name: swapFeeToken in: query required: false schema: type: string pattern: ^\s*0x(?!0{40})[a-fA-F0-9]{40}(\s*,\s*0x(?!0{40})[a-fA-F0-9]{40})*\s*$ description: The contract address of the token to receive trading fees in (supports single or multiple comma-separated values). Each token must be set to the value of either the `buyToken` or the `sellToken`. If omitted, the fee token will be determined by 0x with preference to stablecoins and highly liquid assets. You must also specify the `swapFeeRecipient` and `swapFeeBps` to charge integrator fees. When multiple values are provided, must match length of `swapFeeBps`. - name: tradeSurplusRecipient in: query required: false schema: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address to receive any trade surplus. If specified, this address will receive trade surplus when applicable. Otherwise, the taker will receive the surplus. This feature is only available to selected integrators on a custom pricing plan. In other cases, the surplus will be collected by 0x. For assistance with a custom plan, please contact support. - name: tradeSurplusMaxBps in: query required: false schema: type: integer minimum: 1 maximum: 10000 description: The maximum trade surplus (positive slippage) that can be collected in Bps of the buy amount. If not provided, defaults to 10000 (100%). Must be used together with `tradeSurplusRecipient`. - name: gasPrice in: query required: false schema: type: string description: The target gas price (in wei) for the swap transaction. If not provided, the default value is based on the 0x gas price oracle - name: slippageBps in: query required: false schema: type: integer minimum: 0 maximum: 10000 description: The maximum acceptable slippage of the `buyToken` in Bps. If this parameter is set to 0, no slippage will be tolerated. If not provided, the default slippage tolerance is 100Bps - name: slippagePpm in: query required: false schema: type: integer minimum: 0 maximum: 1000000 description: The maximum acceptable slippage of the `buyToken` in parts-per-million (PPM). Mutually exclusive with `slippageBps`. e.g. 3000 PPM = 30 BPS = 0.30%. - name: excludedSources in: query required: false schema: type: string description: Liquidity sources e.g. Uniswap_V3, SushiSwap, 0x_RFQ to exclude from the provided quote. See https://api.0x.org/sources?chainId= with the desired chain's ID for a full list of sources. Separate multiple sources with a comma - name: sellEntireBalance in: query required: false schema: type: string enum: - 'true' - 'false' default: 'false' description: If set to `true`, the taker's entire `sellToken` balance will be sold during trade execution. The `sellAmount` should be the maximum estimated value, as close as possible to the actual taker's balance to ensure the best routing. Selling more than the `sellAmount` may cause the trade to revert. This feature is designed for cases where the precise sell amount is determined during execution. Learn more [here](https://docs.0x.org/docs/0x-swap-api/additional-topics/sell-entire-balance). - name: wrapUnwrapMode in: query required: false schema: anyOf: - not: {} - type: string enum: - direct - settler description: Controls how native wrap/unwrap trades are executed. `direct` calls the wrapped-native token contract directly. `settler` routes wrap/unwrap through Settler or Allowance Holder for compatibility. Ignored for non-wrap/unwrap swaps. If omitted, `direct` mode is used. responses: '200': description: Successful response content: application/json: schema: anyOf: - anyOf: - type: object properties: allowanceTarget: type: string pattern: ^0x[a-fA-F0-9]{40}$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The block number at which the liquidity sources were sampled to generate the quote. This indicates the freshness of the quote buyAmount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of `buyToken` (in `buyToken` units) that will be bought in the swap buyToken: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the token to buy in the swap fees: type: object properties: integratorFee: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the integrator fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the integrator fee type: type: string enum: - volume required: - amount - token - type additionalProperties: false nullable: true description: The specified fee to charge and deliver to the `swapFeeRecipient`. integratorFees: type: array items: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the integrator fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the integrator fee type: type: string enum: - volume required: - amount - token - type additionalProperties: false nullable: true description: The specified fees to charge and deliver to the `swapFeesRecipient`. zeroExFee: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the 0x fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the 0x fee type: type: string enum: - volume required: - amount - token - type additionalProperties: false nullable: true description: The fee charged by 0x for the trade. gasFee: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the gas fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the gas fee type: type: string enum: - gas required: - amount - token - type additionalProperties: false nullable: true description: The gas fee to be used in submitting the transaction. required: - integratorFee - integratorFees - zeroExFee - gasFee additionalProperties: false description: Fees to be deducted in this transaction. It contains the `integratorFee`, `zeroExFee` and `gasFee` issues: type: object properties: allowance: type: object properties: actual: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The `taker`'s current allowance of the `spender` spender: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address to set the allowance on required: - actual - spender additionalProperties: false description: Details of allowances that the `taker` must set for in order to execute the swap successfully. Null if no allowance is required nullable: true balance: type: object properties: token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the `sellToken` actual: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The current balance of the `sellToken` in the `taker` address expected: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The balance of the `sellToken` required for the swap to execute successfully required: - token - actual - expected additionalProperties: false description: Details of balance of the `sellToken` that the `taker` must hold. Null if the `taker` has sufficient balance nullable: true simulationIncomplete: type: boolean description: 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: type: array items: type: string description: 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 required: - allowance - balance - simulationIncomplete - invalidSourcesPassed additionalProperties: false description: An object containing potential issues discovered during 0x validation that can prevent the swap from being executed successfully by the `taker` liquidityAvailable: type: boolean enum: - true description: This validates the availability of liquidity for the quote requested. The rest of the fields will only be returned if `true` minBuyAmount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: 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: type: string enum: - exact-in route: type: object properties: fills: type: array items: type: object properties: from: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the input token to: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the output token source: type: string description: The liquidity source used in the route proportionBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The proportion of the trade to be filled by the `source` required: - from - to - source - proportionBps additionalProperties: false description: Details of each segment that 0x routes the swap through tokens: type: array items: type: object properties: address: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The token address. This is the unique identifier of the token symbol: type: string description: The token symbol. This is not guaranteed to be unique, as multiple tokens can have the same symbol required: - address - symbol additionalProperties: false description: Properties of the tokens involved in the swap description: Properties of the tokens involved in the swap required: - fills - tokens additionalProperties: false description: The path of liquidity sources to be used in executing this swap sellAmount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of `sellToken` (in `sellToken` units) that will be sold in this swap sellToken: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the token to sell in the swap tokenMetadata: type: object properties: buyToken: type: object properties: buyTaxBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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 required: - buyTaxBps - sellTaxBps - transferTaxBps additionalProperties: false description: Swap-related metadata for the buy token sellToken: type: object properties: buyTaxBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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 required: - buyTaxBps - sellTaxBps - transferTaxBps additionalProperties: false description: Swap-related metadata for the sell token required: - buyToken - sellToken additionalProperties: false description: Swap-related metadata for the buy and sell token in the swap totalNetworkFee: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: type: string description: The unique ZeroEx identifier of the request gas: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: The estimated gas limit that should be used to send the transaction to guarantee settlement gasPrice: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The gas price (in wei) that should be used to send the transaction. The transaction needs to be sent with this `gasPrice` for the transaction to be successful required: - allowanceTarget - blockNumber - buyAmount - buyToken - fees - issues - liquidityAvailable - minBuyAmount - mode - route - sellAmount - sellToken - tokenMetadata - totalNetworkFee - zid - gas - gasPrice additionalProperties: false - type: object properties: allowanceTarget: type: string pattern: ^0x[a-fA-F0-9]{40}$ nullable: true description: The target contract address for which the `taker` needs to have an allowance in order to be able to complete the swap. blockNumber: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The block number at which the liquidity sources were sampled to generate the quote. This indicates the freshness of the quote buyAmount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The exact amount of `buyToken` (in `buyToken` units) requested for the swap buyToken: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the token to buy in the swap estimatedNetSellAmount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The estimated net amount of `sellToken` spent after any exact-out refund route executes fees: type: object properties: integratorFee: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the integrator fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the integrator fee type: type: string enum: - volume required: - amount - token - type additionalProperties: false nullable: true description: The specified fee to charge and deliver to the `swapFeeRecipient`. integratorFees: type: array items: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the integrator fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the integrator fee type: type: string enum: - volume required: - amount - token - type additionalProperties: false nullable: true description: The specified fees to charge and deliver to the `swapFeesRecipient`. zeroExFee: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the 0x fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the 0x fee type: type: string enum: - volume required: - amount - token - type additionalProperties: false nullable: true description: The fee charged by 0x for the trade. required: - integratorFee - integratorFees - zeroExFee additionalProperties: false description: Fees to be deducted in this transaction. issues: type: object properties: allowance: type: object properties: actual: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The `taker`'s current allowance of the `spender` spender: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address to set the allowance on required: - actual - spender additionalProperties: false description: Details of allowances that the `taker` must set for in order to execute the swap successfully. Null if no allowance is required nullable: true balance: type: object properties: token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the `sellToken` actual: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The current balance of the `sellToken` in the `taker` address expected: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The balance of the `sellToken` required for the swap to execute successfully required: - token - actual - expected additionalProperties: false description: Details of balance of the `sellToken` that the `taker` must hold. Null if the `taker` has sufficient balance nullable: true simulationIncomplete: type: boolean description: 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: type: array items: type: string description: 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 required: - allowance - balance - simulationIncomplete - invalidSourcesPassed additionalProperties: false description: An object containing potential issues discovered during 0x validation that can prevent the swap from being executed successfully by the `taker` liquidityAvailable: type: boolean enum: - true description: This validates the availability of liquidity for the quote requested. The rest of the fields will only be returned if `true` mode: type: string enum: - exact-out routes: type: object properties: forward: type: object properties: fills: type: array items: type: object properties: from: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the input token to: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the output token source: type: string description: The liquidity source used in the route proportionBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The proportion of the trade to be filled by the `source` required: - from - to - source - proportionBps additionalProperties: false description: Details of each segment that 0x routes the swap through tokens: type: array items: type: object properties: address: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The token address. This is the unique identifier of the token symbol: type: string description: The token symbol. This is not guaranteed to be unique, as multiple tokens can have the same symbol required: - address - symbol additionalProperties: false description: Properties of the tokens involved in the swap description: Properties of the tokens involved in the swap required: - fills - tokens additionalProperties: false description: The forward route used to acquire at least the requested buy amount refund: type: object properties: fills: type: array items: type: object properties: from: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the input token to: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the output token source: type: string description: The liquidity source used in the route proportionBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The proportion of the trade to be filled by the `source` required: - from - to - source - proportionBps additionalProperties: false description: Details of each segment that 0x routes the swap through tokens: type: array items: type: object properties: address: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The token address. This is the unique identifier of the token symbol: type: string description: The token symbol. This is not guaranteed to be unique, as multiple tokens can have the same symbol required: - address - symbol additionalProperties: false description: Properties of the tokens involved in the swap description: Properties of the tokens involved in the swap required: - fills - tokens additionalProperties: false description: The refund route used to convert buy-token surplus back to the sell token required: - forward - refund additionalProperties: false description: The exact-out forward and refund routes maxSellAmount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The maximum amount of `sellToken` that may be spent by the exact-out swap sellToken: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the token to sell in the swap tokenMetadata: type: object properties: buyToken: type: object properties: buyTaxBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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 required: - buyTaxBps - sellTaxBps - transferTaxBps additionalProperties: false description: Swap-related metadata for the buy token sellToken: type: object properties: buyTaxBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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 required: - buyTaxBps - sellTaxBps - transferTaxBps additionalProperties: false description: Swap-related metadata for the sell token required: - buyToken - sellToken additionalProperties: false description: Swap-related metadata for the buy and sell token in the swap totalNetworkFee: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: type: string description: The unique ZeroEx identifier of the request gas: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: The estimated gas limit that should be used to send the transaction to guarantee settlement gasPrice: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The gas price (in wei) that should be used to send the transaction. The transaction needs to be sent with this `gasPrice` for the transaction to be successful required: - allowanceTarget - blockNumber - buyAmount - buyToken - estimatedNetSellAmount - fees - issues - liquidityAvailable - mode - routes - maxSellAmount - sellToken - tokenMetadata - totalNetworkFee - zid - gas - gasPrice additionalProperties: false - type: object properties: liquidityAvailable: type: boolean enum: - false description: This validates the availability of liquidity for the quote requested. No other fields will be returned if it is `false` zid: type: string description: The unique ZeroEx identifier of the request required: - liquidityAvailable - zid additionalProperties: false example: allowanceTarget: '0x000000000022d473030f116ddee9f6b43ac78ba3' blockNumber: '20114676' buyAmount: '100032748' buyToken: '0xdac17f958d2ee523a2206206994597c13d831ec7' fees: integratorFee: null zeroExFee: null gasFee: null gas: '288095' gasPrice: '7062490000' issues: allowance: actual: '0' spender: '0x0000000000001ff3684f28c67538d4d072c22734' balance: token: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' actual: '0' expected: '100000000' simulationIncomplete: false invalidSourcesPassed: [] liquidityAvailable: true mode: exact-in minBuyAmount: '99032421' route: fills: - from: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' to: '0xdac17f958d2ee523a2206206994597c13d831ec7' source: SolidlyV3 proportionBps: '10000' tokens: - address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' symbol: USDC - address: '0xdac17f958d2ee523a2206206994597c13d831ec7' symbol: USDT sellAmount: '100000000' sellToken: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' tokenMetadata: buyToken: buyTaxBps: '0' sellTaxBps: '0' sellToken: buyTaxBps: '0' sellTaxBps: '0' totalNetworkFee: '2034668056550000' zid: '0x111111111111111111111111' '400': description: 400 error response content: application/json: schema: anyOf: - $ref: '#/components/schemas/INPUT_INVALID' - $ref: '#/components/schemas/RECIPIENT_NOT_SUPPORTED' - $ref: '#/components/schemas/SWAP_VALIDATION_FAILED' - $ref: '#/components/schemas/TOKEN_NOT_SUPPORTED' - $ref: '#/components/schemas/USER_NOT_AUTHORIZED' '403': description: 403 error response content: application/json: schema: anyOf: - $ref: '#/components/schemas/TAKER_NOT_AUTHORIZED_FOR_TRADE' - $ref: '#/components/schemas/RECIPIENT_NOT_AUTHORIZED_FOR_TRADE' - $ref: '#/components/schemas/XSTOCKS_NOT_AUTHORIZED' '422': description: 422 error response content: application/json: schema: anyOf: - $ref: '#/components/schemas/BUY_TOKEN_NOT_AUTHORIZED_FOR_TRADE' - $ref: '#/components/schemas/SELL_TOKEN_NOT_AUTHORIZED_FOR_TRADE' '500': description: 500 error response content: application/json: schema: anyOf: - $ref: '#/components/schemas/INTERNAL_SERVER_ERROR' - $ref: '#/components/schemas/UNCATEGORIZED' x-microcks-operation: delay: 0 dispatcher: FALLBACK /swap/allowance-holder/quote: get: operationId: swap::allowanceHolder::getQuote summary: Get Quote (Allowance Holder) description: Get the firm quote for a swap using Allowance Holder to set allowances tags: - Swap parameters: - description: Visit dashboard.0x.org to get your API Key in: header name: 0x-api-key required: true schema: type: string - description: API version in: header name: 0x-version required: true schema: type: string example: v2 - name: chainId in: query required: true schema: type: integer exclusiveMinimum: true minimum: 0 description: Chain ID. See [here](https://docs.0x.org/docs/introduction/supported-chains) for the list of supported chains example: 1 - name: buyToken in: query required: true schema: type: string pattern: ^0x(?!0{40})[a-fA-F0-9]{40}$ description: The contract address of the token to buy example: '0xdac17f958d2ee523a2206206994597c13d831ec7' - name: sellToken in: query required: true schema: type: string pattern: ^0x(?!0{40})[a-fA-F0-9]{40}$ description: The contract address of the token to sell example: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' - name: sellAmount in: query required: false schema: type: string description: The amount of `sellToken` in `sellToken` base units to sell example: '100000000' - name: buyAmount in: query required: false schema: type: string description: The exact amount of `buyToken` in `buyToken` base units to buy - name: taker in: query required: true schema: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address which holds the `sellToken` balance and has the allowance set for the swap example: '0x70a9f34f9b34c64957b9c401a97bfed35b95049e' - name: txOrigin in: query required: false schema: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the external account that started the transaction. This is only needed if `taker` is a smart contract. - name: recipient in: query required: false schema: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address to receive the `buyToken`. If not provided, defaults to the taker address. Not supported for wrap/unwrap operations. - name: swapFeeRecipient in: query required: false schema: type: string pattern: ^\s*0x[a-fA-F0-9]{40}(\s*,\s*0x[a-fA-F0-9]{40})*\s*$ description: The wallet address to receive the specified trading fees (supports single or multiple comma-separated values). You must also specify the `swapFeeBps` in the request to use this feature. When multiple values are provided, must match length of `swapFeeBps`. - name: swapFeeBps in: query required: false schema: type: string pattern: ^\s*\d+(\s*,\s*\d+)*\s*$ description: The amount in Bps of the `swapFeeToken` to charge and deliver to the `swapFeeRecipient` (supports single or multiple comma-separated values). You must also specify the `swapFeeRecipient` in the request to use this feature. For security, this field has a default limit of 1000 Bps. If your application requires a higher value, please reach out to us. - name: swapFeeToken in: query required: false schema: type: string pattern: ^\s*0x(?!0{40})[a-fA-F0-9]{40}(\s*,\s*0x(?!0{40})[a-fA-F0-9]{40})*\s*$ description: The contract address of the token to receive trading fees in (supports single or multiple comma-separated values). Each token must be set to the value of either the `buyToken` or the `sellToken`. If omitted, the fee token will be determined by 0x with preference to stablecoins and highly liquid assets. You must also specify the `swapFeeRecipient` and `swapFeeBps` to charge integrator fees. When multiple values are provided, must match length of `swapFeeBps`. - name: tradeSurplusRecipient in: query required: false schema: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address to receive any trade surplus. If specified, this address will receive trade surplus when applicable. Otherwise, the taker will receive the surplus. This feature is only available to selected integrators on a custom pricing plan. In other cases, the surplus will be collected by 0x. For assistance with a custom plan, please contact support. - name: tradeSurplusMaxBps in: query required: false schema: type: integer minimum: 1 maximum: 10000 description: The maximum trade surplus (positive slippage) that can be collected in Bps of the buy amount. If not provided, defaults to 10000 (100%). Must be used together with `tradeSurplusRecipient`. - name: gasPrice in: query required: false schema: type: string description: The target gas price (in wei) for the swap transaction. If not provided, the default value is based on the 0x gas price oracle - name: slippageBps in: query required: false schema: type: integer minimum: 0 maximum: 10000 description: The maximum acceptable slippage of the `buyToken` in Bps. If this parameter is set to 0, no slippage will be tolerated. If not provided, the default slippage tolerance is 100Bps - name: slippagePpm in: query required: false schema: type: integer minimum: 0 maximum: 1000000 description: The maximum acceptable slippage of the `buyToken` in parts-per-million (PPM). Mutually exclusive with `slippageBps`. e.g. 3000 PPM = 30 BPS = 0.30%. - name: excludedSources in: query required: false schema: type: string description: Liquidity sources e.g. Uniswap_V3, SushiSwap, 0x_RFQ to exclude from the provided quote. `See https://api.0x.org/sources?chainId=` with the desired chain's ID for a full list of sources. Separate multiple sources with a comma - name: sellEntireBalance in: query required: false schema: type: string enum: - 'true' - 'false' default: 'false' description: If set to `true`, the taker's entire `sellToken` balance will be sold during trade execution. The `sellAmount` should be the maximum estimated value, as close as possible to the actual taker's balance to ensure the best routing. Selling more than the `sellAmount` may cause the trade to revert. This feature is designed for cases where the precise sell amount is determined during execution. Learn more [here](https://docs.0x.org/docs/0x-swap-api/additional-topics/sell-entire-balance). - name: wrapUnwrapMode in: query required: false schema: anyOf: - not: {} - type: string enum: - direct - settler description: Controls how native wrap/unwrap trades are executed. `direct` calls the wrapped-native token contract directly. `settler` routes wrap/unwrap through Settler or Allowance Holder for compatibility. Ignored for non-wrap/unwrap swaps. If omitted, `direct` mode is used. responses: '200': description: Successful response content: application/json: schema: anyOf: - anyOf: - type: object properties: allowanceTarget: type: string pattern: ^0x[a-fA-F0-9]{40}$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The block number at which the liquidity sources were sampled to generate the quote. This indicates the freshness of the quote buyAmount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of `buyToken` (in `buyToken` units) that will be bought in the swap buyToken: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the token to buy in the swap fees: type: object properties: integratorFee: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the integrator fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the integrator fee type: type: string enum: - volume required: - amount - token - type additionalProperties: false nullable: true description: The specified fee to charge and deliver to the `swapFeeRecipient`. integratorFees: type: array items: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the integrator fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the integrator fee type: type: string enum: - volume required: - amount - token - type additionalProperties: false nullable: true description: The specified fees to charge and deliver to the `swapFeesRecipient`. zeroExFee: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the 0x fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the 0x fee type: type: string enum: - volume required: - amount - token - type additionalProperties: false nullable: true description: The fee charged by 0x for the trade. gasFee: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the gas fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the gas fee type: type: string enum: - gas required: - amount - token - type additionalProperties: false nullable: true description: The gas fee to be used in submitting the transaction. required: - integratorFee - integratorFees - zeroExFee - gasFee additionalProperties: false description: Fees to be deducted in this transaction. It contains the `integratorFee`, `zeroExFee` and `gasFee` issues: type: object properties: allowance: type: object properties: actual: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The `taker`'s current allowance of the `spender` spender: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address to set the allowance on required: - actual - spender additionalProperties: false description: Details of allowances that the `taker` must set for in order to execute the swap successfully. Null if no allowance is required nullable: true balance: type: object properties: token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the `sellToken` actual: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The current balance of the `sellToken` in the `taker` address expected: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The balance of the `sellToken` required for the swap to execute successfully required: - token - actual - expected additionalProperties: false description: Details of balance of the `sellToken` that the `taker` must hold. Null if the `taker` has sufficient balance nullable: true simulationIncomplete: type: boolean description: 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: type: array items: type: string description: 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 required: - allowance - balance - simulationIncomplete - invalidSourcesPassed additionalProperties: false description: An object containing potential issues discovered during 0x validation that can prevent the swap from being executed successfully by the `taker` liquidityAvailable: type: boolean enum: - true description: This validates the availability of liquidity for the quote requested. The rest of the fields will only be returned if `true` minBuyAmount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: 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: type: string enum: - exact-in route: type: object properties: fills: type: array items: type: object properties: from: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the input token to: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the output token source: type: string description: The liquidity source used in the route proportionBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The proportion of the trade to be filled by the `source` required: - from - to - source - proportionBps additionalProperties: false description: Details of each segment that 0x routes the swap through tokens: type: array items: type: object properties: address: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The token address. This is the unique identifier of the token symbol: type: string description: The token symbol. This is not guaranteed to be unique, as multiple tokens can have the same symbol required: - address - symbol additionalProperties: false description: Properties of the tokens involved in the swap description: Properties of the tokens involved in the swap required: - fills - tokens additionalProperties: false description: The path of liquidity sources to be used in executing this swap sellAmount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of `sellToken` (in `sellToken` units) that will be sold in this swap sellToken: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the token to sell in the swap tokenMetadata: type: object properties: buyToken: type: object properties: buyTaxBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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 required: - buyTaxBps - sellTaxBps - transferTaxBps additionalProperties: false description: Swap-related metadata for the buy token sellToken: type: object properties: buyTaxBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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 required: - buyTaxBps - sellTaxBps - transferTaxBps additionalProperties: false description: Swap-related metadata for the sell token required: - buyToken - sellToken additionalProperties: false description: Swap-related metadata for the buy and sell token in the swap totalNetworkFee: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: type: string description: The unique ZeroEx identifier of the request transaction: type: object properties: to: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: 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: type: string description: The calldata containing transaction execution details to be sent to the `to` address gas: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: The estimated gas limit that should be used to send the transaction to guarantee settlement gasPrice: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The gas price (in wei) that should be used to send the transaction value: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of ether (in wei) that should be sent with the transaction required: - to - data - gas - gasPrice - value additionalProperties: false description: This object contains the details required to submit the transaction required: - allowanceTarget - blockNumber - buyAmount - buyToken - fees - issues - liquidityAvailable - minBuyAmount - mode - route - sellAmount - sellToken - tokenMetadata - totalNetworkFee - zid - transaction additionalProperties: false - type: object properties: allowanceTarget: type: string pattern: ^0x[a-fA-F0-9]{40}$ nullable: true description: The target contract address for which the `taker` needs to have an allowance in order to be able to complete the swap. blockNumber: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The block number at which the liquidity sources were sampled to generate the quote. This indicates the freshness of the quote buyAmount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The exact amount of `buyToken` (in `buyToken` units) requested for the swap buyToken: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the token to buy in the swap estimatedNetSellAmount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The estimated net amount of `sellToken` spent after any exact-out refund route executes fees: type: object properties: integratorFee: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the integrator fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the integrator fee type: type: string enum: - volume required: - amount - token - type additionalProperties: false nullable: true description: The specified fee to charge and deliver to the `swapFeeRecipient`. integratorFees: type: array items: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the integrator fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the integrator fee type: type: string enum: - volume required: - amount - token - type additionalProperties: false nullable: true description: The specified fees to charge and deliver to the `swapFeesRecipient`. zeroExFee: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the 0x fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the 0x fee type: type: string enum: - volume required: - amount - token - type additionalProperties: false nullable: true description: The fee charged by 0x for the trade. required: - integratorFee - integratorFees - zeroExFee additionalProperties: false description: Fees to be deducted in this transaction. issues: type: object properties: allowance: type: object properties: actual: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The `taker`'s current allowance of the `spender` spender: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address to set the allowance on required: - actual - spender additionalProperties: false description: Details of allowances that the `taker` must set for in order to execute the swap successfully. Null if no allowance is required nullable: true balance: type: object properties: token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the `sellToken` actual: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The current balance of the `sellToken` in the `taker` address expected: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The balance of the `sellToken` required for the swap to execute successfully required: - token - actual - expected additionalProperties: false description: Details of balance of the `sellToken` that the `taker` must hold. Null if the `taker` has sufficient balance nullable: true simulationIncomplete: type: boolean description: 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: type: array items: type: string description: 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 required: - allowance - balance - simulationIncomplete - invalidSourcesPassed additionalProperties: false description: An object containing potential issues discovered during 0x validation that can prevent the swap from being executed successfully by the `taker` liquidityAvailable: type: boolean enum: - true description: This validates the availability of liquidity for the quote requested. The rest of the fields will only be returned if `true` mode: type: string enum: - exact-out routes: type: object properties: forward: type: object properties: fills: type: array items: type: object properties: from: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the input token to: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the output token source: type: string description: The liquidity source used in the route proportionBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The proportion of the trade to be filled by the `source` required: - from - to - source - proportionBps additionalProperties: false description: Details of each segment that 0x routes the swap through tokens: type: array items: type: object properties: address: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The token address. This is the unique identifier of the token symbol: type: string description: The token symbol. This is not guaranteed to be unique, as multiple tokens can have the same symbol required: - address - symbol additionalProperties: false description: Properties of the tokens involved in the swap description: Properties of the tokens involved in the swap required: - fills - tokens additionalProperties: false description: The forward route used to acquire at least the requested buy amount refund: type: object properties: fills: type: array items: type: object properties: from: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the input token to: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the output token source: type: string description: The liquidity source used in the route proportionBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The proportion of the trade to be filled by the `source` required: - from - to - source - proportionBps additionalProperties: false description: Details of each segment that 0x routes the swap through tokens: type: array items: type: object properties: address: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The token address. This is the unique identifier of the token symbol: type: string description: The token symbol. This is not guaranteed to be unique, as multiple tokens can have the same symbol required: - address - symbol additionalProperties: false description: Properties of the tokens involved in the swap description: Properties of the tokens involved in the swap required: - fills - tokens additionalProperties: false description: The refund route used to convert buy-token surplus back to the sell token required: - forward - refund additionalProperties: false description: The exact-out forward and refund routes maxSellAmount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The maximum amount of `sellToken` that may be spent by the exact-out swap sellToken: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the token to sell in the swap tokenMetadata: type: object properties: buyToken: type: object properties: buyTaxBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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 required: - buyTaxBps - sellTaxBps - transferTaxBps additionalProperties: false description: Swap-related metadata for the buy token sellToken: type: object properties: buyTaxBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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 required: - buyTaxBps - sellTaxBps - transferTaxBps additionalProperties: false description: Swap-related metadata for the sell token required: - buyToken - sellToken additionalProperties: false description: Swap-related metadata for the buy and sell token in the swap totalNetworkFee: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: type: string description: The unique ZeroEx identifier of the request transaction: type: object properties: to: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: 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: type: string description: The calldata containing transaction execution details to be sent to the `to` address gas: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: The estimated gas limit that should be used to send the transaction to guarantee settlement gasPrice: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The gas price (in wei) that should be used to send the transaction value: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of ether (in wei) that should be sent with the transaction required: - to - data - gas - gasPrice - value additionalProperties: false description: This object contains the details required to submit the transaction required: - allowanceTarget - blockNumber - buyAmount - buyToken - estimatedNetSellAmount - fees - issues - liquidityAvailable - mode - routes - maxSellAmount - sellToken - tokenMetadata - totalNetworkFee - zid - transaction additionalProperties: false - type: object properties: liquidityAvailable: type: boolean enum: - false description: This validates the availability of liquidity for the quote requested. No other fields will be returned if it is `false` zid: type: string description: The unique ZeroEx identifier of the request required: - liquidityAvailable - zid additionalProperties: false example: allowanceTarget: '0x000000000022d473030f116ddee9f6b43ac78ba3' blockNumber: '20114692' buyAmount: '100037537' buyToken: '0xdac17f958d2ee523a2206206994597c13d831ec7' fees: integratorFee: null zeroExFee: null gasFee: null issues: allowance: actual: '0' spender: '0x0000000000001ff3684f28c67538d4d072c22734' balance: token: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' actual: '0' expected: '100000000' simulationIncomplete: false invalidSourcesPassed: [] liquidityAvailable: true mode: exact-in minBuyAmount: '99037162' route: fills: - from: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' to: '0xdac17f958d2ee523a2206206994597c13d831ec7' source: SolidlyV3 proportionBps: '10000' tokens: - address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' symbol: USDC - address: '0xdac17f958d2ee523a2206206994597c13d831ec7' symbol: USDT sellAmount: '100000000' sellToken: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' tokenMetadata: buyToken: buyTaxBps: '0' sellTaxBps: '0' sellToken: buyTaxBps: '0' sellTaxBps: '0' totalNetworkFee: '1393685870940000' transaction: to: '0x7f6cee965959295cc64d0e6c00d99d6532d8e86b' data: '0x1fff991f00000000000000000000000070a9f34f9b34c64957b9c401a97bfed35b95049e000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000005e72fea00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000144c1fb425e0000000000000000000000007f6cee965959295cc64d0e6c00d99d6532d8e86b000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005f5e1000000000000000000000000000000000000006e898131631616b1779bad70bc17000000000000000000000000000000000000000000000000000000006670d06c00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000041ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016438c9c147000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000027100000000000000000000000006146be494fee4c73540cb1c5f87536abf1452500000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000084c31b8d7a0000000000000000000000007f6cee965959295cc64d0e6c00d99d6532d8e86b00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000005f5e10000000000000000000000000000000000000000000000000000000001000276a40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' gas: '288079' gasPrice: '4837860000' value: '0' zid: '0x111111111111111111111111' '400': description: 400 error response content: application/json: schema: anyOf: - $ref: '#/components/schemas/INPUT_INVALID' - $ref: '#/components/schemas/RECIPIENT_NOT_SUPPORTED' - $ref: '#/components/schemas/SWAP_VALIDATION_FAILED' - $ref: '#/components/schemas/TOKEN_NOT_SUPPORTED' - $ref: '#/components/schemas/USER_NOT_AUTHORIZED' '403': description: 403 error response content: application/json: schema: anyOf: - $ref: '#/components/schemas/TAKER_NOT_AUTHORIZED_FOR_TRADE' - $ref: '#/components/schemas/RECIPIENT_NOT_AUTHORIZED_FOR_TRADE' - $ref: '#/components/schemas/XSTOCKS_NOT_AUTHORIZED' '422': description: 422 error response content: application/json: schema: anyOf: - $ref: '#/components/schemas/BUY_TOKEN_NOT_AUTHORIZED_FOR_TRADE' - $ref: '#/components/schemas/SELL_TOKEN_NOT_AUTHORIZED_FOR_TRADE' '500': description: 500 error response content: application/json: schema: anyOf: - $ref: '#/components/schemas/INTERNAL_SERVER_ERROR' - $ref: '#/components/schemas/UNCATEGORIZED' x-microcks-operation: delay: 0 dispatcher: FALLBACK /swap/permit2/price: get: operationId: swap::permit2::getPrice summary: Get Price (Permit2) description: Get the indicative price for a swap using Permit2 to set allowances tags: - Swap parameters: - description: Visit dashboard.0x.org to get your API Key in: header name: 0x-api-key required: true schema: type: string - description: API version in: header name: 0x-version required: true schema: type: string example: v2 - name: chainId in: query required: true schema: type: integer exclusiveMinimum: true minimum: 0 description: Chain ID. See [here](https://docs.0x.org/docs/introduction/supported-chains) for the list of supported chains example: 1 - name: buyToken in: query required: true schema: type: string pattern: ^0x(?!0{40})[a-fA-F0-9]{40}$ description: The contract address of the token to buy example: '0xdac17f958d2ee523a2206206994597c13d831ec7' - name: sellToken in: query required: true schema: type: string pattern: ^0x(?!0{40})[a-fA-F0-9]{40}$ description: The contract address of the token to sell example: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' - name: sellAmount in: query required: false schema: type: string description: The amount of `sellToken` in `sellToken` base units to sell example: '100000000' - name: buyAmount in: query required: false schema: type: string description: The exact amount of `buyToken` in `buyToken` base units to buy - name: taker in: query required: false schema: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address which holds the `sellToken` balance and has the allowance set for the swap example: '0x70a9f34f9b34c64957b9c401a97bfed35b95049e' - name: txOrigin in: query required: false schema: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the external account that started the transaction. This is only needed if `taker` is a smart contract. - name: recipient in: query required: false schema: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address to receive the `buyToken`. If not provided, defaults to the taker address. Not supported for wrap/unwrap operations. - name: swapFeeRecipient in: query required: false schema: type: string pattern: ^\s*0x[a-fA-F0-9]{40}(\s*,\s*0x[a-fA-F0-9]{40})*\s*$ description: The wallet address to receive the specified trading fees (supports single or multiple comma-separated values). You must also specify the `swapFeeBps` in the request to use this feature. When multiple values are provided, must match length of `swapFeeBps`. - name: swapFeeBps in: query required: false schema: type: string pattern: ^\s*\d+(\s*,\s*\d+)*\s*$ description: The amount in Bps of the `swapFeeToken` to charge and deliver to the `swapFeeRecipient` (supports single or multiple comma-separated values). You must also specify the `swapFeeRecipient` in the request to use this feature. For security, this field has a default limit of 1000 Bps. If your application requires a higher value, please reach out to us. - name: swapFeeToken in: query required: false schema: type: string pattern: ^\s*0x(?!0{40})[a-fA-F0-9]{40}(\s*,\s*0x(?!0{40})[a-fA-F0-9]{40})*\s*$ description: The contract address of the token to receive trading fees in (supports single or multiple comma-separated values). Each token must be set to the value of either the `buyToken` or the `sellToken`. If omitted, the fee token will be determined by 0x with preference to stablecoins and highly liquid assets. You must also specify the `swapFeeRecipient` and `swapFeeBps` to charge integrator fees. When multiple values are provided, must match length of `swapFeeBps`. - name: tradeSurplusRecipient in: query required: false schema: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address to receive any trade surplus. If specified, this address will receive trade surplus when applicable. Otherwise, the taker will receive the surplus. This feature is only available to selected integrators on a custom pricing plan. In other cases, the surplus will be collected by 0x. For assistance with a custom plan, please contact support. - name: tradeSurplusMaxBps in: query required: false schema: type: integer minimum: 1 maximum: 10000 description: The maximum trade surplus (positive slippage) that can be collected in Bps of the buy amount. If not provided, defaults to 10000 (100%). Must be used together with `tradeSurplusRecipient`. - name: gasPrice in: query required: false schema: type: string description: The target gas price (in wei) for the swap transaction. If not provided, the default value is based on the 0x gas price oracle - name: slippageBps in: query required: false schema: type: integer minimum: 0 maximum: 10000 description: The maximum acceptable slippage of the `buyToken` in Bps. If this parameter is set to 0, no slippage will be tolerated. If not provided, the default slippage tolerance is 100Bps - name: slippagePpm in: query required: false schema: type: integer minimum: 0 maximum: 1000000 description: The maximum acceptable slippage of the `buyToken` in parts-per-million (PPM). Mutually exclusive with `slippageBps`. e.g. 3000 PPM = 30 BPS = 0.30%. - name: excludedSources in: query required: false schema: type: string description: Liquidity sources e.g. Uniswap_V3, SushiSwap, 0x_RFQ to exclude from the provided quote. See https://api.0x.org/sources?chainId= with the desired chain's ID for a full list of sources. Separate multiple sources with a comma - name: sellEntireBalance in: query required: false schema: type: string enum: - 'true' - 'false' default: 'false' description: If set to `true`, the taker's entire `sellToken` balance will be sold during trade execution. The `sellAmount` should be the maximum estimated value, as close as possible to the actual taker's balance to ensure the best routing. Selling more than the `sellAmount` may cause the trade to revert. This feature is designed for cases where the precise sell amount is determined during execution. Learn more [here](https://docs.0x.org/docs/0x-swap-api/additional-topics/sell-entire-balance). - name: wrapUnwrapMode in: query required: false schema: anyOf: - not: {} - type: string enum: - direct - settler description: Controls how native wrap/unwrap trades are executed. `direct` calls the wrapped-native token contract directly. `settler` routes wrap/unwrap through Settler or Allowance Holder for compatibility. Ignored for non-wrap/unwrap swaps. If omitted, `direct` mode is used. responses: '200': description: Successful response content: application/json: schema: anyOf: - anyOf: - type: object properties: allowanceTarget: type: string pattern: ^0x[a-fA-F0-9]{40}$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The block number at which the liquidity sources were sampled to generate the quote. This indicates the freshness of the quote buyAmount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of `buyToken` (in `buyToken` units) that will be bought in the swap buyToken: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the token to buy in the swap fees: type: object properties: integratorFee: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the integrator fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the integrator fee type: type: string enum: - volume required: - amount - token - type additionalProperties: false nullable: true description: The specified fee to charge and deliver to the `swapFeeRecipient`. integratorFees: type: array items: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the integrator fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the integrator fee type: type: string enum: - volume required: - amount - token - type additionalProperties: false nullable: true description: The specified fees to charge and deliver to the `swapFeesRecipient`. zeroExFee: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the 0x fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the 0x fee type: type: string enum: - volume required: - amount - token - type additionalProperties: false nullable: true description: The fee charged by 0x for the trade. gasFee: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the gas fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the gas fee type: type: string enum: - gas required: - amount - token - type additionalProperties: false nullable: true description: The gas fee to be used in submitting the transaction. required: - integratorFee - integratorFees - zeroExFee - gasFee additionalProperties: false description: Fees to be deducted in this transaction. It contains the `integratorFee`, `zeroExFee` and `gasFee` issues: type: object properties: allowance: type: object properties: actual: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The `taker`'s current allowance of the `spender` spender: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address to set the allowance on required: - actual - spender additionalProperties: false description: Details of allowances that the `taker` must set for in order to execute the swap successfully. Null if no allowance is required nullable: true balance: type: object properties: token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the `sellToken` actual: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The current balance of the `sellToken` in the `taker` address expected: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The balance of the `sellToken` required for the swap to execute successfully required: - token - actual - expected additionalProperties: false description: Details of balance of the `sellToken` that the `taker` must hold. Null if the `taker` has sufficient balance nullable: true simulationIncomplete: type: boolean description: 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: type: array items: type: string description: 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 required: - allowance - balance - simulationIncomplete - invalidSourcesPassed additionalProperties: false description: An object containing potential issues discovered during 0x validation that can prevent the swap from being executed successfully by the `taker` liquidityAvailable: type: boolean enum: - true description: This validates the availability of liquidity for the quote requested. The rest of the fields will only be returned if `true` minBuyAmount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: 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: type: string enum: - exact-in route: type: object properties: fills: type: array items: type: object properties: from: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the input token to: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the output token source: type: string description: The liquidity source used in the route proportionBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The proportion of the trade to be filled by the `source` required: - from - to - source - proportionBps additionalProperties: false description: Details of each segment that 0x routes the swap through tokens: type: array items: type: object properties: address: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The token address. This is the unique identifier of the token symbol: type: string description: The token symbol. This is not guaranteed to be unique, as multiple tokens can have the same symbol required: - address - symbol additionalProperties: false description: Properties of the tokens involved in the swap description: Properties of the tokens involved in the swap required: - fills - tokens additionalProperties: false description: The path of liquidity sources to be used in executing this swap sellAmount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of `sellToken` (in `sellToken` units) that will be sold in this swap sellToken: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the token to sell in the swap tokenMetadata: type: object properties: buyToken: type: object properties: buyTaxBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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 required: - buyTaxBps - sellTaxBps - transferTaxBps additionalProperties: false description: Swap-related metadata for the buy token sellToken: type: object properties: buyTaxBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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 required: - buyTaxBps - sellTaxBps - transferTaxBps additionalProperties: false description: Swap-related metadata for the sell token required: - buyToken - sellToken additionalProperties: false description: Swap-related metadata for the buy and sell token in the swap totalNetworkFee: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: type: string description: The unique ZeroEx identifier of the request gas: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: The estimated gas limit that should be used to send the transaction to guarantee settlement gasPrice: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The gas price (in wei) that should be used to send the transaction. The transaction needs to be sent with this `gasPrice` for the transaction to be successful required: - allowanceTarget - blockNumber - buyAmount - buyToken - fees - issues - liquidityAvailable - minBuyAmount - mode - route - sellAmount - sellToken - tokenMetadata - totalNetworkFee - zid - gas - gasPrice additionalProperties: false - type: object properties: allowanceTarget: type: string pattern: ^0x[a-fA-F0-9]{40}$ nullable: true description: The target contract address for which the `taker` needs to have an allowance in order to be able to complete the swap. blockNumber: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The block number at which the liquidity sources were sampled to generate the quote. This indicates the freshness of the quote buyAmount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The exact amount of `buyToken` (in `buyToken` units) requested for the swap buyToken: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the token to buy in the swap estimatedNetSellAmount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The estimated net amount of `sellToken` spent after any exact-out refund route executes fees: type: object properties: integratorFee: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the integrator fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the integrator fee type: type: string enum: - volume required: - amount - token - type additionalProperties: false nullable: true description: The specified fee to charge and deliver to the `swapFeeRecipient`. integratorFees: type: array items: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the integrator fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the integrator fee type: type: string enum: - volume required: - amount - token - type additionalProperties: false nullable: true description: The specified fees to charge and deliver to the `swapFeesRecipient`. zeroExFee: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the 0x fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the 0x fee type: type: string enum: - volume required: - amount - token - type additionalProperties: false nullable: true description: The fee charged by 0x for the trade. required: - integratorFee - integratorFees - zeroExFee additionalProperties: false description: Fees to be deducted in this transaction. issues: type: object properties: allowance: type: object properties: actual: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The `taker`'s current allowance of the `spender` spender: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address to set the allowance on required: - actual - spender additionalProperties: false description: Details of allowances that the `taker` must set for in order to execute the swap successfully. Null if no allowance is required nullable: true balance: type: object properties: token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the `sellToken` actual: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The current balance of the `sellToken` in the `taker` address expected: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The balance of the `sellToken` required for the swap to execute successfully required: - token - actual - expected additionalProperties: false description: Details of balance of the `sellToken` that the `taker` must hold. Null if the `taker` has sufficient balance nullable: true simulationIncomplete: type: boolean description: 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: type: array items: type: string description: 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 required: - allowance - balance - simulationIncomplete - invalidSourcesPassed additionalProperties: false description: An object containing potential issues discovered during 0x validation that can prevent the swap from being executed successfully by the `taker` liquidityAvailable: type: boolean enum: - true description: This validates the availability of liquidity for the quote requested. The rest of the fields will only be returned if `true` mode: type: string enum: - exact-out routes: type: object properties: forward: type: object properties: fills: type: array items: type: object properties: from: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the input token to: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the output token source: type: string description: The liquidity source used in the route proportionBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The proportion of the trade to be filled by the `source` required: - from - to - source - proportionBps additionalProperties: false description: Details of each segment that 0x routes the swap through tokens: type: array items: type: object properties: address: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The token address. This is the unique identifier of the token symbol: type: string description: The token symbol. This is not guaranteed to be unique, as multiple tokens can have the same symbol required: - address - symbol additionalProperties: false description: Properties of the tokens involved in the swap description: Properties of the tokens involved in the swap required: - fills - tokens additionalProperties: false description: The forward route used to acquire at least the requested buy amount refund: type: object properties: fills: type: array items: type: object properties: from: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the input token to: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the output token source: type: string description: The liquidity source used in the route proportionBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The proportion of the trade to be filled by the `source` required: - from - to - source - proportionBps additionalProperties: false description: Details of each segment that 0x routes the swap through tokens: type: array items: type: object properties: address: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The token address. This is the unique identifier of the token symbol: type: string description: The token symbol. This is not guaranteed to be unique, as multiple tokens can have the same symbol required: - address - symbol additionalProperties: false description: Properties of the tokens involved in the swap description: Properties of the tokens involved in the swap required: - fills - tokens additionalProperties: false description: The refund route used to convert buy-token surplus back to the sell token required: - forward - refund additionalProperties: false description: The exact-out forward and refund routes maxSellAmount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The maximum amount of `sellToken` that may be spent by the exact-out swap sellToken: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the token to sell in the swap tokenMetadata: type: object properties: buyToken: type: object properties: buyTaxBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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 required: - buyTaxBps - sellTaxBps - transferTaxBps additionalProperties: false description: Swap-related metadata for the buy token sellToken: type: object properties: buyTaxBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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 required: - buyTaxBps - sellTaxBps - transferTaxBps additionalProperties: false description: Swap-related metadata for the sell token required: - buyToken - sellToken additionalProperties: false description: Swap-related metadata for the buy and sell token in the swap totalNetworkFee: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: type: string description: The unique ZeroEx identifier of the request gas: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: The estimated gas limit that should be used to send the transaction to guarantee settlement gasPrice: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The gas price (in wei) that should be used to send the transaction. The transaction needs to be sent with this `gasPrice` for the transaction to be successful required: - allowanceTarget - blockNumber - buyAmount - buyToken - estimatedNetSellAmount - fees - issues - liquidityAvailable - mode - routes - maxSellAmount - sellToken - tokenMetadata - totalNetworkFee - zid - gas - gasPrice additionalProperties: false - type: object properties: liquidityAvailable: type: boolean enum: - false description: This validates the availability of liquidity for the quote requested. No other fields will be returned if it is `false` zid: type: string description: The unique ZeroEx identifier of the request required: - liquidityAvailable - zid additionalProperties: false example: allowanceTarget: '0x000000000022d473030f116ddee9f6b43ac78ba3' blockNumber: '20114676' buyAmount: '100032748' buyToken: '0xdac17f958d2ee523a2206206994597c13d831ec7' fees: integratorFee: null zeroExFee: null gasFee: null gas: '288095' gasPrice: '7062490000' issues: allowance: actual: '0' spender: '0x000000000022d473030f116ddee9f6b43ac78ba3' balance: token: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' actual: '0' expected: '100000000' simulationIncomplete: false invalidSourcesPassed: [] liquidityAvailable: true mode: exact-in minBuyAmount: '99032421' route: fills: - from: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' to: '0xdac17f958d2ee523a2206206994597c13d831ec7' source: SolidlyV3 proportionBps: '10000' tokens: - address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' symbol: USDC - address: '0xdac17f958d2ee523a2206206994597c13d831ec7' symbol: USDT sellAmount: '100000000' sellToken: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' tokenMetadata: buyToken: buyTaxBps: '0' sellTaxBps: '0' sellToken: buyTaxBps: '0' sellTaxBps: '0' totalNetworkFee: '2034668056550000' zid: '0x111111111111111111111111' '400': description: 400 error response content: application/json: schema: anyOf: - $ref: '#/components/schemas/INPUT_INVALID' - $ref: '#/components/schemas/RECIPIENT_NOT_SUPPORTED' - $ref: '#/components/schemas/SWAP_VALIDATION_FAILED' - $ref: '#/components/schemas/TOKEN_NOT_SUPPORTED' - $ref: '#/components/schemas/USER_NOT_AUTHORIZED' '403': description: 403 error response content: application/json: schema: anyOf: - $ref: '#/components/schemas/TAKER_NOT_AUTHORIZED_FOR_TRADE' - $ref: '#/components/schemas/RECIPIENT_NOT_AUTHORIZED_FOR_TRADE' - $ref: '#/components/schemas/XSTOCKS_NOT_AUTHORIZED' '422': description: 422 error response content: application/json: schema: anyOf: - $ref: '#/components/schemas/BUY_TOKEN_NOT_AUTHORIZED_FOR_TRADE' - $ref: '#/components/schemas/SELL_TOKEN_NOT_AUTHORIZED_FOR_TRADE' '500': description: 500 error response content: application/json: schema: anyOf: - $ref: '#/components/schemas/INTERNAL_SERVER_ERROR' - $ref: '#/components/schemas/UNCATEGORIZED' x-microcks-operation: delay: 0 dispatcher: FALLBACK /swap/permit2/quote: get: operationId: swap::permit2::getQuote summary: Get Quote (Permit2) description: Get the firm quote for a swap using Permit2 to set allowances tags: - Swap parameters: - description: Visit dashboard.0x.org to get your API Key in: header name: 0x-api-key required: true schema: type: string - description: API version in: header name: 0x-version required: true schema: type: string example: v2 - name: chainId in: query required: true schema: type: integer exclusiveMinimum: true minimum: 0 description: Chain ID. See [here](https://docs.0x.org/docs/introduction/supported-chains) for the list of supported chains example: 1 - name: buyToken in: query required: true schema: type: string pattern: ^0x(?!0{40})[a-fA-F0-9]{40}$ description: The contract address of the token to buy example: '0xdac17f958d2ee523a2206206994597c13d831ec7' - name: sellToken in: query required: true schema: type: string pattern: ^0x(?!0{40})[a-fA-F0-9]{40}$ description: The contract address of the token to sell example: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' - name: sellAmount in: query required: false schema: type: string description: The amount of `sellToken` in `sellToken` base units to sell example: '100000000' - name: buyAmount in: query required: false schema: type: string description: The exact amount of `buyToken` in `buyToken` base units to buy - name: taker in: query required: true schema: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address which holds the `sellToken` balance and has the allowance set for the swap example: '0x70a9f34f9b34c64957b9c401a97bfed35b95049e' - name: txOrigin in: query required: false schema: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the external account that started the transaction. This is only needed if `taker` is a smart contract. - name: recipient in: query required: false schema: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address to receive the `buyToken`. If not provided, defaults to the taker address. Not supported for wrap/unwrap operations. - name: swapFeeRecipient in: query required: false schema: type: string pattern: ^\s*0x[a-fA-F0-9]{40}(\s*,\s*0x[a-fA-F0-9]{40})*\s*$ description: The wallet address to receive the specified trading fees (supports single or multiple comma-separated values). You must also specify the `swapFeeBps` in the request to use this feature. When multiple values are provided, must match length of `swapFeeBps`. - name: swapFeeBps in: query required: false schema: type: string pattern: ^\s*\d+(\s*,\s*\d+)*\s*$ description: The amount in Bps of the `swapFeeToken` to charge and deliver to the `swapFeeRecipient` (supports single or multiple comma-separated values). You must also specify the `swapFeeRecipient` in the request to use this feature. For security, this field has a default limit of 1000 Bps. If your application requires a higher value, please reach out to us. - name: swapFeeToken in: query required: false schema: type: string pattern: ^\s*0x(?!0{40})[a-fA-F0-9]{40}(\s*,\s*0x(?!0{40})[a-fA-F0-9]{40})*\s*$ description: The contract address of the token to receive trading fees in (supports single or multiple comma-separated values). Each token must be set to the value of either the `buyToken` or the `sellToken`. If omitted, the fee token will be determined by 0x with preference to stablecoins and highly liquid assets. You must also specify the `swapFeeRecipient` and `swapFeeBps` to charge integrator fees. When multiple values are provided, must match length of `swapFeeBps`. - name: tradeSurplusRecipient in: query required: false schema: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address to receive any trade surplus. If specified, this address will receive trade surplus when applicable. Otherwise, the taker will receive the surplus. This feature is only available to selected integrators on a custom pricing plan. In other cases, the surplus will be collected by 0x. For assistance with a custom plan, please contact support. - name: tradeSurplusMaxBps in: query required: false schema: type: integer minimum: 1 maximum: 10000 description: The maximum trade surplus (positive slippage) that can be collected in Bps of the buy amount. If not provided, defaults to 10000 (100%). Must be used together with `tradeSurplusRecipient`. - name: gasPrice in: query required: false schema: type: string description: The target gas price (in wei) for the swap transaction. If not provided, the default value is based on the 0x gas price oracle - name: slippageBps in: query required: false schema: type: integer minimum: 0 maximum: 10000 description: The maximum acceptable slippage of the `buyToken` in Bps. If this parameter is set to 0, no slippage will be tolerated. If not provided, the default slippage tolerance is 100Bps - name: slippagePpm in: query required: false schema: type: integer minimum: 0 maximum: 1000000 description: The maximum acceptable slippage of the `buyToken` in parts-per-million (PPM). Mutually exclusive with `slippageBps`. e.g. 3000 PPM = 30 BPS = 0.30%. - name: excludedSources in: query required: false schema: type: string description: Liquidity sources e.g. Uniswap_V3, SushiSwap, 0x_RFQ to exclude from the provided quote. `See https://api.0x.org/sources?chainId=` with the desired chain's ID for a full list of sources. Separate multiple sources with a comma - name: sellEntireBalance in: query required: false schema: type: string enum: - 'true' - 'false' default: 'false' description: If set to `true`, the taker's entire `sellToken` balance will be sold during trade execution. The `sellAmount` should be the maximum estimated value, as close as possible to the actual taker's balance to ensure the best routing. Selling more than the `sellAmount` may cause the trade to revert. This feature is designed for cases where the precise sell amount is determined during execution. Learn more [here](https://docs.0x.org/docs/0x-swap-api/additional-topics/sell-entire-balance). - name: wrapUnwrapMode in: query required: false schema: anyOf: - not: {} - type: string enum: - direct - settler description: Controls how native wrap/unwrap trades are executed. `direct` calls the wrapped-native token contract directly. `settler` routes wrap/unwrap through Settler or Allowance Holder for compatibility. Ignored for non-wrap/unwrap swaps. If omitted, `direct` mode is used. responses: '200': description: Successful response content: application/json: schema: anyOf: - anyOf: - type: object properties: allowanceTarget: type: string pattern: ^0x[a-fA-F0-9]{40}$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The block number at which the liquidity sources were sampled to generate the quote. This indicates the freshness of the quote buyAmount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of `buyToken` (in `buyToken` units) that will be bought in the swap buyToken: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the token to buy in the swap fees: type: object properties: integratorFee: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the integrator fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the integrator fee type: type: string enum: - volume required: - amount - token - type additionalProperties: false nullable: true description: The specified fee to charge and deliver to the `swapFeeRecipient`. integratorFees: type: array items: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the integrator fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the integrator fee type: type: string enum: - volume required: - amount - token - type additionalProperties: false nullable: true description: The specified fees to charge and deliver to the `swapFeesRecipient`. zeroExFee: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the 0x fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the 0x fee type: type: string enum: - volume required: - amount - token - type additionalProperties: false nullable: true description: The fee charged by 0x for the trade. gasFee: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the gas fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the gas fee type: type: string enum: - gas required: - amount - token - type additionalProperties: false nullable: true description: The gas fee to be used in submitting the transaction. required: - integratorFee - integratorFees - zeroExFee - gasFee additionalProperties: false description: Fees to be deducted in this transaction. It contains the `integratorFee`, `zeroExFee` and `gasFee` issues: type: object properties: allowance: type: object properties: actual: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The `taker`'s current allowance of the `spender` spender: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address to set the allowance on required: - actual - spender additionalProperties: false description: Details of allowances that the `taker` must set for in order to execute the swap successfully. Null if no allowance is required nullable: true balance: type: object properties: token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the `sellToken` actual: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The current balance of the `sellToken` in the `taker` address expected: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The balance of the `sellToken` required for the swap to execute successfully required: - token - actual - expected additionalProperties: false description: Details of balance of the `sellToken` that the `taker` must hold. Null if the `taker` has sufficient balance nullable: true simulationIncomplete: type: boolean description: 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: type: array items: type: string description: 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 required: - allowance - balance - simulationIncomplete - invalidSourcesPassed additionalProperties: false description: An object containing potential issues discovered during 0x validation that can prevent the swap from being executed successfully by the `taker` liquidityAvailable: type: boolean enum: - true description: This validates the availability of liquidity for the quote requested. The rest of the fields will only be returned if `true` minBuyAmount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: 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: type: string enum: - exact-in route: type: object properties: fills: type: array items: type: object properties: from: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the input token to: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the output token source: type: string description: The liquidity source used in the route proportionBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The proportion of the trade to be filled by the `source` required: - from - to - source - proportionBps additionalProperties: false description: Details of each segment that 0x routes the swap through tokens: type: array items: type: object properties: address: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The token address. This is the unique identifier of the token symbol: type: string description: The token symbol. This is not guaranteed to be unique, as multiple tokens can have the same symbol required: - address - symbol additionalProperties: false description: Properties of the tokens involved in the swap description: Properties of the tokens involved in the swap required: - fills - tokens additionalProperties: false description: The path of liquidity sources to be used in executing this swap sellAmount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of `sellToken` (in `sellToken` units) that will be sold in this swap sellToken: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the token to sell in the swap tokenMetadata: type: object properties: buyToken: type: object properties: buyTaxBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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 required: - buyTaxBps - sellTaxBps - transferTaxBps additionalProperties: false description: Swap-related metadata for the buy token sellToken: type: object properties: buyTaxBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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 required: - buyTaxBps - sellTaxBps - transferTaxBps additionalProperties: false description: Swap-related metadata for the sell token required: - buyToken - sellToken additionalProperties: false description: Swap-related metadata for the buy and sell token in the swap totalNetworkFee: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: type: string description: The unique ZeroEx identifier of the request permit2: type: object properties: type: type: string enum: - Permit2 description: '`Permit2`' hash: type: string description: 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: type: object properties: types: type: object additionalProperties: type: array items: type: object properties: name: type: string type: type: string required: - name - type additionalProperties: false domain: type: object properties: name: type: string version: type: string chainId: type: number verifyingContract: type: string salt: type: string additionalProperties: false message: type: object additionalProperties: anyOf: - type: string - type: array items: type: string - type: number - type: array items: type: number - type: boolean - type: array items: type: boolean - {} - type: array items: {} primaryType: type: string required: - types - domain - message - primaryType additionalProperties: false description: Necessary data for [EIP-712](https://eips.ethereum.org/EIPS/eip-712) required: - type - hash - eip712 additionalProperties: false description: 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 nullable: true transaction: type: object properties: to: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: 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: type: string description: The calldata containing transaction execution details to be sent to the `to` address gas: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: The estimated gas limit that should be used to send the transaction to guarantee settlement gasPrice: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The gas price (in wei) that should be used to send the transaction value: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of ether (in wei) that should be sent with the transaction required: - to - data - gas - gasPrice - value additionalProperties: false description: This object contains the details required to submit the transaction required: - allowanceTarget - blockNumber - buyAmount - buyToken - fees - issues - liquidityAvailable - minBuyAmount - mode - route - sellAmount - sellToken - tokenMetadata - totalNetworkFee - zid - permit2 - transaction additionalProperties: false - type: object properties: allowanceTarget: type: string pattern: ^0x[a-fA-F0-9]{40}$ nullable: true description: The target contract address for which the `taker` needs to have an allowance in order to be able to complete the swap. blockNumber: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The block number at which the liquidity sources were sampled to generate the quote. This indicates the freshness of the quote buyAmount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The exact amount of `buyToken` (in `buyToken` units) requested for the swap buyToken: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the token to buy in the swap estimatedNetSellAmount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The estimated net amount of `sellToken` spent after any exact-out refund route executes fees: type: object properties: integratorFee: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the integrator fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the integrator fee type: type: string enum: - volume required: - amount - token - type additionalProperties: false nullable: true description: The specified fee to charge and deliver to the `swapFeeRecipient`. integratorFees: type: array items: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the integrator fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the integrator fee type: type: string enum: - volume required: - amount - token - type additionalProperties: false nullable: true description: The specified fees to charge and deliver to the `swapFeesRecipient`. zeroExFee: type: object properties: amount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of token charged as the 0x fee token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address of the token charged as the 0x fee type: type: string enum: - volume required: - amount - token - type additionalProperties: false nullable: true description: The fee charged by 0x for the trade. required: - integratorFee - integratorFees - zeroExFee additionalProperties: false description: Fees to be deducted in this transaction. issues: type: object properties: allowance: type: object properties: actual: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The `taker`'s current allowance of the `spender` spender: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The address to set the allowance on required: - actual - spender additionalProperties: false description: Details of allowances that the `taker` must set for in order to execute the swap successfully. Null if no allowance is required nullable: true balance: type: object properties: token: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the `sellToken` actual: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The current balance of the `sellToken` in the `taker` address expected: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The balance of the `sellToken` required for the swap to execute successfully required: - token - actual - expected additionalProperties: false description: Details of balance of the `sellToken` that the `taker` must hold. Null if the `taker` has sufficient balance nullable: true simulationIncomplete: type: boolean description: 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: type: array items: type: string description: 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 required: - allowance - balance - simulationIncomplete - invalidSourcesPassed additionalProperties: false description: An object containing potential issues discovered during 0x validation that can prevent the swap from being executed successfully by the `taker` liquidityAvailable: type: boolean enum: - true description: This validates the availability of liquidity for the quote requested. The rest of the fields will only be returned if `true` mode: type: string enum: - exact-out routes: type: object properties: forward: type: object properties: fills: type: array items: type: object properties: from: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the input token to: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the output token source: type: string description: The liquidity source used in the route proportionBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The proportion of the trade to be filled by the `source` required: - from - to - source - proportionBps additionalProperties: false description: Details of each segment that 0x routes the swap through tokens: type: array items: type: object properties: address: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The token address. This is the unique identifier of the token symbol: type: string description: The token symbol. This is not guaranteed to be unique, as multiple tokens can have the same symbol required: - address - symbol additionalProperties: false description: Properties of the tokens involved in the swap description: Properties of the tokens involved in the swap required: - fills - tokens additionalProperties: false description: The forward route used to acquire at least the requested buy amount refund: type: object properties: fills: type: array items: type: object properties: from: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the input token to: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the output token source: type: string description: The liquidity source used in the route proportionBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The proportion of the trade to be filled by the `source` required: - from - to - source - proportionBps additionalProperties: false description: Details of each segment that 0x routes the swap through tokens: type: array items: type: object properties: address: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The token address. This is the unique identifier of the token symbol: type: string description: The token symbol. This is not guaranteed to be unique, as multiple tokens can have the same symbol required: - address - symbol additionalProperties: false description: Properties of the tokens involved in the swap description: Properties of the tokens involved in the swap required: - fills - tokens additionalProperties: false description: The refund route used to convert buy-token surplus back to the sell token required: - forward - refund additionalProperties: false description: The exact-out forward and refund routes maxSellAmount: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The maximum amount of `sellToken` that may be spent by the exact-out swap sellToken: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: The contract address of the token to sell in the swap tokenMetadata: type: object properties: buyToken: type: object properties: buyTaxBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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 required: - buyTaxBps - sellTaxBps - transferTaxBps additionalProperties: false description: Swap-related metadata for the buy token sellToken: type: object properties: buyTaxBps: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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 required: - buyTaxBps - sellTaxBps - transferTaxBps additionalProperties: false description: Swap-related metadata for the sell token required: - buyToken - sellToken additionalProperties: false description: Swap-related metadata for the buy and sell token in the swap totalNetworkFee: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: 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: type: string description: The unique ZeroEx identifier of the request permit2: type: object properties: type: type: string enum: - Permit2 description: '`Permit2`' hash: type: string description: 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: type: object properties: types: type: object additionalProperties: type: array items: type: object properties: name: type: string type: type: string required: - name - type additionalProperties: false domain: type: object properties: name: type: string version: type: string chainId: type: number verifyingContract: type: string salt: type: string additionalProperties: false message: type: object additionalProperties: anyOf: - type: string - type: array items: type: string - type: number - type: array items: type: number - type: boolean - type: array items: type: boolean - {} - type: array items: {} primaryType: type: string required: - types - domain - message - primaryType additionalProperties: false description: Necessary data for [EIP-712](https://eips.ethereum.org/EIPS/eip-712) required: - type - hash - eip712 additionalProperties: false description: 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 nullable: true transaction: type: object properties: to: type: string pattern: ^0x[a-fA-F0-9]{40}$ description: 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: type: string description: The calldata containing transaction execution details to be sent to the `to` address gas: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ nullable: true description: The estimated gas limit that should be used to send the transaction to guarantee settlement gasPrice: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The gas price (in wei) that should be used to send the transaction value: allOf: - {} - type: string pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$ description: The amount of ether (in wei) that should be sent with the transaction required: - to - data - gas - gasPrice - value additionalProperties: false description: This object contains the details required to submit the transaction required: - allowanceTarget - blockNumber - buyAmount - buyToken - estimatedNetSellAmount - fees - issues - liquidityAvailable - mode - routes - maxSellAmount - sellToken - tokenMetadata - totalNetworkFee - zid - permit2 - transaction additionalProperties: false - type: object properties: liquidityAvailable: type: boolean enum: - false description: This validates the availability of liquidity for the quote requested. No other fields will be returned if it is `false` zid: type: string description: The unique ZeroEx identifier of the request required: - liquidityAvailable - zid additionalProperties: false example: allowanceTarget: '0x000000000022d473030f116ddee9f6b43ac78ba3' blockNumber: '20114692' buyAmount: '100037537' buyToken: '0xdac17f958d2ee523a2206206994597c13d831ec7' fees: integratorFee: null zeroExFee: null gasFee: null issues: allowance: actual: '0' spender: '0x000000000022d473030f116ddee9f6b43ac78ba3' balance: token: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' actual: '0' expected: '100000000' simulationIncomplete: false invalidSourcesPassed: [] liquidityAvailable: true mode: exact-in minBuyAmount: '99037162' permit2: type: Permit2 hash: '0xab0c8909f2f8daed2891abb5e93762c65787e0067ef2ab9184bb635ad0f3df51' eip712: types: PermitTransferFrom: - name: permitted type: TokenPermissions - name: spender type: address - name: nonce type: uint256 - name: deadline type: uint256 TokenPermissions: - name: token type: address - name: amount type: uint256 EIP712Domain: - name: name type: string - name: chainId type: uint256 - name: verifyingContract type: address domain: name: Permit2 chainId: 1 verifyingContract: '0x000000000022d473030f116ddee9f6b43ac78ba3' message: permitted: token: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' amount: '100000000' spender: '0x7f6cee965959295cc64d0e6c00d99d6532d8e86b' nonce: '2241959297937691820908574931991575' deadline: '1718669420' primaryType: PermitTransferFrom route: fills: - from: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' to: '0xdac17f958d2ee523a2206206994597c13d831ec7' source: SolidlyV3 proportionBps: '10000' tokens: - address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' symbol: USDC - address: '0xdac17f958d2ee523a2206206994597c13d831ec7' symbol: USDT sellAmount: '100000000' sellToken: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' tokenMetadata: buyToken: buyTaxBps: '0' sellTaxBps: '0' sellToken: buyTaxBps: '0' sellTaxBps: '0' totalNetworkFee: '1393685870940000' transaction: to: '0x7f6cee965959295cc64d0e6c00d99d6532d8e86b' data: '0x1fff991f00000000000000000000000070a9f34f9b34c64957b9c401a97bfed35b95049e000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000005e72fea00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000144c1fb425e0000000000000000000000007f6cee965959295cc64d0e6c00d99d6532d8e86b000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005f5e1000000000000000000000000000000000000006e898131631616b1779bad70bc17000000000000000000000000000000000000000000000000000000006670d06c00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000041ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016438c9c147000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000027100000000000000000000000006146be494fee4c73540cb1c5f87536abf1452500000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000084c31b8d7a0000000000000000000000007f6cee965959295cc64d0e6c00d99d6532d8e86b00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000005f5e10000000000000000000000000000000000000000000000000000000001000276a40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' gas: '288079' gasPrice: '4837860000' value: '0' zid: '0x111111111111111111111111' '400': description: 400 error response content: application/json: schema: anyOf: - $ref: '#/components/schemas/INPUT_INVALID' - $ref: '#/components/schemas/RECIPIENT_NOT_SUPPORTED' - $ref: '#/components/schemas/SWAP_VALIDATION_FAILED' - $ref: '#/components/schemas/TOKEN_NOT_SUPPORTED' - $ref: '#/components/schemas/USER_NOT_AUTHORIZED' '403': description: 403 error response content: application/json: schema: anyOf: - $ref: '#/components/schemas/TAKER_NOT_AUTHORIZED_FOR_TRADE' - $ref: '#/components/schemas/RECIPIENT_NOT_AUTHORIZED_FOR_TRADE' - $ref: '#/components/schemas/XSTOCKS_NOT_AUTHORIZED' '422': description: 422 error response content: application/json: schema: anyOf: - $ref: '#/components/schemas/BUY_TOKEN_NOT_AUTHORIZED_FOR_TRADE' - $ref: '#/components/schemas/SELL_TOKEN_NOT_AUTHORIZED_FOR_TRADE' '500': description: 500 error response content: application/json: schema: anyOf: - $ref: '#/components/schemas/INTERNAL_SERVER_ERROR' - $ref: '#/components/schemas/UNCATEGORIZED' x-microcks-operation: delay: 0 dispatcher: FALLBACK /swap/chains: get: operationId: swap::chains summary: Get Supported Chains description: Get list of supported chains for swap tags: - Swap parameters: - description: Visit dashboard.0x.org to get your API Key in: header name: 0x-api-key required: true schema: type: string - description: API version in: header name: 0x-version required: true schema: type: string example: v2 responses: '200': description: Successful response content: application/json: schema: type: object properties: chains: type: array items: type: object properties: chainId: type: number chainName: type: string required: - chainId - chainName additionalProperties: false zid: type: string description: The unique ZeroEx identifier of the request required: - chains - zid additionalProperties: false example: - chainName: Ethereum chainId: '1' - chainName: Optimism chainId: '10' - chainName: BSC chainId: '56' - chainName: Polygon chainId: '137' - chainName: Base chainId: '8453' - chainName: Arbitrum chainId: '42161' - chainName: Avalanche chainId: '43114' - chainName: Linea chainId: '59144' - chainName: Scroll chainId: '534352' - chainName: Mantle chainId: '5000' - chainName: Blast chainId: '81457' - chainName: Mode chainId: '34443' '500': description: 500 error response content: application/json: schema: anyOf: - $ref: '#/components/schemas/INTERNAL_SERVER_ERROR' - $ref: '#/components/schemas/UNCATEGORIZED' x-microcks-operation: delay: 0 dispatcher: FALLBACK components: schemas: SELL_TOKEN_NOT_AUTHORIZED_FOR_TRADE: type: object properties: name: type: string enum: - SELL_TOKEN_NOT_AUTHORIZED_FOR_TRADE message: type: string data: type: object properties: zid: type: string description: The unique ZeroEx identifier of the request required: - zid additionalProperties: false required: - name - message - data additionalProperties: false UNCATEGORIZED: type: object properties: name: type: string enum: - UNCATEGORIZED message: type: string data: type: object properties: zid: type: string description: The unique ZeroEx identifier of the request required: - zid additionalProperties: false required: - name - message - data additionalProperties: false BUY_TOKEN_NOT_AUTHORIZED_FOR_TRADE: type: object properties: name: type: string enum: - BUY_TOKEN_NOT_AUTHORIZED_FOR_TRADE message: type: string data: type: object properties: zid: type: string description: The unique ZeroEx identifier of the request required: - zid additionalProperties: false required: - name - message - data additionalProperties: false RECIPIENT_NOT_AUTHORIZED_FOR_TRADE: type: object properties: name: type: string enum: - RECIPIENT_NOT_AUTHORIZED_FOR_TRADE message: type: string data: type: object properties: zid: type: string description: The unique ZeroEx identifier of the request required: - zid additionalProperties: false required: - name - message - data additionalProperties: false XSTOCKS_NOT_AUTHORIZED: type: object properties: name: type: string enum: - XSTOCKS_NOT_AUTHORIZED message: type: string data: type: object properties: zid: type: string description: The unique ZeroEx identifier of the request required: - zid additionalProperties: false required: - name - message - data additionalProperties: false SWAP_VALIDATION_FAILED: type: object properties: name: type: string enum: - SWAP_VALIDATION_FAILED message: type: string data: type: object properties: zid: type: string description: The unique ZeroEx identifier of the request required: - zid additionalProperties: false required: - name - message - data additionalProperties: false TOKEN_NOT_SUPPORTED: type: object properties: name: type: string enum: - TOKEN_NOT_SUPPORTED message: type: string data: type: object properties: zid: type: string description: The unique ZeroEx identifier of the request required: - zid additionalProperties: false required: - name - message - data additionalProperties: false INPUT_INVALID: type: object properties: name: type: string enum: - INPUT_INVALID message: type: string data: type: object properties: zid: type: string description: The unique ZeroEx identifier of the request details: type: array items: type: object properties: field: type: string description: The input field name reason: type: string description: The validation failure reason required: - field - reason additionalProperties: false description: The list of invalid inputs required: - zid - details additionalProperties: false required: - name - message - data additionalProperties: false USER_NOT_AUTHORIZED: type: object properties: name: type: string enum: - USER_NOT_AUTHORIZED message: type: string data: type: object properties: zid: type: string description: The unique ZeroEx identifier of the request required: - zid additionalProperties: false required: - name - message - data additionalProperties: false TAKER_NOT_AUTHORIZED_FOR_TRADE: type: object properties: name: type: string enum: - TAKER_NOT_AUTHORIZED_FOR_TRADE message: type: string data: type: object properties: zid: type: string description: The unique ZeroEx identifier of the request required: - zid additionalProperties: false required: - name - message - data additionalProperties: false RECIPIENT_NOT_SUPPORTED: type: object properties: name: type: string enum: - RECIPIENT_NOT_SUPPORTED message: type: string data: type: object properties: zid: type: string description: The unique ZeroEx identifier of the request required: - zid additionalProperties: false required: - name - message - data additionalProperties: false INTERNAL_SERVER_ERROR: type: object properties: name: type: string enum: - INTERNAL_SERVER_ERROR message: type: string data: type: object properties: zid: type: string description: The unique ZeroEx identifier of the request required: - zid additionalProperties: false required: - name - message - data additionalProperties: false securitySchemes: ApiKeyAuth: type: apiKey in: header name: 0x-api-key