Execute Quote
curl --request POST \
--url https://api.openxswitch.com/v2/swap/execute \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"quoteId": "92f5dc3-27b7-4965-80fd-7fc45322b8"
}
'import requests
url = "https://api.openxswitch.com/v2/swap/execute"
payload = { "quoteId": "92f5dc3-27b7-4965-80fd-7fc45322b8" }
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({quoteId: '92f5dc3-27b7-4965-80fd-7fc45322b8'})
};
fetch('https://api.openxswitch.com/v2/swap/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.openxswitch.com/v2/swap/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([
'quoteId' => '92f5dc3-27b7-4965-80fd-7fc45322b8'
]),
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.openxswitch.com/v2/swap/execute"
payload := strings.NewReader("{\n \"quoteId\": \"92f5dc3-27b7-4965-80fd-7fc45322b8\"\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.openxswitch.com/v2/swap/execute")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"quoteId\": \"92f5dc3-27b7-4965-80fd-7fc45322b8\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openxswitch.com/v2/swap/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 \"quoteId\": \"92f5dc3-27b7-4965-80fd-7fc45322b8\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "66a12b3c4d5e6f7a8b9c0d1e",
"idempotencyKey": "idemp_swap_xyz789",
"refId": "ref_swap_98765",
"from": {
"token": "USDC",
"chain": "arbitrum",
"decimal": 6,
"contractAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"amount": "5600.10",
"amountInUsd": "5600.10"
},
"to": {
"token": "USDC",
"chain": "arbitrum",
"decimal": 6,
"contractAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"amount": "5600.10",
"amountInUsd": "5600.10"
},
"amountType": "exactInput",
"fillTime": 45,
"expiryTimestamp": 1784660000,
"slippage": "0.5",
"environment": "testnet",
"status": "pending",
"txHash": "0x9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0b",
"hashOut": "0x1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b",
"fee": {
"token": "USDC",
"chain": "arbitrum",
"decimal": 6,
"contractAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"amount": "5600.10",
"amountInUsd": "5600.10"
},
"bridgeFee": {
"token": "USDC",
"chain": "arbitrum",
"decimal": 6,
"contractAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"amount": "5600.10",
"amountInUsd": "5600.10"
},
"triggerOrigin": "API",
"transactionGroupId": "grp_swap_123456",
"createdAt": "2026-07-21T18:40:00.000Z",
"updatedAt": "2026-07-21T18:47:21.000Z",
"confirmedAt": "2026-07-21T18:47:21.000Z",
"userId": "USER_ID",
"walletId": "WALLET_ID",
"accountId": "ACCOUNT_ID",
"workspaceId": "WORKSPACE_ID"
}
}{
"statusCode": 400,
"path": "/v1/...",
"timestamp": "2025-03-13T12:34:56.789Z",
"message": "......"
}{
"statusCode": 404,
"path": "/v1/...",
"timestamp": "2025-03-13T12:34:56.789Z",
"message": "Cannot GET /v1/..."
}{
"statusCode": 422,
"path": "/v1/...",
"timestamp": "2025-03-13T12:34:56.789Z",
"message": [
"param is required"
]
}{
"statusCode": 500,
"path": "/v1/...",
"timestamp": "2025-03-13T12:34:56.789Z",
"message": "......"
}Swaps
Execute Quote
Executes an active, valid quote on-chain using its Quote ID. Builds and broadcasts the transaction to settle the trade, provided the quote has not expired.
POST
/
v2
/
swap
/
execute
Execute Quote
curl --request POST \
--url https://api.openxswitch.com/v2/swap/execute \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"quoteId": "92f5dc3-27b7-4965-80fd-7fc45322b8"
}
'import requests
url = "https://api.openxswitch.com/v2/swap/execute"
payload = { "quoteId": "92f5dc3-27b7-4965-80fd-7fc45322b8" }
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({quoteId: '92f5dc3-27b7-4965-80fd-7fc45322b8'})
};
fetch('https://api.openxswitch.com/v2/swap/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.openxswitch.com/v2/swap/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([
'quoteId' => '92f5dc3-27b7-4965-80fd-7fc45322b8'
]),
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.openxswitch.com/v2/swap/execute"
payload := strings.NewReader("{\n \"quoteId\": \"92f5dc3-27b7-4965-80fd-7fc45322b8\"\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.openxswitch.com/v2/swap/execute")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"quoteId\": \"92f5dc3-27b7-4965-80fd-7fc45322b8\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openxswitch.com/v2/swap/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 \"quoteId\": \"92f5dc3-27b7-4965-80fd-7fc45322b8\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "66a12b3c4d5e6f7a8b9c0d1e",
"idempotencyKey": "idemp_swap_xyz789",
"refId": "ref_swap_98765",
"from": {
"token": "USDC",
"chain": "arbitrum",
"decimal": 6,
"contractAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"amount": "5600.10",
"amountInUsd": "5600.10"
},
"to": {
"token": "USDC",
"chain": "arbitrum",
"decimal": 6,
"contractAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"amount": "5600.10",
"amountInUsd": "5600.10"
},
"amountType": "exactInput",
"fillTime": 45,
"expiryTimestamp": 1784660000,
"slippage": "0.5",
"environment": "testnet",
"status": "pending",
"txHash": "0x9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0b",
"hashOut": "0x1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b",
"fee": {
"token": "USDC",
"chain": "arbitrum",
"decimal": 6,
"contractAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"amount": "5600.10",
"amountInUsd": "5600.10"
},
"bridgeFee": {
"token": "USDC",
"chain": "arbitrum",
"decimal": 6,
"contractAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"amount": "5600.10",
"amountInUsd": "5600.10"
},
"triggerOrigin": "API",
"transactionGroupId": "grp_swap_123456",
"createdAt": "2026-07-21T18:40:00.000Z",
"updatedAt": "2026-07-21T18:47:21.000Z",
"confirmedAt": "2026-07-21T18:47:21.000Z",
"userId": "USER_ID",
"walletId": "WALLET_ID",
"accountId": "ACCOUNT_ID",
"workspaceId": "WORKSPACE_ID"
}
}{
"statusCode": 400,
"path": "/v1/...",
"timestamp": "2025-03-13T12:34:56.789Z",
"message": "......"
}{
"statusCode": 404,
"path": "/v1/...",
"timestamp": "2025-03-13T12:34:56.789Z",
"message": "Cannot GET /v1/..."
}{
"statusCode": 422,
"path": "/v1/...",
"timestamp": "2025-03-13T12:34:56.789Z",
"message": [
"param is required"
]
}{
"statusCode": 500,
"path": "/v1/...",
"timestamp": "2025-03-13T12:34:56.789Z",
"message": "......"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Quote id,
Usually from quote API response
Example:
"92f5dc3-27b7-4965-80fd-7fc45322b8"
⌘I
.png?fit=max&auto=format&n=ML35RDblT1Ol-zJb&q=85&s=062e79ad9c4540929eec204aff020178)
.png?fit=max&auto=format&n=ML35RDblT1Ol-zJb&q=85&s=f6328956931c9664a2a070c2edb6e9b3)