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",
"accountId": "12",
"originAddress": "0xb794F5eA0ba39494cE839613fffBA74279579268",
"destinationAddress": "0xb794F5eA0ba39494cE839613fffBA74279579268",
"output": "bytecode",
"pixKey": "[email protected]",
"rawQuote": "<unknown>",
"thirdParty": false,
"webhookURL": "https://example.com/webhooks/swap-action"
}
'import requests
url = "https://api.pods.finance/v2/swap/bytecode"
payload = {
"quoteId": "550e8400-e29b-41d4-a716-446655440000",
"accountId": "12",
"originAddress": "0xb794F5eA0ba39494cE839613fffBA74279579268",
"destinationAddress": "0xb794F5eA0ba39494cE839613fffBA74279579268",
"output": "bytecode",
"pixKey": "[email protected]",
"rawQuote": "<unknown>",
"thirdParty": False,
"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',
accountId: '12',
originAddress: '0xb794F5eA0ba39494cE839613fffBA74279579268',
destinationAddress: '0xb794F5eA0ba39494cE839613fffBA74279579268',
output: 'bytecode',
pixKey: '[email protected]',
rawQuote: '<unknown>',
thirdParty: false,
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',
'accountId' => '12',
'originAddress' => '0xb794F5eA0ba39494cE839613fffBA74279579268',
'destinationAddress' => '0xb794F5eA0ba39494cE839613fffBA74279579268',
'output' => 'bytecode',
'pixKey' => '[email protected]',
'rawQuote' => '<unknown>',
'thirdParty' => false,
'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 \"accountId\": \"12\",\n \"originAddress\": \"0xb794F5eA0ba39494cE839613fffBA74279579268\",\n \"destinationAddress\": \"0xb794F5eA0ba39494cE839613fffBA74279579268\",\n \"output\": \"bytecode\",\n \"pixKey\": \"[email protected]\",\n \"rawQuote\": \"<unknown>\",\n \"thirdParty\": false,\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 \"accountId\": \"12\",\n \"originAddress\": \"0xb794F5eA0ba39494cE839613fffBA74279579268\",\n \"destinationAddress\": \"0xb794F5eA0ba39494cE839613fffBA74279579268\",\n \"output\": \"bytecode\",\n \"pixKey\": \"[email protected]\",\n \"rawQuote\": \"<unknown>\",\n \"thirdParty\": false,\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 \"accountId\": \"12\",\n \"originAddress\": \"0xb794F5eA0ba39494cE839613fffBA74279579268\",\n \"destinationAddress\": \"0xb794F5eA0ba39494cE839613fffBA74279579268\",\n \"output\": \"bytecode\",\n \"pixKey\": \"[email protected]\",\n \"rawQuote\": \"<unknown>\",\n \"thirdParty\": false,\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"
}
}{
"error": {
"code": "QUOTE_NOT_FOUND",
"message": "Quote not found or expired"
}
}Generate transaction bytecode
Generate executable transaction bytecode from a quote. The quote must not be expired.
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",
"accountId": "12",
"originAddress": "0xb794F5eA0ba39494cE839613fffBA74279579268",
"destinationAddress": "0xb794F5eA0ba39494cE839613fffBA74279579268",
"output": "bytecode",
"pixKey": "[email protected]",
"rawQuote": "<unknown>",
"thirdParty": false,
"webhookURL": "https://example.com/webhooks/swap-action"
}
'import requests
url = "https://api.pods.finance/v2/swap/bytecode"
payload = {
"quoteId": "550e8400-e29b-41d4-a716-446655440000",
"accountId": "12",
"originAddress": "0xb794F5eA0ba39494cE839613fffBA74279579268",
"destinationAddress": "0xb794F5eA0ba39494cE839613fffBA74279579268",
"output": "bytecode",
"pixKey": "[email protected]",
"rawQuote": "<unknown>",
"thirdParty": False,
"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',
accountId: '12',
originAddress: '0xb794F5eA0ba39494cE839613fffBA74279579268',
destinationAddress: '0xb794F5eA0ba39494cE839613fffBA74279579268',
output: 'bytecode',
pixKey: '[email protected]',
rawQuote: '<unknown>',
thirdParty: false,
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',
'accountId' => '12',
'originAddress' => '0xb794F5eA0ba39494cE839613fffBA74279579268',
'destinationAddress' => '0xb794F5eA0ba39494cE839613fffBA74279579268',
'output' => 'bytecode',
'pixKey' => '[email protected]',
'rawQuote' => '<unknown>',
'thirdParty' => false,
'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 \"accountId\": \"12\",\n \"originAddress\": \"0xb794F5eA0ba39494cE839613fffBA74279579268\",\n \"destinationAddress\": \"0xb794F5eA0ba39494cE839613fffBA74279579268\",\n \"output\": \"bytecode\",\n \"pixKey\": \"[email protected]\",\n \"rawQuote\": \"<unknown>\",\n \"thirdParty\": false,\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 \"accountId\": \"12\",\n \"originAddress\": \"0xb794F5eA0ba39494cE839613fffBA74279579268\",\n \"destinationAddress\": \"0xb794F5eA0ba39494cE839613fffBA74279579268\",\n \"output\": \"bytecode\",\n \"pixKey\": \"[email protected]\",\n \"rawQuote\": \"<unknown>\",\n \"thirdParty\": false,\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 \"accountId\": \"12\",\n \"originAddress\": \"0xb794F5eA0ba39494cE839613fffBA74279579268\",\n \"destinationAddress\": \"0xb794F5eA0ba39494cE839613fffBA74279579268\",\n \"output\": \"bytecode\",\n \"pixKey\": \"[email protected]\",\n \"rawQuote\": \"<unknown>\",\n \"thirdParty\": false,\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"
}
}{
"error": {
"code": "QUOTE_NOT_FOUND",
"message": "Quote not found or expired"
}
}Authorizations
API key for authentication. Obtain from your Pods dashboard.
Body
Quote ID from /v2/swap/quote
"550e8400-e29b-41d4-a716-446655440000"
Fireblocks vault account ID. Required when output=fireblocks.
"12"
Address executing the swap on the origin chain
"0xb794F5eA0ba39494cE839613fffBA74279579268"
Address receiving tokens on the destination chain. Required unless pixKey is provided.
"0xb794F5eA0ba39494cE839613fffBA74279579268"
Response format. Fireblocks output requires accountId.
bytecode, userOperation, fireblocks PIX key for fiat off-ramp routes. Use instead of destinationAddress.
Provider-specific raw quote data from the quote response. Pass this when the quote includes it.
Set to true for third-party PIX payouts. It must match the value used for the quote.
Optional per-quote webhook endpoint override. When set, it updates the quote webhookURL and is copied to the created action.
"https://example.com/webhooks/swap-action"
Was this page helpful?