Skip to main content
POST

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

network
enum<string>

Network on which the operation will be performed

Available options:
testnet,
mainnet

Body

application/json

Data required to quote and build the swap

assetIn
string
required

Input asset contract address

Example:

"CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA"

assetOut
string
required

Output asset contract address

Example:

"CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75"

amount
integer<int64>
required

Expected input amount in stroops

Example:

"10000000"

tradeType
enum<string>
required

Type of trade: EXACT_IN = input fixed; EXACT_OUT = output fixed

Available options:
EXACT_IN,
EXACT_OUT
Example:

"EXACT_IN"

protocols
array[]
required

Array of protocols to aggregate liquidity from

Example:
from
string
required

The wallet address (G account or C contract) that will send the funds and sign the transaction

Example:

"GBQJ4HBCQHJQKSKNT3JRKC5VKA3QJUXBVFWIVSMHKPQSJ7XP2IXTCAAK"

parts
number

Number of route splits for optimization. Higher values improve price discovery but increase latency. Max: 1000..

Example:

10

slippageBps
number

Slippage tolerance in basis points (bps). 10000 = 100%, 100 = 1%, 50 = 0.5%. Default is 50 bps (0.5%)

Example:

"50"

maxHops
number

Maximum number of hops to aggregate liquidity from

Example:

2

assetList
string[]

Restricts intermediate tokens to a specific list. Only useful for Soroban transactions (Router and Aggregator). Not useful for SDEX.

Example:
feeBps
number

Ignored. Your fee rate lives in your partner profile (see GET /partner). Kept for wire compatibility; the value you send is recorded so Soroswap can seed your profile.

Example:

50

gaslessTrustline
string

Whether to use gasless trustline swap. Only use this if you are sure that the user does not have a trustline for the output asset and if you have an sponsor account.

Example:

true

to
string

The wallet address that will receive the funds. Defaults to the from address. Must equal from when gaslessTrustline is enabled

referralId
string

Ignored. Fee destinations are no longer caller-supplied; the value you send is recorded so Soroswap can propose your payout address.

sponsor
string

The wallet address that will sponsor the trustline. Only supported for the Gasless Trustline (SDEX) flow

inlinePrerequisites
boolean

When true and a trustline is missing, the response still contains the swap XDR: the trustline transaction is returned in a prerequisites array instead of replacing the swap. Prerequisites must be signed and submitted in order first. For Soroban routes the swap XDR is returned unsimulated (simulated: false) since simulation cannot succeed until the trustline exists β€” re-simulate it (or override sequence and Soroban resources) before submitting

Example:

true

Response

Quote and transaction (or required action) returned successfully

quote
object

The quote for the swap, same schema as the /quote response

xdr
string

Unsigned transaction XDR: the swap when action is SIGN_TRANSACTION, or the transaction that resolves the required action (e.g. a changeTrust for CREATE_TRUSTLINE)

Example:

"AAAAAgAAAAB8shYDi1JO9x2/3jMeVzK2IGtrsFVWLCL4uHRJf+YPyAAAA+gCzi7H..."

action
enum<string>

What to do next with the returned XDR

Available options:
SIGN_TRANSACTION,
CREATE_TRUSTLINE,
RESTORE_BALANCE,
RESTORE_CONTRACT
Example:

"SIGN_TRANSACTION"

message
string

Human-readable explanation of the required action

Example:

"Sign the transaction with the user wallet and send the signed XDR to /send endpoint or your own rpc"

actionData
object

Extra details when action is not SIGN_TRANSACTION (e.g. signer, assetCode, assetIssuer for CREATE_TRUSTLINE)

simulated
boolean

Only present in inline-prerequisites mode. false means the swap XDR was built without simulation (no footprint, resource fees or auth entries) and must be re-simulated and assembled before submission

Example:

false

prerequisites
object[]

Only present in inline-prerequisites mode: transactions to sign and submit, in order, before the swap XDR