Skip to main content
POST
/
clients
/
me
/
integrations
/
0x
/
swap
/
quote
Get a swap quote
curl --request POST \
  --url https://api.portalhq.io/api/v3/clients/me/integrations/0x/swap/quote \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "chainId": "<string>",
  "buyToken": "<string>",
  "sellToken": "<string>",
  "sellAmount": "<string>",
  "zeroXApiKey": "<string>",
  "slippageBps": 123,
  "excludedSources": "<string>",
  "swapFeeRecipient": "<string>",
  "swapFeeBps": 123,
  "swapFeeToken": "<string>"
}
'
{
  "data": {
    "rawResponse": {
      "blockNumber": "<string>",
      "buyAmount": "<string>",
      "buyToken": "<string>",
      "fees": {},
      "issues": {},
      "liquidityAvailable": true,
      "minBuyAmount": "<string>",
      "route": {},
      "sellAmount": "<string>",
      "sellToken": "<string>",
      "tokenMetadata": {},
      "totalNetworkFee": "<string>",
      "transaction": {
        "to": "<string>",
        "data": "<string>",
        "gas": "<string>",
        "gasPrice": "<string>",
        "value": "<string>",
        "from": "<string>"
      }
    }
  }
}

Authorizations

Authorization
string
header
required

Client API Key or Client Session Token (CST). Pass as a Bearer token in the Authorization header.

Body

application/json
chainId
string
required

Chain ID in CAIP-2 format (e.g. eip155:1).

buyToken
string
required

Token symbol or address to buy (e.g. USDC).

sellToken
string
required

Token symbol or address to sell (e.g. ETH).

sellAmount
string
required

Amount to sell in the smallest unit (e.g. wei).

zeroXApiKey
string

Optional 0x API key.

slippageBps
number

Maximum acceptable slippage in basis points (e.g. 100 = 1%).

excludedSources
string

Comma-separated list of liquidity sources to exclude.

swapFeeRecipient
string

Address to receive swap fees.

swapFeeBps
number

Swap fee in basis points.

swapFeeToken
string

Token to collect fees in.

Response

Swap quote retrieved successfully

data
object