Create a swap
curl --request POST \
--url https://production.hifibridge.com/v2/wallets/swaps \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"requestId": "1ab3e6e0-4839-4dbe-89c3-b06d9645ae86",
"source": {
"userId": "05179f69-1988-4b46-a847-dd4eea0984d6",
"chain": "POLYGON",
"currency": "usdt",
"amount": "10000"
},
"destination": {
"chain": "POLYGON",
"currency": "usdc",
"userId": "05179f69-1988-4b46-a847-dd4eea0984d6",
"externalWalletId": "64fc4e9d-4839-4384-b4a0-0376af2c9b2e",
"walletAddress": "0xE9cfBf1D690565579D823264170eE357f80e9A34",
"amount": "10000"
}
}
'import requests
url = "https://production.hifibridge.com/v2/wallets/swaps"
payload = {
"requestId": "1ab3e6e0-4839-4dbe-89c3-b06d9645ae86",
"source": {
"userId": "05179f69-1988-4b46-a847-dd4eea0984d6",
"chain": "POLYGON",
"currency": "usdt",
"amount": "10000"
},
"destination": {
"chain": "POLYGON",
"currency": "usdc",
"userId": "05179f69-1988-4b46-a847-dd4eea0984d6",
"externalWalletId": "64fc4e9d-4839-4384-b4a0-0376af2c9b2e",
"walletAddress": "0xE9cfBf1D690565579D823264170eE357f80e9A34",
"amount": "10000"
}
}
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({
requestId: '1ab3e6e0-4839-4dbe-89c3-b06d9645ae86',
source: {
userId: '05179f69-1988-4b46-a847-dd4eea0984d6',
chain: 'POLYGON',
currency: 'usdt',
amount: '10000'
},
destination: {
chain: 'POLYGON',
currency: 'usdc',
userId: '05179f69-1988-4b46-a847-dd4eea0984d6',
externalWalletId: '64fc4e9d-4839-4384-b4a0-0376af2c9b2e',
walletAddress: '0xE9cfBf1D690565579D823264170eE357f80e9A34',
amount: '10000'
}
})
};
fetch('https://production.hifibridge.com/v2/wallets/swaps', 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://production.hifibridge.com/v2/wallets/swaps",
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([
'requestId' => '1ab3e6e0-4839-4dbe-89c3-b06d9645ae86',
'source' => [
'userId' => '05179f69-1988-4b46-a847-dd4eea0984d6',
'chain' => 'POLYGON',
'currency' => 'usdt',
'amount' => '10000'
],
'destination' => [
'chain' => 'POLYGON',
'currency' => 'usdc',
'userId' => '05179f69-1988-4b46-a847-dd4eea0984d6',
'externalWalletId' => '64fc4e9d-4839-4384-b4a0-0376af2c9b2e',
'walletAddress' => '0xE9cfBf1D690565579D823264170eE357f80e9A34',
'amount' => '10000'
]
]),
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://production.hifibridge.com/v2/wallets/swaps"
payload := strings.NewReader("{\n \"requestId\": \"1ab3e6e0-4839-4dbe-89c3-b06d9645ae86\",\n \"source\": {\n \"userId\": \"05179f69-1988-4b46-a847-dd4eea0984d6\",\n \"chain\": \"POLYGON\",\n \"currency\": \"usdt\",\n \"amount\": \"10000\"\n },\n \"destination\": {\n \"chain\": \"POLYGON\",\n \"currency\": \"usdc\",\n \"userId\": \"05179f69-1988-4b46-a847-dd4eea0984d6\",\n \"externalWalletId\": \"64fc4e9d-4839-4384-b4a0-0376af2c9b2e\",\n \"walletAddress\": \"0xE9cfBf1D690565579D823264170eE357f80e9A34\",\n \"amount\": \"10000\"\n }\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://production.hifibridge.com/v2/wallets/swaps")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"requestId\": \"1ab3e6e0-4839-4dbe-89c3-b06d9645ae86\",\n \"source\": {\n \"userId\": \"05179f69-1988-4b46-a847-dd4eea0984d6\",\n \"chain\": \"POLYGON\",\n \"currency\": \"usdt\",\n \"amount\": \"10000\"\n },\n \"destination\": {\n \"chain\": \"POLYGON\",\n \"currency\": \"usdc\",\n \"userId\": \"05179f69-1988-4b46-a847-dd4eea0984d6\",\n \"externalWalletId\": \"64fc4e9d-4839-4384-b4a0-0376af2c9b2e\",\n \"walletAddress\": \"0xE9cfBf1D690565579D823264170eE357f80e9A34\",\n \"amount\": \"10000\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://production.hifibridge.com/v2/wallets/swaps")
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 \"requestId\": \"1ab3e6e0-4839-4dbe-89c3-b06d9645ae86\",\n \"source\": {\n \"userId\": \"05179f69-1988-4b46-a847-dd4eea0984d6\",\n \"chain\": \"POLYGON\",\n \"currency\": \"usdt\",\n \"amount\": \"10000\"\n },\n \"destination\": {\n \"chain\": \"POLYGON\",\n \"currency\": \"usdc\",\n \"userId\": \"05179f69-1988-4b46-a847-dd4eea0984d6\",\n \"externalWalletId\": \"64fc4e9d-4839-4384-b4a0-0376af2c9b2e\",\n \"walletAddress\": \"0xE9cfBf1D690565579D823264170eE357f80e9A34\",\n \"amount\": \"10000\"\n }\n}"
response = http.request(request)
puts response.read_body{
"transferType": "WALLET.SWAP",
"transferDetails": {
"id": "dc923cc1-d74b-58f6-9fe4-9e9c6eb8dc37",
"requestId": "1ab3e6e0-4839-4dbe-89c3-b06d9645ae86",
"status": "COMPLETED",
"createdAt": "2025-08-20T03:55:29.437108+00:00",
"updatedAt": "2025-08-20T04:08:10.837+00:00",
"source": {
"currency": "usdc",
"amount": 10,
"chain": "POLYGON",
"userId": "05179f69-1988-4b46-a847-dd4eea0984d6"
},
"destination": {
"currency": "usdt",
"userId": "05179f69-1988-4b46-a847-dd4eea0984d6",
"externalWalletId": null,
"amount": null,
"chain": "POLYGON",
"walletAddress": "0xe5727a4B1d93A26D6A7Adfaae145EFa41ED7f204"
},
"error": null,
"errorDetails": null,
"quoteInformation": {
"sendGross": {
"amount": "10",
"currency": "usdc"
},
"sendNet": {
"amount": "10",
"currency": "usdc"
},
"receiveGross": {
"amount": "10",
"currency": "usdc"
},
"receiveNet": {
"amount": "10",
"currency": "usdc"
},
"rate": "1",
"expiresAt": "2025-08-20T03:55:59.539+00:00"
}
}
}{
"code": 123,
"error": "<string>",
"errorDetails": "<string>"
}{
"status": "error",
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"code": 123,
"error": "<string>",
"errorDetails": "<string>"
}Wallet Swaps
Create a swap
Create a swap request to exchange one cryptocurrency for another within the same chain or across chains.
POST
/
v2
/
wallets
/
swaps
Create a swap
curl --request POST \
--url https://production.hifibridge.com/v2/wallets/swaps \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"requestId": "1ab3e6e0-4839-4dbe-89c3-b06d9645ae86",
"source": {
"userId": "05179f69-1988-4b46-a847-dd4eea0984d6",
"chain": "POLYGON",
"currency": "usdt",
"amount": "10000"
},
"destination": {
"chain": "POLYGON",
"currency": "usdc",
"userId": "05179f69-1988-4b46-a847-dd4eea0984d6",
"externalWalletId": "64fc4e9d-4839-4384-b4a0-0376af2c9b2e",
"walletAddress": "0xE9cfBf1D690565579D823264170eE357f80e9A34",
"amount": "10000"
}
}
'import requests
url = "https://production.hifibridge.com/v2/wallets/swaps"
payload = {
"requestId": "1ab3e6e0-4839-4dbe-89c3-b06d9645ae86",
"source": {
"userId": "05179f69-1988-4b46-a847-dd4eea0984d6",
"chain": "POLYGON",
"currency": "usdt",
"amount": "10000"
},
"destination": {
"chain": "POLYGON",
"currency": "usdc",
"userId": "05179f69-1988-4b46-a847-dd4eea0984d6",
"externalWalletId": "64fc4e9d-4839-4384-b4a0-0376af2c9b2e",
"walletAddress": "0xE9cfBf1D690565579D823264170eE357f80e9A34",
"amount": "10000"
}
}
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({
requestId: '1ab3e6e0-4839-4dbe-89c3-b06d9645ae86',
source: {
userId: '05179f69-1988-4b46-a847-dd4eea0984d6',
chain: 'POLYGON',
currency: 'usdt',
amount: '10000'
},
destination: {
chain: 'POLYGON',
currency: 'usdc',
userId: '05179f69-1988-4b46-a847-dd4eea0984d6',
externalWalletId: '64fc4e9d-4839-4384-b4a0-0376af2c9b2e',
walletAddress: '0xE9cfBf1D690565579D823264170eE357f80e9A34',
amount: '10000'
}
})
};
fetch('https://production.hifibridge.com/v2/wallets/swaps', 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://production.hifibridge.com/v2/wallets/swaps",
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([
'requestId' => '1ab3e6e0-4839-4dbe-89c3-b06d9645ae86',
'source' => [
'userId' => '05179f69-1988-4b46-a847-dd4eea0984d6',
'chain' => 'POLYGON',
'currency' => 'usdt',
'amount' => '10000'
],
'destination' => [
'chain' => 'POLYGON',
'currency' => 'usdc',
'userId' => '05179f69-1988-4b46-a847-dd4eea0984d6',
'externalWalletId' => '64fc4e9d-4839-4384-b4a0-0376af2c9b2e',
'walletAddress' => '0xE9cfBf1D690565579D823264170eE357f80e9A34',
'amount' => '10000'
]
]),
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://production.hifibridge.com/v2/wallets/swaps"
payload := strings.NewReader("{\n \"requestId\": \"1ab3e6e0-4839-4dbe-89c3-b06d9645ae86\",\n \"source\": {\n \"userId\": \"05179f69-1988-4b46-a847-dd4eea0984d6\",\n \"chain\": \"POLYGON\",\n \"currency\": \"usdt\",\n \"amount\": \"10000\"\n },\n \"destination\": {\n \"chain\": \"POLYGON\",\n \"currency\": \"usdc\",\n \"userId\": \"05179f69-1988-4b46-a847-dd4eea0984d6\",\n \"externalWalletId\": \"64fc4e9d-4839-4384-b4a0-0376af2c9b2e\",\n \"walletAddress\": \"0xE9cfBf1D690565579D823264170eE357f80e9A34\",\n \"amount\": \"10000\"\n }\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://production.hifibridge.com/v2/wallets/swaps")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"requestId\": \"1ab3e6e0-4839-4dbe-89c3-b06d9645ae86\",\n \"source\": {\n \"userId\": \"05179f69-1988-4b46-a847-dd4eea0984d6\",\n \"chain\": \"POLYGON\",\n \"currency\": \"usdt\",\n \"amount\": \"10000\"\n },\n \"destination\": {\n \"chain\": \"POLYGON\",\n \"currency\": \"usdc\",\n \"userId\": \"05179f69-1988-4b46-a847-dd4eea0984d6\",\n \"externalWalletId\": \"64fc4e9d-4839-4384-b4a0-0376af2c9b2e\",\n \"walletAddress\": \"0xE9cfBf1D690565579D823264170eE357f80e9A34\",\n \"amount\": \"10000\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://production.hifibridge.com/v2/wallets/swaps")
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 \"requestId\": \"1ab3e6e0-4839-4dbe-89c3-b06d9645ae86\",\n \"source\": {\n \"userId\": \"05179f69-1988-4b46-a847-dd4eea0984d6\",\n \"chain\": \"POLYGON\",\n \"currency\": \"usdt\",\n \"amount\": \"10000\"\n },\n \"destination\": {\n \"chain\": \"POLYGON\",\n \"currency\": \"usdc\",\n \"userId\": \"05179f69-1988-4b46-a847-dd4eea0984d6\",\n \"externalWalletId\": \"64fc4e9d-4839-4384-b4a0-0376af2c9b2e\",\n \"walletAddress\": \"0xE9cfBf1D690565579D823264170eE357f80e9A34\",\n \"amount\": \"10000\"\n }\n}"
response = http.request(request)
puts response.read_body{
"transferType": "WALLET.SWAP",
"transferDetails": {
"id": "dc923cc1-d74b-58f6-9fe4-9e9c6eb8dc37",
"requestId": "1ab3e6e0-4839-4dbe-89c3-b06d9645ae86",
"status": "COMPLETED",
"createdAt": "2025-08-20T03:55:29.437108+00:00",
"updatedAt": "2025-08-20T04:08:10.837+00:00",
"source": {
"currency": "usdc",
"amount": 10,
"chain": "POLYGON",
"userId": "05179f69-1988-4b46-a847-dd4eea0984d6"
},
"destination": {
"currency": "usdt",
"userId": "05179f69-1988-4b46-a847-dd4eea0984d6",
"externalWalletId": null,
"amount": null,
"chain": "POLYGON",
"walletAddress": "0xe5727a4B1d93A26D6A7Adfaae145EFa41ED7f204"
},
"error": null,
"errorDetails": null,
"quoteInformation": {
"sendGross": {
"amount": "10",
"currency": "usdc"
},
"sendNet": {
"amount": "10",
"currency": "usdc"
},
"receiveGross": {
"amount": "10",
"currency": "usdc"
},
"receiveNet": {
"amount": "10",
"currency": "usdc"
},
"rate": "1",
"expiresAt": "2025-08-20T03:55:59.539+00:00"
}
}
}{
"code": 123,
"error": "<string>",
"errorDetails": "<string>"
}{
"status": "error",
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"code": 123,
"error": "<string>",
"errorDetails": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Unique identifier for the swap request (recommend using uuid v4)
Example:
"1ab3e6e0-4839-4dbe-89c3-b06d9645ae86"
Source wallet information for the swap
Show child attributes
Show child attributes
Destination wallet information for the swap
Show child attributes
Show child attributes
⌘I