Execute quote
curl --request POST \
--url https://api.sunrise.xyz/v1/execute \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"signedTransaction": "<string>",
"quoteId": "<string>",
"routeName": "<string>",
"providerRequestId": "<string>"
}
'import requests
url = "https://api.sunrise.xyz/v1/execute"
payload = {
"signedTransaction": "<string>",
"quoteId": "<string>",
"routeName": "<string>",
"providerRequestId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
signedTransaction: '<string>',
quoteId: '<string>',
routeName: '<string>',
providerRequestId: '<string>'
})
};
fetch('https://api.sunrise.xyz/v1/execute', 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.sunrise.xyz/v1/execute",
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([
'signedTransaction' => '<string>',
'quoteId' => '<string>',
'routeName' => '<string>',
'providerRequestId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.sunrise.xyz/v1/execute"
payload := strings.NewReader("{\n \"signedTransaction\": \"<string>\",\n \"quoteId\": \"<string>\",\n \"routeName\": \"<string>\",\n \"providerRequestId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.sunrise.xyz/v1/execute")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"signedTransaction\": \"<string>\",\n \"quoteId\": \"<string>\",\n \"routeName\": \"<string>\",\n \"providerRequestId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sunrise.xyz/v1/execute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"signedTransaction\": \"<string>\",\n \"quoteId\": \"<string>\",\n \"routeName\": \"<string>\",\n \"providerRequestId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"txHash": "<string>",
"status": "CONFIRMED"
},
"timestamp": "<string>"
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
},
"timestamp": "<string>"
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
},
"timestamp": "<string>"
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
},
"timestamp": "<string>"
}{
"success": false,
"error": {
"code": "verification_rate_limited",
"message": "<string>",
"requestId": "<string>"
},
"timestamp": "<string>"
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
},
"timestamp": "<string>"
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
},
"timestamp": "<string>"
}API reference
Execute quote
Submits a signed transaction using the quote ID, route name, and optional provider request ID returned by the quote endpoint. Poll this endpoint with the same request until the transaction status is CONFIRMED.
POST
/
v1
/
execute
Execute quote
curl --request POST \
--url https://api.sunrise.xyz/v1/execute \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"signedTransaction": "<string>",
"quoteId": "<string>",
"routeName": "<string>",
"providerRequestId": "<string>"
}
'import requests
url = "https://api.sunrise.xyz/v1/execute"
payload = {
"signedTransaction": "<string>",
"quoteId": "<string>",
"routeName": "<string>",
"providerRequestId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
signedTransaction: '<string>',
quoteId: '<string>',
routeName: '<string>',
providerRequestId: '<string>'
})
};
fetch('https://api.sunrise.xyz/v1/execute', 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.sunrise.xyz/v1/execute",
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([
'signedTransaction' => '<string>',
'quoteId' => '<string>',
'routeName' => '<string>',
'providerRequestId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.sunrise.xyz/v1/execute"
payload := strings.NewReader("{\n \"signedTransaction\": \"<string>\",\n \"quoteId\": \"<string>\",\n \"routeName\": \"<string>\",\n \"providerRequestId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.sunrise.xyz/v1/execute")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"signedTransaction\": \"<string>\",\n \"quoteId\": \"<string>\",\n \"routeName\": \"<string>\",\n \"providerRequestId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sunrise.xyz/v1/execute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"signedTransaction\": \"<string>\",\n \"quoteId\": \"<string>\",\n \"routeName\": \"<string>\",\n \"providerRequestId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"txHash": "<string>",
"status": "CONFIRMED"
},
"timestamp": "<string>"
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
},
"timestamp": "<string>"
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
},
"timestamp": "<string>"
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
},
"timestamp": "<string>"
}{
"success": false,
"error": {
"code": "verification_rate_limited",
"message": "<string>",
"requestId": "<string>"
},
"timestamp": "<string>"
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
},
"timestamp": "<string>"
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
},
"timestamp": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Signed quote execution parameters.
Base64-encoded transaction signed by the connected Solana wallet.
import { getBase64Decoder, getBase64Encoder } from "@solana/kit";
const [signed] = await wallet.features["solana:signTransaction"].signTransaction({
account,
chain: "solana:mainnet",
transaction: new Uint8Array(getBase64Encoder().encode(quote.unsignedTransaction)),
});
const signedTransaction = getBase64Decoder().decode(signed.signedTransaction);
Minimum string length:
1Quote identifier returned by the quote endpoint.
Minimum string length:
1Liquidity route returned with the quote.
Minimum string length:
1Provider request identifier returned with the quote.
Minimum string length:
1
