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
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"
}
}
}Authorizations
To authenticate server-side requests
Body
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)
A unique identifier for the customer initiating the transaction.
"03b7030f-6da1-4d76-9352-cdebd82112c8"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The fee amount you would like Fern to deduct from the transaction. For Builder tier, developer fee must be greater than or equal to the fernFee.
Show child attributes
Show child attributes
When enabled guarantees that the exact destination amount from the quote will be received
Response
Response containing quote details including exchange rate, fees, and expiration
Response containing quote details including exchange rate, fees, and expiration
Unique identifier for this quote
"quote_abc123"
ISO timestamp when this quote expires (5 minutes from creation)
"2025-03-20T12:24:49.717Z"
The rate at which the source currency is multiplied to determine the equivalent amount in the destination currency
"1.2"
The amount that will be received after conversion and fees
"100"
Fee structure for a transaction
Show child attributes
Show child attributes
Was this page helpful?