Create quote
curl --request POST \
--url https://api.fernhq.com/quotes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customerId": "03b7030f-6da1-4d76-9352-cdebd82112c8",
"source": {
"sourceCurrency": "USD",
"sourcePaymentMethod": "ACH",
"sourceAmount": "100",
"sourcePaymentAccountId": "072a8b7b-38c7-429a-a6cf-35dae7f2fb77"
},
"destination": {
"destinationPaymentAccountId": "072a8b7b-38c7-429a-a6cf-35dae7f2fb77",
"destinationPaymentMethod": "ETHEREUM",
"destinationCurrency": "USD"
},
"guaranteeQuote": true
}
'import requests
url = "https://api.fernhq.com/quotes"
payload = {
"customerId": "03b7030f-6da1-4d76-9352-cdebd82112c8",
"source": {
"sourceCurrency": "USD",
"sourcePaymentMethod": "ACH",
"sourceAmount": "100",
"sourcePaymentAccountId": "072a8b7b-38c7-429a-a6cf-35dae7f2fb77"
},
"destination": {
"destinationPaymentAccountId": "072a8b7b-38c7-429a-a6cf-35dae7f2fb77",
"destinationPaymentMethod": "ETHEREUM",
"destinationCurrency": "USD"
},
"guaranteeQuote": True
}
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({
customerId: '03b7030f-6da1-4d76-9352-cdebd82112c8',
source: {
sourceCurrency: 'USD',
sourcePaymentMethod: 'ACH',
sourceAmount: '100',
sourcePaymentAccountId: '072a8b7b-38c7-429a-a6cf-35dae7f2fb77'
},
destination: {
destinationPaymentAccountId: '072a8b7b-38c7-429a-a6cf-35dae7f2fb77',
destinationPaymentMethod: 'ETHEREUM',
destinationCurrency: 'USD'
},
guaranteeQuote: true
})
};
fetch('https://api.fernhq.com/quotes', 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.fernhq.com/quotes",
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([
'customerId' => '03b7030f-6da1-4d76-9352-cdebd82112c8',
'source' => [
'sourceCurrency' => 'USD',
'sourcePaymentMethod' => 'ACH',
'sourceAmount' => '100',
'sourcePaymentAccountId' => '072a8b7b-38c7-429a-a6cf-35dae7f2fb77'
],
'destination' => [
'destinationPaymentAccountId' => '072a8b7b-38c7-429a-a6cf-35dae7f2fb77',
'destinationPaymentMethod' => 'ETHEREUM',
'destinationCurrency' => 'USD'
],
'guaranteeQuote' => true
]),
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.fernhq.com/quotes"
payload := strings.NewReader("{\n \"customerId\": \"03b7030f-6da1-4d76-9352-cdebd82112c8\",\n \"source\": {\n \"sourceCurrency\": \"USD\",\n \"sourcePaymentMethod\": \"ACH\",\n \"sourceAmount\": \"100\",\n \"sourcePaymentAccountId\": \"072a8b7b-38c7-429a-a6cf-35dae7f2fb77\"\n },\n \"destination\": {\n \"destinationPaymentAccountId\": \"072a8b7b-38c7-429a-a6cf-35dae7f2fb77\",\n \"destinationPaymentMethod\": \"ETHEREUM\",\n \"destinationCurrency\": \"USD\"\n },\n \"guaranteeQuote\": true\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.fernhq.com/quotes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": \"03b7030f-6da1-4d76-9352-cdebd82112c8\",\n \"source\": {\n \"sourceCurrency\": \"USD\",\n \"sourcePaymentMethod\": \"ACH\",\n \"sourceAmount\": \"100\",\n \"sourcePaymentAccountId\": \"072a8b7b-38c7-429a-a6cf-35dae7f2fb77\"\n },\n \"destination\": {\n \"destinationPaymentAccountId\": \"072a8b7b-38c7-429a-a6cf-35dae7f2fb77\",\n \"destinationPaymentMethod\": \"ETHEREUM\",\n \"destinationCurrency\": \"USD\"\n },\n \"guaranteeQuote\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fernhq.com/quotes")
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 \"customerId\": \"03b7030f-6da1-4d76-9352-cdebd82112c8\",\n \"source\": {\n \"sourceCurrency\": \"USD\",\n \"sourcePaymentMethod\": \"ACH\",\n \"sourceAmount\": \"100\",\n \"sourcePaymentAccountId\": \"072a8b7b-38c7-429a-a6cf-35dae7f2fb77\"\n },\n \"destination\": {\n \"destinationPaymentAccountId\": \"072a8b7b-38c7-429a-a6cf-35dae7f2fb77\",\n \"destinationPaymentMethod\": \"ETHEREUM\",\n \"destinationCurrency\": \"USD\"\n },\n \"guaranteeQuote\": true\n}"
response = http.request(request)
puts response.read_body{
"quoteId": "quote_abc123",
"expiresAt": "2025-03-20T12:24:49.717Z",
"estimatedExchangeRate": "1.2",
"destinationAmount": "100",
"fees": {
"feeCurrency": {
"label": "USDC",
"chain": "ETHEREUM",
"contractAddress": "0x123456789abcd123456789abcd123456789abcd",
"currencyDecimals": 18
},
"fernFee": {
"feeAmount": "5.45",
"feeUSDAmount": "5.45"
},
"developerFee": {
"feeAmount": "5.45",
"feeUSDAmount": "5.45"
}
}
}
Create quote
Create a quote
POST
/
quotes
Create quote
curl --request POST \
--url https://api.fernhq.com/quotes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customerId": "03b7030f-6da1-4d76-9352-cdebd82112c8",
"source": {
"sourceCurrency": "USD",
"sourcePaymentMethod": "ACH",
"sourceAmount": "100",
"sourcePaymentAccountId": "072a8b7b-38c7-429a-a6cf-35dae7f2fb77"
},
"destination": {
"destinationPaymentAccountId": "072a8b7b-38c7-429a-a6cf-35dae7f2fb77",
"destinationPaymentMethod": "ETHEREUM",
"destinationCurrency": "USD"
},
"guaranteeQuote": true
}
'import requests
url = "https://api.fernhq.com/quotes"
payload = {
"customerId": "03b7030f-6da1-4d76-9352-cdebd82112c8",
"source": {
"sourceCurrency": "USD",
"sourcePaymentMethod": "ACH",
"sourceAmount": "100",
"sourcePaymentAccountId": "072a8b7b-38c7-429a-a6cf-35dae7f2fb77"
},
"destination": {
"destinationPaymentAccountId": "072a8b7b-38c7-429a-a6cf-35dae7f2fb77",
"destinationPaymentMethod": "ETHEREUM",
"destinationCurrency": "USD"
},
"guaranteeQuote": True
}
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({
customerId: '03b7030f-6da1-4d76-9352-cdebd82112c8',
source: {
sourceCurrency: 'USD',
sourcePaymentMethod: 'ACH',
sourceAmount: '100',
sourcePaymentAccountId: '072a8b7b-38c7-429a-a6cf-35dae7f2fb77'
},
destination: {
destinationPaymentAccountId: '072a8b7b-38c7-429a-a6cf-35dae7f2fb77',
destinationPaymentMethod: 'ETHEREUM',
destinationCurrency: 'USD'
},
guaranteeQuote: true
})
};
fetch('https://api.fernhq.com/quotes', 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.fernhq.com/quotes",
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([
'customerId' => '03b7030f-6da1-4d76-9352-cdebd82112c8',
'source' => [
'sourceCurrency' => 'USD',
'sourcePaymentMethod' => 'ACH',
'sourceAmount' => '100',
'sourcePaymentAccountId' => '072a8b7b-38c7-429a-a6cf-35dae7f2fb77'
],
'destination' => [
'destinationPaymentAccountId' => '072a8b7b-38c7-429a-a6cf-35dae7f2fb77',
'destinationPaymentMethod' => 'ETHEREUM',
'destinationCurrency' => 'USD'
],
'guaranteeQuote' => true
]),
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.fernhq.com/quotes"
payload := strings.NewReader("{\n \"customerId\": \"03b7030f-6da1-4d76-9352-cdebd82112c8\",\n \"source\": {\n \"sourceCurrency\": \"USD\",\n \"sourcePaymentMethod\": \"ACH\",\n \"sourceAmount\": \"100\",\n \"sourcePaymentAccountId\": \"072a8b7b-38c7-429a-a6cf-35dae7f2fb77\"\n },\n \"destination\": {\n \"destinationPaymentAccountId\": \"072a8b7b-38c7-429a-a6cf-35dae7f2fb77\",\n \"destinationPaymentMethod\": \"ETHEREUM\",\n \"destinationCurrency\": \"USD\"\n },\n \"guaranteeQuote\": true\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.fernhq.com/quotes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customerId\": \"03b7030f-6da1-4d76-9352-cdebd82112c8\",\n \"source\": {\n \"sourceCurrency\": \"USD\",\n \"sourcePaymentMethod\": \"ACH\",\n \"sourceAmount\": \"100\",\n \"sourcePaymentAccountId\": \"072a8b7b-38c7-429a-a6cf-35dae7f2fb77\"\n },\n \"destination\": {\n \"destinationPaymentAccountId\": \"072a8b7b-38c7-429a-a6cf-35dae7f2fb77\",\n \"destinationPaymentMethod\": \"ETHEREUM\",\n \"destinationCurrency\": \"USD\"\n },\n \"guaranteeQuote\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fernhq.com/quotes")
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 \"customerId\": \"03b7030f-6da1-4d76-9352-cdebd82112c8\",\n \"source\": {\n \"sourceCurrency\": \"USD\",\n \"sourcePaymentMethod\": \"ACH\",\n \"sourceAmount\": \"100\",\n \"sourcePaymentAccountId\": \"072a8b7b-38c7-429a-a6cf-35dae7f2fb77\"\n },\n \"destination\": {\n \"destinationPaymentAccountId\": \"072a8b7b-38c7-429a-a6cf-35dae7f2fb77\",\n \"destinationPaymentMethod\": \"ETHEREUM\",\n \"destinationCurrency\": \"USD\"\n },\n \"guaranteeQuote\": true\n}"
response = http.request(request)
puts response.read_body{
"quoteId": "quote_abc123",
"expiresAt": "2025-03-20T12:24:49.717Z",
"estimatedExchangeRate": "1.2",
"destinationAmount": "100",
"fees": {
"feeCurrency": {
"label": "USDC",
"chain": "ETHEREUM",
"contractAddress": "0x123456789abcd123456789abcd123456789abcd",
"currencyDecimals": 18
},
"fernFee": {
"feeAmount": "5.45",
"feeUSDAmount": "5.45"
},
"developerFee": {
"feeAmount": "5.45",
"feeUSDAmount": "5.45"
}
}
}
Body
application/json
Get a proposed price for your specified currency route (price guaranteed for 5 mins)
Get a proposed price for your specified currency route (price guaranteed for 5 mins)
Response
Response containing quote details including exchange rate, fees, and expiration
Response containing quote details including exchange rate, fees, and expiration
Was this page helpful?