Plan a multi-swap
curl --request POST \
--url https://api.route.fun/api/v2/builders/integration \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"action": "multi-plan",
"input": {
"execution": "sequential",
"payer": "0x1111111111111111111111111111111111111111",
"inputs": [
{
"token": "0x0000000000000000000000000000000000000000",
"amount": "10000000000000000"
}
],
"outputs": [
{
"token": "0x2222222222222222222222222222222222222222",
"weightBps": 5000
},
{
"token": "0x3333333333333333333333333333333333333333",
"weightBps": 5000
}
]
}
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
action: 'multi-plan',
input: {
execution: 'sequential',
payer: '0x1111111111111111111111111111111111111111',
inputs: [
{
token: '0x0000000000000000000000000000000000000000',
amount: '10000000000000000'
}
],
outputs: [
{token: '0x2222222222222222222222222222222222222222', weightBps: 5000},
{token: '0x3333333333333333333333333333333333333333', weightBps: 5000}
]
}
})
};
fetch('https://api.route.fun/api/v2/builders/integration', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.route.fun/api/v2/builders/integration"
payload = {
"action": "multi-plan",
"input": {
"execution": "sequential",
"payer": "0x1111111111111111111111111111111111111111",
"inputs": [
{
"token": "0x0000000000000000000000000000000000000000",
"amount": "10000000000000000"
}
],
"outputs": [
{
"token": "0x2222222222222222222222222222222222222222",
"weightBps": 5000
},
{
"token": "0x3333333333333333333333333333333333333333",
"weightBps": 5000
}
]
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"chainId": 4663,
"execution": "sequential",
"atomic": false,
"payer": "<string>",
"recipient": "<string>",
"legs": [
{
"chainId": 4663,
"payer": "<string>",
"recipient": "<string>",
"tokenIn": "<string>",
"tokenOut": "<string>",
"amountIn": "<string>",
"builderCode": "<string>",
"builderFeeBps": 123,
"slippageBps": 123
}
],
"swapCount": 123,
"allocation": "<string>",
"partialCompletion": "<string>"
}Builder swaps
Plan a multi-swap
Requires quote scope. Split each input among up to four outputs. Weights must total 10000. Returns inputs for sequential builder swaps; completed trades remain completed if a later trade stops. Robinhood Chain is selected automatically.
POST
/
api
/
v2
/
builders
/
integration
Plan a multi-swap
curl --request POST \
--url https://api.route.fun/api/v2/builders/integration \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"action": "multi-plan",
"input": {
"execution": "sequential",
"payer": "0x1111111111111111111111111111111111111111",
"inputs": [
{
"token": "0x0000000000000000000000000000000000000000",
"amount": "10000000000000000"
}
],
"outputs": [
{
"token": "0x2222222222222222222222222222222222222222",
"weightBps": 5000
},
{
"token": "0x3333333333333333333333333333333333333333",
"weightBps": 5000
}
]
}
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
action: 'multi-plan',
input: {
execution: 'sequential',
payer: '0x1111111111111111111111111111111111111111',
inputs: [
{
token: '0x0000000000000000000000000000000000000000',
amount: '10000000000000000'
}
],
outputs: [
{token: '0x2222222222222222222222222222222222222222', weightBps: 5000},
{token: '0x3333333333333333333333333333333333333333', weightBps: 5000}
]
}
})
};
fetch('https://api.route.fun/api/v2/builders/integration', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.route.fun/api/v2/builders/integration"
payload = {
"action": "multi-plan",
"input": {
"execution": "sequential",
"payer": "0x1111111111111111111111111111111111111111",
"inputs": [
{
"token": "0x0000000000000000000000000000000000000000",
"amount": "10000000000000000"
}
],
"outputs": [
{
"token": "0x2222222222222222222222222222222222222222",
"weightBps": 5000
},
{
"token": "0x3333333333333333333333333333333333333333",
"weightBps": 5000
}
]
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"chainId": 4663,
"execution": "sequential",
"atomic": false,
"payer": "<string>",
"recipient": "<string>",
"legs": [
{
"chainId": 4663,
"payer": "<string>",
"recipient": "<string>",
"tokenIn": "<string>",
"tokenOut": "<string>",
"amountIn": "<string>",
"builderCode": "<string>",
"builderFeeBps": 123,
"slippageBps": 123
}
],
"swapCount": 123,
"allocation": "<string>",
"partialCompletion": "<string>"
}Multi-swap planning is available. Zaps are not enabled yet; check capabilities before showing a deposit action.
Authorizations
Server-side key created in an authenticated developer workspace. Builder codes are public attribution, not credentials.
Body
application/json
Response
Result for the selected action.
Available options:
4663 Available options:
sequential Available options:
false Pattern:
^0x[0-9a-fA-F]{40}$Pattern:
^0x[0-9a-fA-F]{40}$Required array length:
1 - 16 elementsShow child attributes
Show child attributes