curl --request POST \
--url https://api.soroswap.finance/swap \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"assetIn": "CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA",
"assetOut": "CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV",
"amount": "10000000",
"tradeType": "EXACT_IN",
"protocols": [
"soroswap",
"aqua",
"sdex"
],
"slippageBps": "50",
"from": "GBQJ4HBCQHJQKSKNT3JRKC5VKA3QJUXBVFWIVSMHKPQSJ7XP2IXTCAAK"
}
'{
"quote": {},
"xdr": "AAAAAgAAAAB8shYDi1JO9x2/3jMeVzK2IGtrsFVWLCL4uHRJf+YPyAAAA+gCzi7H...",
"action": "SIGN_TRANSACTION",
"message": "Sign the transaction with the user wallet and send the signed XDR to /send endpoint or your own rpc",
"actionData": {},
"simulated": false,
"prerequisites": [
{
"action": "CREATE_TRUSTLINE",
"xdr": "AAAAAgAAAABiSu3MsKtQvDuQO5i2b...",
"signer": "GBQJ4HBCQHJQKSKNT3JRKC5VKA3QJUXBVFWIVSMHKPQSJ7XP2IXTCAAK",
"assetCode": "USDC",
"assetIssuer": "GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
"description": "<string>"
}
]
}Swap (all-in-one)
Quote and build in one call: /quote fields plus from. Returns 200 with an action: SIGN_TRANSACTION, or CREATE_TRUSTLINE / RESTORE_BALANCE / RESTORE_CONTRACT with the XDR that resolves it. inlinePrerequisites returns the swap XDR too.
curl --request POST \
--url https://api.soroswap.finance/swap \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"assetIn": "CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA",
"assetOut": "CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV",
"amount": "10000000",
"tradeType": "EXACT_IN",
"protocols": [
"soroswap",
"aqua",
"sdex"
],
"slippageBps": "50",
"from": "GBQJ4HBCQHJQKSKNT3JRKC5VKA3QJUXBVFWIVSMHKPQSJ7XP2IXTCAAK"
}
'{
"quote": {},
"xdr": "AAAAAgAAAAB8shYDi1JO9x2/3jMeVzK2IGtrsFVWLCL4uHRJf+YPyAAAA+gCzi7H...",
"action": "SIGN_TRANSACTION",
"message": "Sign the transaction with the user wallet and send the signed XDR to /send endpoint or your own rpc",
"actionData": {},
"simulated": false,
"prerequisites": [
{
"action": "CREATE_TRUSTLINE",
"xdr": "AAAAAgAAAABiSu3MsKtQvDuQO5i2b...",
"signer": "GBQJ4HBCQHJQKSKNT3JRKC5VKA3QJUXBVFWIVSMHKPQSJ7XP2IXTCAAK",
"assetCode": "USDC",
"assetIssuer": "GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
"description": "<string>"
}
]
}Authorizations
Query Parameters
Body
Data required to quote and build the swap
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. Every response in this mode carries simulated, so a missing field never has to be read as true
true
Response
Quote and transaction (or required action) returned successfully
Present on every response when inlinePrerequisites is true, absent otherwise. true means the swap XDR is simulated and ready to sign; 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
false