curl --request POST \
--url https://api.soroswap.finance/quote/build \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"quote": {
"assetIn": "CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75",
"assetOut": "CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV",
"amountIn": "10000000",
"amountOut": "9067253",
"otherAmountThreshold": "9067253",
"tradeType": "EXACT_IN",
"priceImpactPct": "0.50",
"platform": "aggregator",
"rawTrade": {
"amountIn": "10000000",
"amountOutMin": "9067253",
"distribution": [
{
"protocol_id": "soroswap",
"path": [
"CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75",
"CD25MNVTZDL4Y3XBCPCJXGXATV5WUHHOWMYFF4YBEGU5FCPGMYTVG5JY",
"CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV"
],
"parts": 10,
"is_exact_in": true
}
]
},
"routePlan": [
{
"swapInfo": {
"protocol": "soroswap",
"path": [
"CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75",
"CD25MNVTZDL4Y3XBCPCJXGXATV5WUHHOWMYFF4YBEGU5FCPGMYTVG5JY",
"CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV"
]
},
"percent": "100"
}
]
},
"to": "GCSQJ7TCEVWXK2JZPTTTCJCVZZNMQXEJWVHIOCUAQHWNJSXKHX7OHVUW",
"from": "GBQJ4HBCQHJQKSKNT3JRKC5VKA3QJUXBVFWIVSMHKPQSJ7XP2IXTCAAK"
}
'{
"xdr": "AAAAAgAAAAB8shYDi1JO9x2/3jMeVzK2IGtrsFVWLCL4uHRJf+YPyAAAA+gCzi7HAAAApgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAGAAAAAAAAAABc12cL..."
}{
"message": "User signature required for sponsored transaction",
"action": "SIGN_USER_TRANSACTION",
"actionData": {
"xdr": "AAAAAgAAAAB8shYDi1JO9x2...",
"step": 1,
"totalSteps": 2,
"description": "Sign the transaction with the user wallet and send back the signed XDR"
}
}Build
Turns a quote into an unsigned XDR for from to sign. Send the quote unchanged and sign right away: a Soroban XDR is valid for 180 seconds. 428 CREATE_TRUSTLINE when a trustline is missing, 409 Quote stale when your fee changed.
curl --request POST \
--url https://api.soroswap.finance/quote/build \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"quote": {
"assetIn": "CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75",
"assetOut": "CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV",
"amountIn": "10000000",
"amountOut": "9067253",
"otherAmountThreshold": "9067253",
"tradeType": "EXACT_IN",
"priceImpactPct": "0.50",
"platform": "aggregator",
"rawTrade": {
"amountIn": "10000000",
"amountOutMin": "9067253",
"distribution": [
{
"protocol_id": "soroswap",
"path": [
"CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75",
"CD25MNVTZDL4Y3XBCPCJXGXATV5WUHHOWMYFF4YBEGU5FCPGMYTVG5JY",
"CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV"
],
"parts": 10,
"is_exact_in": true
}
]
},
"routePlan": [
{
"swapInfo": {
"protocol": "soroswap",
"path": [
"CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75",
"CD25MNVTZDL4Y3XBCPCJXGXATV5WUHHOWMYFF4YBEGU5FCPGMYTVG5JY",
"CDTKPWPLOURQA2SGTKTUQOWRCBZEORB4BWBOMJ3D3ZTQQSGE5F6JBQLV"
]
},
"percent": "100"
}
]
},
"to": "GCSQJ7TCEVWXK2JZPTTTCJCVZZNMQXEJWVHIOCUAQHWNJSXKHX7OHVUW",
"from": "GBQJ4HBCQHJQKSKNT3JRKC5VKA3QJUXBVFWIVSMHKPQSJ7XP2IXTCAAK"
}
'{
"xdr": "AAAAAgAAAAB8shYDi1JO9x2/3jMeVzK2IGtrsFVWLCL4uHRJf+YPyAAAA+gCzi7HAAAApgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAGAAAAAAAAAABc12cL..."
}{
"message": "User signature required for sponsored transaction",
"action": "SIGN_USER_TRANSACTION",
"actionData": {
"xdr": "AAAAAgAAAAB8shYDi1JO9x2...",
"step": 1,
"totalSteps": 2,
"description": "Sign the transaction with the user wallet and send back the signed XDR"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Network on which the operation will be performed
testnet, mainnet Body
Data required to build the quote
The quote to build the XDR for
The wallet address that will send the funds
The wallet address that will receive the funds. If Gasless Trustline Swap is enabled, this is the wallet address must be the same as the from address (hence, don't provide this parameter)
Ignored. Fee destinations are no longer caller-supplied; the value you send is recorded so Soroswap can propose your payout address.
The wallet address that will sponsor the transaction. Only required for Gasless Trustline Swap and Soroban sponsored transactions
The signed transaction XDR from Step 1 of Soroban sponsored transactions. Required for Step 2 when sponsor is provided for non-SDEX platforms.
Response
XDR built successfully
Transaction XDR ready for signing and execution
"AAAAAgAAAAB8shYDi1JO9x2/3jMeVzK2IGtrsFVWLCL4uHRJf+YPyAAAA+gCzi7HAAAApgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAGAAAAAAAAAABc12cL..."