Skip to main content
POST
TypeScript

Autorisaties

Authorization
string
header
vereist

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

Headers

Idempotency-Key
string

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

Maximum string length: 255
Voorbeeld:

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

Body

application/json
amount
string
vereist

Source token amount.

Voorbeeld:

"100"

from_token
string
vereist

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

Voorbeeld:

"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

to_token
string
vereist

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

Voorbeeld:

"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.

Voorbeeld:

"0x6f1c0a3d5b2e4f8a9c7d1e0b3a5f7c9d2e4b6a80"

from_chain

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

Voorbeeld:

"plasma"

metadata
object

Metadata to include with the quote response.

Voorbeeld:
slippage_bps
integer | null

Maximum slippage tolerance in basis points.

Voorbeeld:

50

to_address
string | null

Destination wallet address used for the quote.

Voorbeeld:

"0x9d2e4b6a806f1c0a3d5b2e4f8a9c7d1e0b3a5f7c"

to_chain

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

Voorbeeld:

"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.

Respons

swap quote created

amount_in
string
vereist

Source token amount used for the quote.

Voorbeeld:

"100"

amount_out
string
vereist

Estimated destination token amount.

Voorbeeld:

"0.15"

fee_bps
integer
vereist

Whop fee in basis points.

Voorbeeld:

100

from_token
object
vereist

Resolved source token details.

Voorbeeld:
metadata
object
vereist

Metadata from the request.

Voorbeeld:
object
enum<string>
vereist
Beschikbare opties:
swap_quote
Voorbeeld:

"swap_quote"

rate
string
vereist

Quoted exchange rate.

Voorbeeld:

"1.5"

to_token
object
vereist

Resolved destination token details.

Voorbeeld:
amount_out_min
string

Minimum destination amount after slippage.

Voorbeeld:

"0.148"

bridge_fee
string | null

Estimated bridge fee for cross-chain swaps.

Voorbeeld:

"0.25"

estimated_duration_seconds
integer | null

Estimated time for the swap to complete.

Voorbeeld:

30

from_address
string | null

Source wallet address used for the quote.

Voorbeeld:

"0x6f1c0a3d5b2e4f8a9c7d1e0b3a5f7c9d2e4b6a80"

requires_token_approval
boolean | null

Whether the source token needs approval before swapping.

Voorbeeld:

true

to_address
string | null

Destination wallet address used for the quote.

Voorbeeld:

"0x9d2e4b6a806f1c0a3d5b2e4f8a9c7d1e0b3a5f7c"