{"openapi":"3.0.3","info":{"title":"0x-API","version":"latest","description":"This is the documentation for the beta version of the new 0x Swap API. Please feel free to reach out to us if you have any questions or feedback."},"servers":[{"url":"http://api.0x.org"}],"paths":{"/swap/permit2/price":{"get":{"operationId":"swap::permit2::getPrice","summary":"getPrice","description":"Get the price for a swap","parameters":[{"name":"chainId","in":"query","required":true,"schema":{"type":"integer","exclusiveMinimum":true,"minimum":0},"description":"Chain ID"},{"name":"buyToken","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"The contract address of the token to buy"},{"name":"sellToken","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"The contract address of the token to sell"},{"name":"sellAmount","in":"query","required":true,"schema":{"type":"string"},"description":"The amount of `sellToken` in `sellToken` base units to sell"},{"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"},{"name":"swapFeeRecipient","in":"query","required":false,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"The wallet address to receive the specified trading fees. You must also specify the `swapFeeToken` and `swapFeeBps` in the request to use this feature. Learn more about setting up a trading fee/commission in the FAQs"},{"name":"swapFeeBps","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":10000},"description":"The amount in Bps of the `swapFeeToken` to charge and deliver to the `swapFeeRecipient`. You must also specify the `swapFeeRecipient` and `swapFeeToken` in the request to use this feature"},{"name":"swapFeeToken","in":"query","required":false,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"The contract address of the token to receive trading fees in. This must be set to either the `buyToken` or the `sellToken`. You must also specify the `swapFeeRecipient` and `swapFeeBps` in the request to use this feature"},{"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"},{"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,"default":100},"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":"excludedSources","in":"query","required":false,"schema":{"type":"string","default":"Liquidity sources (Uniswap, SushiSwap, 0x, Curve, etc) to be excluded in the provided quote. See https://api.0x.org/sources for a full list of sources."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"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 \"ETH\" as sellToken, wrapping \"ETH\" to \"WETH\" or unwrapping \"WETH\" to \"ETH\" no allowance is needed, a null address of 0x0000000000000000000000000000000000000000 is returned instead"},"blockNumber":{"description":"The block number at which the liquidity sources were sampled to generate the quote. This indicates the freshness of the quote."},"buyAmount":{"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":{},"token":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"type":{"type":"string","enum":["volume","gas"]}},"required":["amount","token","type"],"additionalProperties":false,"nullable":true,"description":"The specified fee to charge and deliver to the `swapFeeRecipient`."},"zeroExFee":{"type":"object","properties":{"amount":{},"token":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"type":{"type":"string","enum":["volume","gas"]}},"required":["amount","token","type"],"additionalProperties":false,"nullable":true,"description":"The fee charged by 0x for the trade."},"gasFee":{"type":"object","properties":{"amount":{},"token":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"type":{"type":"string","enum":["volume","gas"]}},"required":["amount","token","type"],"additionalProperties":false,"nullable":true,"description":"The gas fee to be used in submitting the transaction."}},"required":["integratorFee","zeroExFee","gasFee"],"additionalProperties":false,"description":"Fees to be deducted in this transaction. It contains the `integratorFee`, `zeroExFee` and `gasFee`"},"gas":{"nullable":true,"description":"The estimated gas limit that should be used to send the transaction to guarantee settlement"},"gasPrice":{"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"},"issues":{"type":"object","properties":{"allowance":{"anyOf":[{"enum":["null"],"nullable":true},{"type":"object","properties":{"actual":{"description":"The `taker`'s current allowance for the `allowanceTarget`"},"spender":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"The address to set the allowance on. This is the same as the `allowanceTarget`"}},"required":["actual","spender"],"additionalProperties":false}],"description":"The contract address that the `taker` must have an allowance set for in order to execute the swap successfully"},"balance":{"anyOf":[{"enum":["null"],"nullable":true},{"type":"object","properties":{"token":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"The contract address of the `sellToken`"},"actual":{"description":"The current balance of the `sellToken` in the `taker` address"},"expected":{"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"},"swapUnvalidated":{"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"},"invalidSources":{"type":"array","items":{"type":"string"}}},"required":["allowance","balance","swapUnvalidated","invalidSources"],"additionalProperties":false,"description":"An object containing potential issues 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":{"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"},"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":{"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":{"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"},"totalNetworkFee":{"nullable":true,"description":"The estimated total network cost of the swap. On chains where they 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"}},"required":["allowanceTarget","blockNumber","buyAmount","buyToken","fees","gas","gasPrice","issues","liquidityAvailable","minBuyAmount","route","sellAmount","sellToken","totalNetworkFee"],"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`"}},"required":["liquidityAvailable"],"additionalProperties":false}]}}}},"400":{"description":"400 error response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/INPUT_INVALID"}]}}}},"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"}]}}}}},"tags":["Swap API"]}},"/swap/permit2/quote":{"get":{"operationId":"swap::permit2::getQuote","summary":"getQuote","description":"Get a quote for a swap","parameters":[{"name":"chainId","in":"query","required":true,"schema":{"type":"integer","exclusiveMinimum":true,"minimum":0},"description":"Chain ID"},{"name":"buyToken","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"The contract address of the token to buy"},{"name":"sellToken","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"The contract address of the token to sell"},{"name":"sellAmount","in":"query","required":true,"schema":{"type":"string"},"description":"The amount of `sellToken` in `sellToken` base units to sell"},{"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"},{"name":"swapFeeRecipient","in":"query","required":false,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"The wallet address to receive the specified trading fees. You must also specify the `swapFeeToken` and `swapFeeBps` in the request to use this feature. Learn more about setting up a trading fee/commission in the FAQs"},{"name":"swapFeeBps","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":10000},"description":"The amount in Bps of the `swapFeeToken` to charge and deliver to the `swapFeeRecipient`. You must also specify the `swapFeeRecipient` and `swapFeeToken` in the request to use this feature"},{"name":"swapFeeToken","in":"query","required":false,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"The contract address of the token to receive trading fees in. This must be set to either the `buyToken` or the `sellToken`. You must also specify the `swapFeeRecipient` and `swapFeeBps` in the request to use this feature"},{"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"},{"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,"default":100},"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":"excludedSources","in":"query","required":false,"schema":{"type":"string","default":"Liquidity sources (Uniswap, SushiSwap, 0x, Curve, etc) to be excluded in the provided quote. See https://api.0x.org/sources for a full list of sources."}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"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 \"ETH\" as sellToken, wrapping \"ETH\" to \"WETH\" or unwrapping \"WETH\" to \"ETH\" no allowance is needed, a null address of 0x0000000000000000000000000000000000000000 is returned instead"},"blockNumber":{"description":"The block number at which the liquidity sources were sampled to generate the quote. This indicates the freshness of the quote."},"buyAmount":{"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":{},"token":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"type":{"type":"string","enum":["volume","gas"]}},"required":["amount","token","type"],"additionalProperties":false,"nullable":true,"description":"The specified fee to charge and deliver to the `swapFeeRecipient`."},"zeroExFee":{"type":"object","properties":{"amount":{},"token":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"type":{"type":"string","enum":["volume","gas"]}},"required":["amount","token","type"],"additionalProperties":false,"nullable":true,"description":"The fee charged by 0x for the trade."},"gasFee":{"type":"object","properties":{"amount":{},"token":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"type":{"type":"string","enum":["volume","gas"]}},"required":["amount","token","type"],"additionalProperties":false,"nullable":true,"description":"The gas fee to be used in submitting the transaction."}},"required":["integratorFee","zeroExFee","gasFee"],"additionalProperties":false},"issues":{"type":"object","properties":{"allowance":{"anyOf":[{"enum":["null"],"nullable":true},{"type":"object","properties":{"actual":{"description":"The `taker`'s current allowance for the `allowanceTarget`"},"spender":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"The address to set the allowance on. This is the same as the `allowanceTarget`"}},"required":["actual","spender"],"additionalProperties":false}],"description":"The contract address that the `taker` must have an allowance set for in order to execute the swap successfully"},"balance":{"anyOf":[{"enum":["null"],"nullable":true},{"type":"object","properties":{"token":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"The contract address of the `sellToken`"},"actual":{"description":"The current balance of the `sellToken` in the `taker` address"},"expected":{"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"},"swapUnvalidated":{"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"},"invalidSources":{"type":"array","items":{"type":"string"}}},"required":["allowance","balance","swapUnvalidated","invalidSources"],"additionalProperties":false,"description":"An object containing potential issues 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":{"description":"The price which must be met or else the transaction will revert. This price is influenced by the `slippageBps` parameter. On-chain sources may encounter price movements from quote to settlement"},"permit2":{"type":"object","properties":{"type":{"type":"string","enum":["Permit2"],"description":"`Permit2`"},"hash":{"type":"string","description":"The hash for the approval according to EIP-712. Note that 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":"integer","exclusiveMinimum":true,"minimum":0},"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"}},"required":["type","hash","eip712"],"additionalProperties":false,"description":"This is the approval object which contains the necessary fields to submit an approval for this transaction"},"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":{"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":{"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"},"totalNetworkFee":{"nullable":true,"description":"The estimated total network cost of the swap. On chains where they 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"},"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"},"data":{"type":"string","description":"The calldata containing transaction execution details to be sent to the `to` address"},"gas":{"nullable":true,"description":"The estimated gas limit that should be used to send the transaction to guarantee settlement"},"gasPrice":{"description":"The gas price (in wei) that should be used to send the transaction"},"value":{"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","permit2","route","sellAmount","sellToken","totalNetworkFee","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`"}},"required":["liquidityAvailable"],"additionalProperties":false}]}}}},"400":{"description":"400 error response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/INPUT_INVALID"}]}}}},"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"}]}}}}},"tags":["Swap API"]}}},"components":{"securitySchemes":{"Authorization":{"type":"apiKey","in":"header","name":"0x-api-key"}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"issues":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"additionalProperties":false}}},"required":["message","code"],"additionalProperties":false}}}}},"schemas":{"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":{},"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":{"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":["details"],"additionalProperties":false}},"required":["name","message","data"],"additionalProperties":false},"INSUFFICIENT_BALANCE_OR_ALLOWANCE":{"type":"object","properties":{"name":{"type":"string","enum":["INSUFFICIENT_BALANCE_OR_ALLOWANCE"]},"message":{"type":"string"},"data":{"type":"object","properties":{"metaTransactionHash":{"type":"string","description":"The hash of the meta-transaction provided by the caller"},"taker":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"The intended signer of the meta-transaction"},"sellToken":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"The sell token"},"sellAmount":{"description":"The sell amount"},"minBalanceOrAllowance":{"description":"The smaller value of the balance or the allowance of the taker"}},"required":["metaTransactionHash","taker","sellToken","sellAmount","minBalanceOrAllowance"],"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":{},"additionalProperties":false}},"required":["name","message","data"],"additionalProperties":false},"INVALID_SIGNATURE":{"type":"object","properties":{"name":{"type":"string","enum":["INVALID_SIGNATURE"]},"message":{"type":"string"},"data":{"type":"object","properties":{"metaTransactionHash":{"type":"string","description":"The hash of the meta-transaction provided by the caller"},"taker":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"The intended signer of the meta-transaction"}},"required":["metaTransactionHash","taker"],"additionalProperties":false}},"required":["name","message","data"],"additionalProperties":false},"INVALID_SIGNER":{"type":"object","properties":{"name":{"type":"string","enum":["INVALID_SIGNER"]},"message":{"type":"string"},"data":{"type":"object","properties":{"metaTransactionHash":{"type":"string","description":"The hash of the meta-transaction provided by the caller"},"taker":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"The intended signer of the meta-transaction"},"signer":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"The signer of the meta-transaction"}},"required":["metaTransactionHash","taker","signer"],"additionalProperties":false}},"required":["name","message","data"],"additionalProperties":false},"META_TRANSACTION_EXPIRY_TOO_SOON":{"type":"object","properties":{"name":{"type":"string","enum":["META_TRANSACTION_EXPIRY_TOO_SOON"]},"message":{"type":"string"},"data":{"type":"object","properties":{"metaTransactionHash":{"type":"string","description":"The hash of the meta-transaction provided by the caller"},"expiry":{"description":"The expiry of the meta-transaction provided by the caller in ms"}},"required":["metaTransactionHash","expiry"],"additionalProperties":false}},"required":["name","message","data"],"additionalProperties":false},"META_TRANSACTION_NOT_FOUND":{"type":"object","properties":{"name":{"type":"string","enum":["META_TRANSACTION_NOT_FOUND"]},"message":{"type":"string"},"data":{"type":"object","properties":{"metaTransactionHash":{"type":"string","description":"The hash of the meta-transaction provided by the caller"}},"required":["metaTransactionHash"],"additionalProperties":false}},"required":["name","message","data"],"additionalProperties":false},"META_TRANSACTION_STATUS_NOT_FOUND":{"type":"object","properties":{"name":{"type":"string","enum":["META_TRANSACTION_STATUS_NOT_FOUND"]},"message":{"type":"string"},"data":{"type":"object","properties":{},"additionalProperties":false}},"required":["name","message","data"],"additionalProperties":false},"PENDING_TRADES_ALREADY_EXIST":{"type":"object","properties":{"name":{"type":"string","enum":["PENDING_TRADES_ALREADY_EXIST"]},"message":{"type":"string"},"data":{"type":"object","properties":{"metaTransactionHash":{"type":"string","description":"The hash of the meta-transaction provided by the caller"},"pendingMetaTransactionHashes":{"type":"array","items":{"type":"string"},"description":"The list of pending meta-transaction hashes for the same taker and sell token"}},"required":["metaTransactionHash","pendingMetaTransactionHashes"],"additionalProperties":false}},"required":["name","message","data"],"additionalProperties":false},"SELL_AMOUNT_TOO_SMALL":{"type":"object","properties":{"name":{"type":"string","enum":["SELL_AMOUNT_TOO_SMALL"]},"message":{"type":"string"},"data":{"type":"object","properties":{"minSellAmount":{"description":"The minimum sell amount required for the trade to go through"}},"required":["minSellAmount"],"additionalProperties":false}},"required":["name","message","data"],"additionalProperties":false},"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":{},"additionalProperties":false}},"required":["name","message","data"],"additionalProperties":false},"UNCATEGORIZED":{"type":"object","properties":{"name":{"type":"string","enum":["UNCATEGORIZED"]},"message":{"type":"string"},"data":{"type":"object","properties":{},"additionalProperties":false}},"required":["name","message","data"],"additionalProperties":false}}},"security":[{"Authorization":[]}],"externalDocs":{"description":"Check out our Migration Guide.","url":"https://www.notion.so/zeroex/Swap-API-v1-v2-migration-guide-c0f1a8544f7b4e1f89884de26d880964"},"tags":[{"name":"Swap API"}]}