Execute Swap
curl --request POST \
--url https://api.coinvoyage.io/v3/swap/execute \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"amount": "100.0",
"destination": {
"currency": {
"address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"chain_id": 30000000000001
},
"recipient": "0x1234...abcd"
},
"metadata": {
"items": [
{
"currency": "USD",
"description": "High-quality widget with extra features",
"image": "https://example.com/images/widget.png",
"name": "Premium Widget",
"quantity": 2,
"unit_price": 49.99
}
],
"refund": {
"additional_info": "Item was never shipped",
"currency": "USD",
"name": "Order Cancellation",
"reason": "Customer requested refund",
"refund_amount": 99.98
}
},
"source": {
"currency": {
"address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"chain_id": 30000000000001
},
"sender_address": "0x1234...abcd",
"slippage_bps": 50
},
"trade_type": "EXACT_OUTPUT"
}
'import requests
url = "https://api.coinvoyage.io/v3/swap/execute"
payload = {
"amount": "100.0",
"destination": {
"currency": {
"address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"chain_id": 30000000000001
},
"recipient": "0x1234...abcd"
},
"metadata": {
"items": [
{
"currency": "USD",
"description": "High-quality widget with extra features",
"image": "https://example.com/images/widget.png",
"name": "Premium Widget",
"quantity": 2,
"unit_price": 49.99
}
],
"refund": {
"additional_info": "Item was never shipped",
"currency": "USD",
"name": "Order Cancellation",
"reason": "Customer requested refund",
"refund_amount": 99.98
}
},
"source": {
"currency": {
"address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"chain_id": 30000000000001
},
"sender_address": "0x1234...abcd",
"slippage_bps": 50
},
"trade_type": "EXACT_OUTPUT"
}
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({
amount: '100.0',
destination: {
currency: {
address: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
chain_id: 30000000000001
},
recipient: '0x1234...abcd'
},
metadata: {
items: [
{
currency: 'USD',
description: 'High-quality widget with extra features',
image: 'https://example.com/images/widget.png',
name: 'Premium Widget',
quantity: 2,
unit_price: 49.99
}
],
refund: {
additional_info: 'Item was never shipped',
currency: 'USD',
name: 'Order Cancellation',
reason: 'Customer requested refund',
refund_amount: 99.98
}
},
source: {
currency: {
address: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
chain_id: 30000000000001
},
sender_address: '0x1234...abcd',
slippage_bps: 50
},
trade_type: 'EXACT_OUTPUT'
})
};
fetch('https://api.coinvoyage.io/v3/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.coinvoyage.io/v3/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([
'amount' => '100.0',
'destination' => [
'currency' => [
'address' => 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
'chain_id' => 30000000000001
],
'recipient' => '0x1234...abcd'
],
'metadata' => [
'items' => [
[
'currency' => 'USD',
'description' => 'High-quality widget with extra features',
'image' => 'https://example.com/images/widget.png',
'name' => 'Premium Widget',
'quantity' => 2,
'unit_price' => 49.99
]
],
'refund' => [
'additional_info' => 'Item was never shipped',
'currency' => 'USD',
'name' => 'Order Cancellation',
'reason' => 'Customer requested refund',
'refund_amount' => 99.98
]
],
'source' => [
'currency' => [
'address' => 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
'chain_id' => 30000000000001
],
'sender_address' => '0x1234...abcd',
'slippage_bps' => 50
],
'trade_type' => 'EXACT_OUTPUT'
]),
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.coinvoyage.io/v3/swap/execute"
payload := strings.NewReader("{\n \"amount\": \"100.0\",\n \"destination\": {\n \"currency\": {\n \"address\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"chain_id\": 30000000000001\n },\n \"recipient\": \"0x1234...abcd\"\n },\n \"metadata\": {\n \"items\": [\n {\n \"currency\": \"USD\",\n \"description\": \"High-quality widget with extra features\",\n \"image\": \"https://example.com/images/widget.png\",\n \"name\": \"Premium Widget\",\n \"quantity\": 2,\n \"unit_price\": 49.99\n }\n ],\n \"refund\": {\n \"additional_info\": \"Item was never shipped\",\n \"currency\": \"USD\",\n \"name\": \"Order Cancellation\",\n \"reason\": \"Customer requested refund\",\n \"refund_amount\": 99.98\n }\n },\n \"source\": {\n \"currency\": {\n \"address\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"chain_id\": 30000000000001\n },\n \"sender_address\": \"0x1234...abcd\",\n \"slippage_bps\": 50\n },\n \"trade_type\": \"EXACT_OUTPUT\"\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.coinvoyage.io/v3/swap/execute")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"100.0\",\n \"destination\": {\n \"currency\": {\n \"address\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"chain_id\": 30000000000001\n },\n \"recipient\": \"0x1234...abcd\"\n },\n \"metadata\": {\n \"items\": [\n {\n \"currency\": \"USD\",\n \"description\": \"High-quality widget with extra features\",\n \"image\": \"https://example.com/images/widget.png\",\n \"name\": \"Premium Widget\",\n \"quantity\": 2,\n \"unit_price\": 49.99\n }\n ],\n \"refund\": {\n \"additional_info\": \"Item was never shipped\",\n \"currency\": \"USD\",\n \"name\": \"Order Cancellation\",\n \"reason\": \"Customer requested refund\",\n \"refund_amount\": 99.98\n }\n },\n \"source\": {\n \"currency\": {\n \"address\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"chain_id\": 30000000000001\n },\n \"sender_address\": \"0x1234...abcd\",\n \"slippage_bps\": 50\n },\n \"trade_type\": \"EXACT_OUTPUT\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coinvoyage.io/v3/swap/execute")
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 \"amount\": \"100.0\",\n \"destination\": {\n \"currency\": {\n \"address\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"chain_id\": 30000000000001\n },\n \"recipient\": \"0x1234...abcd\"\n },\n \"metadata\": {\n \"items\": [\n {\n \"currency\": \"USD\",\n \"description\": \"High-quality widget with extra features\",\n \"image\": \"https://example.com/images/widget.png\",\n \"name\": \"Premium Widget\",\n \"quantity\": 2,\n \"unit_price\": 49.99\n }\n ],\n \"refund\": {\n \"additional_info\": \"Item was never shipped\",\n \"currency\": \"USD\",\n \"name\": \"Order Cancellation\",\n \"reason\": \"Customer requested refund\",\n \"refund_amount\": 99.98\n }\n },\n \"source\": {\n \"currency\": {\n \"address\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"chain_id\": 30000000000001\n },\n \"sender_address\": \"0x1234...abcd\",\n \"slippage_bps\": 50\n },\n \"trade_type\": \"EXACT_OUTPUT\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"destination_tx_hash": "0x5678...efgh",
"estimated_duration_seconds": 120,
"expires_at": "2023-01-01T00:00:00Z",
"fee_tx_hash": "0xfee1...fee2",
"input": {
"amount": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"balance": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"breakdown": {
"base": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"fees": {
"custom_fee": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"protocol_fee": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"relayer_fee": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"total_fee": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
}
},
"gas": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"total": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
}
},
"currency": {
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"chain_id": 1,
"decimals": 6,
"id": "1:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"name": "USD Coin",
"price_usd": 1,
"symbol": "USDC"
}
},
"output": {
"amount": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"amount_out_minimum": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"currency": {
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"chain_id": 1,
"decimals": 6,
"id": "1:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"name": "USD Coin",
"price_usd": 1,
"symbol": "USDC"
}
},
"payment_rail": "CRYPTO",
"recipient": "0x1234...abcd",
"refund": {
"address": "0x1234...abcd",
"reason": "execution failed: provider error",
"tx_hash": "0x9abc...ijkl"
},
"source_tx_hash": "0x1234...abcd",
"steps": [
{
"deposit_address": "5xVt9ovu6g6E4gvz9K9eV4kxY7yQZ8h3kZ2vY8xZ5xVt",
"kind": "deposit",
"rail": "CRYPTO"
}
]
}
}{
"code": 400,
"error": "Bad Request",
"message": "Invalid request parameters"
}{
"code": 400,
"error": "Bad Request",
"message": "Invalid request parameters"
}{
"code": 400,
"error": "Bad Request",
"message": "Invalid request parameters"
}{
"code": 400,
"error": "Bad Request",
"message": "Invalid request parameters"
}swap
Execute Swap
Create the payment details for a SWAP-mode order — returns the deposit instruction (payment block with steps to fund). v3.0 runs swaps on the deposit-and-execute model; same-chain only.
POST
/
swap
/
execute
Execute Swap
curl --request POST \
--url https://api.coinvoyage.io/v3/swap/execute \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"amount": "100.0",
"destination": {
"currency": {
"address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"chain_id": 30000000000001
},
"recipient": "0x1234...abcd"
},
"metadata": {
"items": [
{
"currency": "USD",
"description": "High-quality widget with extra features",
"image": "https://example.com/images/widget.png",
"name": "Premium Widget",
"quantity": 2,
"unit_price": 49.99
}
],
"refund": {
"additional_info": "Item was never shipped",
"currency": "USD",
"name": "Order Cancellation",
"reason": "Customer requested refund",
"refund_amount": 99.98
}
},
"source": {
"currency": {
"address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"chain_id": 30000000000001
},
"sender_address": "0x1234...abcd",
"slippage_bps": 50
},
"trade_type": "EXACT_OUTPUT"
}
'import requests
url = "https://api.coinvoyage.io/v3/swap/execute"
payload = {
"amount": "100.0",
"destination": {
"currency": {
"address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"chain_id": 30000000000001
},
"recipient": "0x1234...abcd"
},
"metadata": {
"items": [
{
"currency": "USD",
"description": "High-quality widget with extra features",
"image": "https://example.com/images/widget.png",
"name": "Premium Widget",
"quantity": 2,
"unit_price": 49.99
}
],
"refund": {
"additional_info": "Item was never shipped",
"currency": "USD",
"name": "Order Cancellation",
"reason": "Customer requested refund",
"refund_amount": 99.98
}
},
"source": {
"currency": {
"address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"chain_id": 30000000000001
},
"sender_address": "0x1234...abcd",
"slippage_bps": 50
},
"trade_type": "EXACT_OUTPUT"
}
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({
amount: '100.0',
destination: {
currency: {
address: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
chain_id: 30000000000001
},
recipient: '0x1234...abcd'
},
metadata: {
items: [
{
currency: 'USD',
description: 'High-quality widget with extra features',
image: 'https://example.com/images/widget.png',
name: 'Premium Widget',
quantity: 2,
unit_price: 49.99
}
],
refund: {
additional_info: 'Item was never shipped',
currency: 'USD',
name: 'Order Cancellation',
reason: 'Customer requested refund',
refund_amount: 99.98
}
},
source: {
currency: {
address: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
chain_id: 30000000000001
},
sender_address: '0x1234...abcd',
slippage_bps: 50
},
trade_type: 'EXACT_OUTPUT'
})
};
fetch('https://api.coinvoyage.io/v3/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.coinvoyage.io/v3/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([
'amount' => '100.0',
'destination' => [
'currency' => [
'address' => 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
'chain_id' => 30000000000001
],
'recipient' => '0x1234...abcd'
],
'metadata' => [
'items' => [
[
'currency' => 'USD',
'description' => 'High-quality widget with extra features',
'image' => 'https://example.com/images/widget.png',
'name' => 'Premium Widget',
'quantity' => 2,
'unit_price' => 49.99
]
],
'refund' => [
'additional_info' => 'Item was never shipped',
'currency' => 'USD',
'name' => 'Order Cancellation',
'reason' => 'Customer requested refund',
'refund_amount' => 99.98
]
],
'source' => [
'currency' => [
'address' => 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
'chain_id' => 30000000000001
],
'sender_address' => '0x1234...abcd',
'slippage_bps' => 50
],
'trade_type' => 'EXACT_OUTPUT'
]),
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.coinvoyage.io/v3/swap/execute"
payload := strings.NewReader("{\n \"amount\": \"100.0\",\n \"destination\": {\n \"currency\": {\n \"address\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"chain_id\": 30000000000001\n },\n \"recipient\": \"0x1234...abcd\"\n },\n \"metadata\": {\n \"items\": [\n {\n \"currency\": \"USD\",\n \"description\": \"High-quality widget with extra features\",\n \"image\": \"https://example.com/images/widget.png\",\n \"name\": \"Premium Widget\",\n \"quantity\": 2,\n \"unit_price\": 49.99\n }\n ],\n \"refund\": {\n \"additional_info\": \"Item was never shipped\",\n \"currency\": \"USD\",\n \"name\": \"Order Cancellation\",\n \"reason\": \"Customer requested refund\",\n \"refund_amount\": 99.98\n }\n },\n \"source\": {\n \"currency\": {\n \"address\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"chain_id\": 30000000000001\n },\n \"sender_address\": \"0x1234...abcd\",\n \"slippage_bps\": 50\n },\n \"trade_type\": \"EXACT_OUTPUT\"\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.coinvoyage.io/v3/swap/execute")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"100.0\",\n \"destination\": {\n \"currency\": {\n \"address\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"chain_id\": 30000000000001\n },\n \"recipient\": \"0x1234...abcd\"\n },\n \"metadata\": {\n \"items\": [\n {\n \"currency\": \"USD\",\n \"description\": \"High-quality widget with extra features\",\n \"image\": \"https://example.com/images/widget.png\",\n \"name\": \"Premium Widget\",\n \"quantity\": 2,\n \"unit_price\": 49.99\n }\n ],\n \"refund\": {\n \"additional_info\": \"Item was never shipped\",\n \"currency\": \"USD\",\n \"name\": \"Order Cancellation\",\n \"reason\": \"Customer requested refund\",\n \"refund_amount\": 99.98\n }\n },\n \"source\": {\n \"currency\": {\n \"address\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"chain_id\": 30000000000001\n },\n \"sender_address\": \"0x1234...abcd\",\n \"slippage_bps\": 50\n },\n \"trade_type\": \"EXACT_OUTPUT\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coinvoyage.io/v3/swap/execute")
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 \"amount\": \"100.0\",\n \"destination\": {\n \"currency\": {\n \"address\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"chain_id\": 30000000000001\n },\n \"recipient\": \"0x1234...abcd\"\n },\n \"metadata\": {\n \"items\": [\n {\n \"currency\": \"USD\",\n \"description\": \"High-quality widget with extra features\",\n \"image\": \"https://example.com/images/widget.png\",\n \"name\": \"Premium Widget\",\n \"quantity\": 2,\n \"unit_price\": 49.99\n }\n ],\n \"refund\": {\n \"additional_info\": \"Item was never shipped\",\n \"currency\": \"USD\",\n \"name\": \"Order Cancellation\",\n \"reason\": \"Customer requested refund\",\n \"refund_amount\": 99.98\n }\n },\n \"source\": {\n \"currency\": {\n \"address\": \"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v\",\n \"chain_id\": 30000000000001\n },\n \"sender_address\": \"0x1234...abcd\",\n \"slippage_bps\": 50\n },\n \"trade_type\": \"EXACT_OUTPUT\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"destination_tx_hash": "0x5678...efgh",
"estimated_duration_seconds": 120,
"expires_at": "2023-01-01T00:00:00Z",
"fee_tx_hash": "0xfee1...fee2",
"input": {
"amount": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"balance": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"breakdown": {
"base": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"fees": {
"custom_fee": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"protocol_fee": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"relayer_fee": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"total_fee": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
}
},
"gas": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"total": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
}
},
"currency": {
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"chain_id": 1,
"decimals": 6,
"id": "1:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"name": "USD Coin",
"price_usd": 1,
"symbol": "USDC"
}
},
"output": {
"amount": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"amount_out_minimum": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"currency": {
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"chain_id": 1,
"decimals": 6,
"id": "1:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"name": "USD Coin",
"price_usd": 1,
"symbol": "USDC"
}
},
"payment_rail": "CRYPTO",
"recipient": "0x1234...abcd",
"refund": {
"address": "0x1234...abcd",
"reason": "execution failed: provider error",
"tx_hash": "0x9abc...ijkl"
},
"source_tx_hash": "0x1234...abcd",
"steps": [
{
"deposit_address": "5xVt9ovu6g6E4gvz9K9eV4kxY7yQZ8h3kZ2vY8xZ5xVt",
"kind": "deposit",
"rail": "CRYPTO"
}
]
}
}{
"code": 400,
"error": "Bad Request",
"message": "Invalid request parameters"
}{
"code": 400,
"error": "Bad Request",
"message": "Invalid request parameters"
}{
"code": 400,
"error": "Bad Request",
"message": "Invalid request parameters"
}{
"code": 400,
"error": "Bad Request",
"message": "Invalid request parameters"
}Authorizations
Headers
API key for authentication
Body
application/json
Whether the source or destination amount is fixed.
Available options:
EXACT_INPUT, EXACT_OUTPUT Example:
"EXACT_OUTPUT"
Example:
"100.0"
Show child attributes
Show child attributes
Example:
{
"currency": {
"address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"chain_id": 30000000000001
},
"sender_address": "0x1234...abcd",
"slippage_bps": 50
}
Show child attributes
Show child attributes
Example:
{
"currency": {
"address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"chain_id": 30000000000001
},
"recipient": "0x1234...abcd"
}
Show child attributes
Show child attributes
Example:
{
"items": [
{
"currency": "USD",
"description": "High-quality widget with extra features",
"image": "https://example.com/images/widget.png",
"name": "Premium Widget",
"quantity": 2,
"unit_price": 49.99
}
],
"refund": {
"additional_info": "Item was never shipped",
"currency": "USD",
"name": "Order Cancellation",
"reason": "Customer requested refund",
"refund_amount": 99.98
}
}
Response
Swap order created; fund the deposit
Available options:
PENDING, EXPIRED, FAILED, AWAITING_PAYMENT, OPTIMISTIC_CONFIRMED, AWAITING_CONFIRMATION, EXECUTING_ORDER, COMPLETED, REFUNDED, PARTIAL_PAYMENT Show child attributes
Show child attributes
Example:
{
"destination_tx_hash": "0x5678...efgh",
"estimated_duration_seconds": 120,
"expires_at": "2023-01-01T00:00:00Z",
"fee_tx_hash": "0xfee1...fee2",
"input": {
"amount": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"balance": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"breakdown": {
"base": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"fees": {
"custom_fee": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"protocol_fee": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"relayer_fee": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"total_fee": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
}
},
"gas": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"total": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
}
},
"currency": {
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"chain_id": 1,
"decimals": 6,
"id": "1:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"name": "USD Coin",
"price_usd": 1,
"symbol": "USDC"
}
},
"output": {
"amount": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"amount_out_minimum": {
"raw": "100000000",
"ui": "100.0",
"value_usd": 100
},
"currency": {
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"chain_id": 1,
"decimals": 6,
"id": "1:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"name": "USD Coin",
"price_usd": 1,
"symbol": "USDC"
}
},
"payment_rail": "CRYPTO",
"recipient": "0x1234...abcd",
"refund": {
"address": "0x1234...abcd",
"reason": "execution failed: provider error",
"tx_hash": "0x9abc...ijkl"
},
"source_tx_hash": "0x1234...abcd",
"steps": [
{
"deposit_address": "5xVt9ovu6g6E4gvz9K9eV4kxY7yQZ8h3kZ2vY8xZ5xVt",
"kind": "deposit",
"rail": "CRYPTO"
}
]
}
Was this page helpful?
⌘I