Generate transaction bytecode
curl --request POST \
--url https://api.pods.finance/v2/swap/bytecode \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"quoteId": "550e8400-e29b-41d4-a716-446655440000",
"originAddress": "0xb794F5eA0ba39494cE839613fffBA74279579268",
"destinationAddress": "0xb794F5eA0ba39494cE839613fffBA74279579268",
"rawQuote": "<unknown>",
"webhookURL": "https://example.com/webhooks/swap-action"
}
'import requests
url = "https://api.pods.finance/v2/swap/bytecode"
payload = {
"quoteId": "550e8400-e29b-41d4-a716-446655440000",
"originAddress": "0xb794F5eA0ba39494cE839613fffBA74279579268",
"destinationAddress": "0xb794F5eA0ba39494cE839613fffBA74279579268",
"rawQuote": "<unknown>",
"webhookURL": "https://example.com/webhooks/swap-action"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
quoteId: '550e8400-e29b-41d4-a716-446655440000',
originAddress: '0xb794F5eA0ba39494cE839613fffBA74279579268',
destinationAddress: '0xb794F5eA0ba39494cE839613fffBA74279579268',
rawQuote: '<unknown>',
webhookURL: 'https://example.com/webhooks/swap-action'
})
};
fetch('https://api.pods.finance/v2/swap/bytecode', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pods.finance/v2/swap/bytecode",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'quoteId' => '550e8400-e29b-41d4-a716-446655440000',
'originAddress' => '0xb794F5eA0ba39494cE839613fffBA74279579268',
'destinationAddress' => '0xb794F5eA0ba39494cE839613fffBA74279579268',
'rawQuote' => '<unknown>',
'webhookURL' => 'https://example.com/webhooks/swap-action'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pods.finance/v2/swap/bytecode"
payload := strings.NewReader("{\n \"quoteId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"originAddress\": \"0xb794F5eA0ba39494cE839613fffBA74279579268\",\n \"destinationAddress\": \"0xb794F5eA0ba39494cE839613fffBA74279579268\",\n \"rawQuote\": \"<unknown>\",\n \"webhookURL\": \"https://example.com/webhooks/swap-action\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.pods.finance/v2/swap/bytecode")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"quoteId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"originAddress\": \"0xb794F5eA0ba39494cE839613fffBA74279579268\",\n \"destinationAddress\": \"0xb794F5eA0ba39494cE839613fffBA74279579268\",\n \"rawQuote\": \"<unknown>\",\n \"webhookURL\": \"https://example.com/webhooks/swap-action\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pods.finance/v2/swap/bytecode")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"quoteId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"originAddress\": \"0xb794F5eA0ba39494cE839613fffBA74279579268\",\n \"destinationAddress\": \"0xb794F5eA0ba39494cE839613fffBA74279579268\",\n \"rawQuote\": \"<unknown>\",\n \"webhookURL\": \"https://example.com/webhooks/swap-action\"\n}"
response = http.request(request)
puts response.read_body{
"id": "65f1a2b3c4d5e6f789012345",
"chainId": 1,
"transactionData": [
{
"chainId": "137",
"to": "0xb794F5eA0ba39494cE839613fffBA74279579268",
"data": "0x...",
"value": "0",
"from": "0xb794F5eA0ba39494cE839613fffBA74279579268"
}
]
}{
"error": {
"code": "QUOTE_NOT_FOUND",
"message": "Quote not found or expired"
}
}{
"error": {
"code": "QUOTE_NOT_FOUND",
"message": "Quote not found or expired"
}
}Swap
Generate transaction bytecode
Generate executable transaction bytecode from a quote. The quote must not be expired.
POST
/
v2
/
swap
/
bytecode
Generate transaction bytecode
curl --request POST \
--url https://api.pods.finance/v2/swap/bytecode \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"quoteId": "550e8400-e29b-41d4-a716-446655440000",
"originAddress": "0xb794F5eA0ba39494cE839613fffBA74279579268",
"destinationAddress": "0xb794F5eA0ba39494cE839613fffBA74279579268",
"rawQuote": "<unknown>",
"webhookURL": "https://example.com/webhooks/swap-action"
}
'import requests
url = "https://api.pods.finance/v2/swap/bytecode"
payload = {
"quoteId": "550e8400-e29b-41d4-a716-446655440000",
"originAddress": "0xb794F5eA0ba39494cE839613fffBA74279579268",
"destinationAddress": "0xb794F5eA0ba39494cE839613fffBA74279579268",
"rawQuote": "<unknown>",
"webhookURL": "https://example.com/webhooks/swap-action"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
quoteId: '550e8400-e29b-41d4-a716-446655440000',
originAddress: '0xb794F5eA0ba39494cE839613fffBA74279579268',
destinationAddress: '0xb794F5eA0ba39494cE839613fffBA74279579268',
rawQuote: '<unknown>',
webhookURL: 'https://example.com/webhooks/swap-action'
})
};
fetch('https://api.pods.finance/v2/swap/bytecode', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pods.finance/v2/swap/bytecode",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'quoteId' => '550e8400-e29b-41d4-a716-446655440000',
'originAddress' => '0xb794F5eA0ba39494cE839613fffBA74279579268',
'destinationAddress' => '0xb794F5eA0ba39494cE839613fffBA74279579268',
'rawQuote' => '<unknown>',
'webhookURL' => 'https://example.com/webhooks/swap-action'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pods.finance/v2/swap/bytecode"
payload := strings.NewReader("{\n \"quoteId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"originAddress\": \"0xb794F5eA0ba39494cE839613fffBA74279579268\",\n \"destinationAddress\": \"0xb794F5eA0ba39494cE839613fffBA74279579268\",\n \"rawQuote\": \"<unknown>\",\n \"webhookURL\": \"https://example.com/webhooks/swap-action\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.pods.finance/v2/swap/bytecode")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"quoteId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"originAddress\": \"0xb794F5eA0ba39494cE839613fffBA74279579268\",\n \"destinationAddress\": \"0xb794F5eA0ba39494cE839613fffBA74279579268\",\n \"rawQuote\": \"<unknown>\",\n \"webhookURL\": \"https://example.com/webhooks/swap-action\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pods.finance/v2/swap/bytecode")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"quoteId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"originAddress\": \"0xb794F5eA0ba39494cE839613fffBA74279579268\",\n \"destinationAddress\": \"0xb794F5eA0ba39494cE839613fffBA74279579268\",\n \"rawQuote\": \"<unknown>\",\n \"webhookURL\": \"https://example.com/webhooks/swap-action\"\n}"
response = http.request(request)
puts response.read_body{
"id": "65f1a2b3c4d5e6f789012345",
"chainId": 1,
"transactionData": [
{
"chainId": "137",
"to": "0xb794F5eA0ba39494cE839613fffBA74279579268",
"data": "0x...",
"value": "0",
"from": "0xb794F5eA0ba39494cE839613fffBA74279579268"
}
]
}{
"error": {
"code": "QUOTE_NOT_FOUND",
"message": "Quote not found or expired"
}
}{
"error": {
"code": "QUOTE_NOT_FOUND",
"message": "Quote not found or expired"
}
}Authorizations
API key for authentication. Obtain from your Pods dashboard.
Body
application/json
Quote ID from /v2/swap/quote
Example:
"550e8400-e29b-41d4-a716-446655440000"
Address executing the swap on origin chain
Example:
"0xb794F5eA0ba39494cE839613fffBA74279579268"
Address receiving tokens on destination chain
Example:
"0xb794F5eA0ba39494cE839613fffBA74279579268"
Provider-specific raw quote data from the quote response. Pass this when the quote includes it.
Optional per-quote webhook endpoint override. When set, it updates the quote webhookURL and is copied to the created action.
Example:
"https://example.com/webhooks/swap-action"
Was this page helpful?
⌘I