Skip to main content
POST
TypeScript

Autorizaciones

Authorization
string
header
requerido

An Account API key, an App API key, an account access token, an account-scoped user token, or a user OAuth token. Prepend the key or token with Bearer, for example Bearer ***************************. See Auth & API keys for how to get each one.

Scopes

payout:transfer_funds

Encabezados

Idempotency-Key
string

A unique key that makes this request safe to retry. See Idempotent requests.

Maximum string length: 255
Ejemplo:

"d9105228-4a08-46b1-8b91-42fed586d383"

Cuerpo

application/json
amount
string
requerido

Source token amount.

Ejemplo:

"100"

from_token
string
requerido

Source token contract address or ticker symbol, such as "USDT".

Ejemplo:

"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

to_token
string
requerido

Destination token contract address or ticker symbol, such as "XAUT".

Ejemplo:

"0x1b64b9025eebb9a6239575df9ea4b9ac46d4d193"

account_id
string

Fiat pairs only: business account to quote the swap for, prefixed biz_. Requires a credential with payout:transfer_funds on that account. Provide this, user_id, or neither for a public quote.

from_address
string | null

Source wallet address used for the quote.

Ejemplo:

"0x6f1c0a3d5b2e4f8a9c7d1e0b3a5f7c9d2e4b6a80"

from_chain

Source chain name or chain ID. Defaults to the source token's chain when omitted.

Ejemplo:

"plasma"

metadata
object

Metadata to include with the quote response.

Ejemplo:
slippage_bps
integer | null

Maximum slippage tolerance in basis points.

Ejemplo:

50

to_address
string | null

Destination wallet address used for the quote.

Ejemplo:

"0x9d2e4b6a806f1c0a3d5b2e4f8a9c7d1e0b3a5f7c"

to_chain

Destination chain name or chain ID. Defaults to the destination token's chain when omitted.

Ejemplo:

"plasma"

user_id
string

Fiat pairs only: the caller's own user ID, prefixed user_, to quote the swap for their personal account. Provide this or account_id.

Respuesta

swap quote created

amount_in
string
requerido

Source token amount used for the quote.

Ejemplo:

"100"

amount_out
string
requerido

Estimated destination token amount.

Ejemplo:

"0.15"

fee_bps
integer
requerido

Whop fee in basis points.

Ejemplo:

100

from_token
object
requerido

Resolved source token details.

Ejemplo:
metadata
object
requerido

Metadata from the request.

Ejemplo:
object
enum<string>
requerido
Opciones disponibles:
swap_quote
Ejemplo:

"swap_quote"

rate
string
requerido

Quoted exchange rate.

Ejemplo:

"1.5"

to_token
object
requerido

Resolved destination token details.

Ejemplo:
amount_out_min
string

Minimum destination amount after slippage.

Ejemplo:

"0.148"

bridge_fee
string | null

Estimated bridge fee for cross-chain swaps.

Ejemplo:

"0.25"

estimated_duration_seconds
integer | null

Estimated time for the swap to complete.

Ejemplo:

30

from_address
string | null

Source wallet address used for the quote.

Ejemplo:

"0x6f1c0a3d5b2e4f8a9c7d1e0b3a5f7c9d2e4b6a80"

requires_token_approval
boolean | null

Whether the source token needs approval before swapping.

Ejemplo:

true

to_address
string | null

Destination wallet address used for the quote.

Ejemplo:

"0x9d2e4b6a806f1c0a3d5b2e4f8a9c7d1e0b3a5f7c"